diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-26 03:11:57 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-26 03:11:57 (GMT) |
commit | 2c85d826d8b95bb3e1141b5084bd0a575803d664 (patch) | |
tree | 8aafdfb6cb6992ca44c9871eb4b23ae1b473f4b0 /Lib/test/test_fileinput.py | |
parent | 334b5b20f284ff4b44cfe3a035e1654b23390028 (diff) | |
download | cpython-2c85d826d8b95bb3e1141b5084bd0a575803d664.zip cpython-2c85d826d8b95bb3e1141b5084bd0a575803d664.tar.gz cpython-2c85d826d8b95bb3e1141b5084bd0a575803d664.tar.bz2 |
Try to handle sys.getfilesystemencoding() returning None.
ascii seems like the safest bet that it will exist. I wonder if utf-8
would be a better choice? This should get test_fileinput passing on OpenBSD.
Diffstat (limited to 'Lib/test/test_fileinput.py')
-rw-r--r-- | Lib/test/test_fileinput.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index f3a7841..301769e 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -162,7 +162,10 @@ if verbose: print "15. Unicode filenames" try: t1 = writeTmp(1, ["A\nB"]) - fi = FileInput(files=unicode(t1, sys.getfilesystemencoding())) + encoding = sys.getfilesystemencoding() + if encoding is None: + encoding = 'ascii' + fi = FileInput(files=unicode(t1, encoding)) lines = list(fi) verify(lines == ["A\n", "B"]) finally: |