-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
idle test fails at least on the 3.6 branch #77007
Comments
seen with the 3.6 branch 20180212, last known succeeding test is the 3.6.4 release. test test_idle failed -- Traceback (most recent call last):
File "/home/packages/python/3.6/python3.6-3.6.4/Lib/idlelib/idle_test/test_help_about.py", line 78, in test_file_buttons
self.assertEqual(f.readline().strip(), get('1.0', '1.end'))
File "/home/packages/python/3.6/python3.6-3.6.4/build-debug/../Lib/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1540: ordinal not in range(128) |
What system? test_idle passes on Windows. Unfortunately, none of the *nix or Mac buildbots run tkinter and hence no tests that require a live tk window, and this one does. Cheryl, what do you see on your linux? Byte 0xc3 in position 1540 is the first byte of the utf-8 encoding of the 'ö' in Löwis on line 27 of CREDITS.txt. So on your system, readline must be reading *and decoding* more of the file. I am puzzled that the test fails now if it passed with the 3.6.4 release, as it and the textfile have not been touched since last summer. In any case, I will add encoding='utf-8'to open. I will also use subtest to identify failing cases. I will need you to verify the fix on your system. |
The failure is reproduced on Posix locale. Files are open with bare open() which uses the locale encoding by default. Which is ASCII in this case. |
I just discovered that the default for me is some version of latin1, not ascii, so that utf-8 'ö' is read as 'ö'. Hence, no UnicodeDecodeError even if 'ö' is being read and decoded by the initial readline call. I presume the same is true on current Windows buildbots. Hence, it was a bug to not include an encoding in the test file open calls. (The widget itself *does* use explicit 'ascii' or 'utf-8' encodings for open().) |
I've been able to run the IDLE test suite on Linux. As far as this issue, there's also a readline in test_textview that you may want to add the encoding to, even though it's only reading __file__. |
I reproduced the exact failure by temporarily replacing 'utf-8' with 'ascii' in my clone. So I don't need anyone else to verify the fix. |
Serhiy, thanks for comment and review. |
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: