Hi, When editing python src block using C-c ', the python shell is not set in Org edit buffer according to the :session header argument of the block. Consequently, commands such as python-shell-send-region cannot send python code to the correct python process. To address this, the attached patch defines org-babel-edit-prep:python in ob-python.el. In addition, I tried to use org-src-associate-babel-session at first, but found it doesn't work because it is called when enabling org-src-mode, where org-src--babel-info is still nil. It seems it has stopped working since 203bf5870, and I think it is safe to remove it and related stuffs to avoid confusion. Best, Liu Hui