gh-119310: Fix encoding when reading old history file#121779
gh-119310: Fix encoding when reading old history file#121779ambv merged 7 commits intopython:mainfrom
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
1 similar comment
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
2ac46fd to
d009abf
Compare
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
| def test_readline_history_file(self): | ||
| # skip, if readline module is not available | ||
| readline = import_module('readline') | ||
| if readline.backend != "editline": | ||
| self.skipTest("GNU readline is not affected by this issue") |
There was a problem hiding this comment.
Since what we're trying to do is to fix reading old history files, you could add three history files to test data:
- an editline history file
- a readline history file
- a pyrepl history file with multiline blocks
That way all three would have tests and we wouldn't regress on all three fronts.
There was a problem hiding this comment.
This will have to wait for a future enhancement.
|
GH-123784 is a backport of this pull request to the 3.13 branch. |
This fixes the problem reading history files created with previous versions of python (that where using GNU readline). Checks that the file was created by readline and change the encoding to
unicode-escape.