summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fileinput.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-26 03:11:57 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-26 03:11:57 (GMT)
commit2c85d826d8b95bb3e1141b5084bd0a575803d664 (patch)
tree8aafdfb6cb6992ca44c9871eb4b23ae1b473f4b0 /Lib/test/test_fileinput.py
parent334b5b20f284ff4b44cfe3a035e1654b23390028 (diff)
downloadcpython-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.py5
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: