mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #23672: Allow Idle to edit and run files with astral chars in name.
Patch by Mohd Sanad Zaki Rizvi.
This commit is contained in:
parent
8c125eb44b
commit
5c28e9f887
3 changed files with 27 additions and 9 deletions
16
Lib/idlelib/idle_test/test_editor.py
Normal file
16
Lib/idlelib/idle_test/test_editor.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import unittest
|
||||
from tkinter import Tk, Text
|
||||
from idlelib.EditorWindow import EditorWindow
|
||||
from test.support import requires
|
||||
|
||||
class Editor_func_test(unittest.TestCase):
|
||||
def test_filename_to_unicode(self):
|
||||
func = EditorWindow._filename_to_unicode
|
||||
class dummy(): filesystemencoding = 'utf-8'
|
||||
pairs = (('abc', 'abc'), ('a\U00011111c', 'a\ufffdc'),
|
||||
(b'abc', 'abc'), (b'a\xf0\x91\x84\x91c', 'a\ufffdc'))
|
||||
for inp, out in pairs:
|
||||
self.assertEqual(func(dummy, inp), out)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(verbosity=2)
|
Loading…
Add table
Add a link
Reference in a new issue