mirror of https://github.com/python/cpython.git
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.
This commit is contained in:
parent
334b5b20f2
commit
2c85d826d8
|
@ -162,7 +162,10 @@ def writeFiles():
|
|||
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:
|
||||
|
|
Loading…
Reference in New Issue