开发者

Python pdb command history not working on Windows

开发者 https://www.devze.com 2023-03-13 10:23 出处:网络
I\'m using Windows 7 + Cygwin + Python 2.6 + cmd prompt. Since yesterday, command line history stopped working with pdb. I used the following lines in my python code for interactive debugging.

I'm using Windows 7 + Cygwin + Python 2.6 + cmd prompt. Since yesterday, command line history stopped working with pdb. I used the following lines in my python code for interactive debugging.

import pdb
pdb.set_trace()

Earlier, I was able to rec开发者_运维技巧all the command history with up arrow but it stopped working recently. I remember adding a few cygwin packages around the time it stopped working. If there's some easy/obvious way to find what caused the error please advise or else I'll try rolling back whatever I've installed.


After installing package pyreadline, I was able to use up/down arrow keys to go through the command history. readline does not install on Windows using pip, but pyreadline seems to be equivalent to it.


Check the readline package, and its compatibility with your version of pdb. Maybe you have to downgrade.

EDIT:

As you were talking about newly installed packages on Cygwin, I was assuming that you are using Cygwin's Python. Hence my reference to Cygwin's readline package, as this might be influencing an existing Python installation.


Re-installing python fixed it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号