-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
.python_history file causes considerable slowdown #85735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The seemingly unlimited growth of the ".python_history"-file seems to cause a massive slowdown when starting or exiting python, the same after running commands. |
Using Python 3.8.3 on Windows 10 1803 |
How very odd. I use the Python interactive interpreter extensively, and have done so for years. My history file is only 500 lines. Did you happen to inspect the file before deleting it to see if it contained something odd? What does this print for you? import readline
readline.get_history_length() |
*slaps forehead* Of course it is, I'm running a customer history hook that has a limit of 500 lines in the history file. It looks to me that by default the history feature is set to unlimited lines, so I guess that implies that this isn't a bug and it is your responsibility to set a maximum history length. You can put these two lines in your Python startup file: import readline
readline.set_history_length(1000) # or any number you like Personally, I don't think that having a default setting that allows the history file to grow to 130MB is a good idea. |
No, sorry. The problem is not the history file, is the massive slow down it causes. And if you have to utilize a process monitoring tool to find out that the history file is the cause, its not a matter of responsibility . Still I wonder why this isn't an already widely known problem, or is this a new feature? (I am an seasoned developer but very new to python) |
Would be nice to have a set of environment variables to control the size and location of |
Maybe support the XDG directory structure out of the box?
|
related #88405 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: