summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-11-11 23:04:59 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-11-11 23:04:59 (GMT)
commit9a5499b4e54f1d74dfe41772d780511c8ad1120c (patch)
tree4aac685d27ffba930b8c36f4dc356aed6728a0b3 /Lib/test/test_cmd_line.py
parentd3013ffa49e889ff96ed967f574aa01b91b09f12 (diff)
downloadcpython-9a5499b4e54f1d74dfe41772d780511c8ad1120c.zip
cpython-9a5499b4e54f1d74dfe41772d780511c8ad1120c.tar.gz
cpython-9a5499b4e54f1d74dfe41772d780511c8ad1120c.tar.bz2
#3705: Command-line arguments were not correctly decoded when the
terminal does not use UTF8. Now the code propagates the unicode string as far as possible, and avoids the conversion to char* which implicitely uses utf-8. Reviewed by Benjamin.
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index d63dfa1..fc0e3a7 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -135,6 +135,12 @@ class CmdLineTest(unittest.TestCase):
self.exit_code('-c', 'pass'),
0)
+ # Test handling of non-ascii data
+ command = "assert(ord('\xe9') == 0xe9)"
+ self.assertEqual(
+ self.exit_code('-c', command),
+ 0)
+
def test_main():
test.support.run_unittest(CmdLineTest)