Opened 4 years ago

#8078 defect new

twisted.test.test_paths.UnicodeFilePathTests fails if LANG=C

Reported by: Tom Prince Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1696, in test_BytesInstantiationUnicodeChild
    child = fp.child(u"mon\u20acy")
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 843, in child
    ourPath = self._getPathAsSameTypeAs(path)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 823, in _getPathAsSameTypeAs
    return self._asTextPath()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 781, in _asTextPath
    return _asFilesystemText(self.path, encoding=encoding)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 641, in _asFilesystemText
    return path.decode(encoding)
exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 50: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_BytesInstantiationUnicodeChild
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1716, in test_BytesInstantiationUnicodePreauthChild
    child = fp.preauthChild(u"mon\u20acy")
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 872, in preauthChild
    ourPath = self._getPathAsSameTypeAs(path)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 823, in _getPathAsSameTypeAs
    return self._asTextPath()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 781, in _asTextPath
    return _asFilesystemText(self.path, encoding=encoding)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 641, in _asFilesystemText
    return path.decode(encoding)
exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 50: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_BytesInstantiationUnicodePreauthChild
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1637, in test_UnicodeInstantiationBytesChild
    child = fp.child(u'child-mon\u20acy'.encode('utf-8'))
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 843, in child
    ourPath = self._getPathAsSameTypeAs(path)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 821, in _getPathAsSameTypeAs
    return self._asBytesPath()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 769, in _asBytesPath
    return _asFilesystemBytes(self.path, encoding=encoding)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 619, in _asFilesystemBytes
    return path.encode(encoding)
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 50: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_UnicodeInstantiationBytesChild
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1667, in test_UnicodeInstantiationBytesPreauthChild
    child = fp.preauthChild(u'child-mon\u20acy'.encode('utf-8'))
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 872, in preauthChild
    ourPath = self._getPathAsSameTypeAs(path)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 821, in _getPathAsSameTypeAs
    return self._asBytesPath()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 769, in _asBytesPath
    return _asFilesystemBytes(self.path, encoding=encoding)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 619, in _asFilesystemBytes
    return path.encode(encoding)
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 50: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_UnicodeInstantiationBytesPreauthChild
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1922, in test_mixedTypeChildSearchPreauth
    fp.createDirectory()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1549, in createDirectory
    os.mkdir(self.path)
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 43: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_mixedTypeChildSearchPreauth
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1893, in test_mixedTypeSiblingExtension
    sibling.touch()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1393, in touch
    self.open('a').close()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1010, in open
    return open(self.path, mode + 'b')
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 43: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_mixedTypeSiblingExtension
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1864, in test_mixedTypeSiblingExtensionSearch
    sibling.touch()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1393, in touch
    self.open('a').close()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1010, in open
    return open(self.path, mode + 'b')
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 43: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_mixedTypeSiblingExtensionSearch
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1843, in test_mixedTypeTemporarySibling
    tempSibling = fp.temporarySibling(b".txt")
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1598, in temporarySibling
    ourPath = self._getPathAsSameTypeAs(extension)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 821, in _getPathAsSameTypeAs
    return self._asBytesPath()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 769, in _asBytesPath
    return _asFilesystemBytes(self.path, encoding=encoding)
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 619, in _asFilesystemBytes
    return path.encode(encoding)
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 43: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_mixedTypeTemporarySibling
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1939, in test_unicodeChildSearchPreauth
    fp.createDirectory()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1549, in createDirectory
    os.mkdir(self.path)
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 43: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_unicodeChildSearchPreauth
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1908, in test_unicodeSiblingExtension
    sibling.touch()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1393, in touch
    self.open('a').close()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1010, in open
    return open(self.path, mode + 'b')
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 43: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_unicodeSiblingExtension
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/tomprince/src/twisted/twisted/test/test_paths.py", line 1878, in test_unicodeSiblingExtensionSearch
    sibling.touch()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1393, in touch
    self.open('a').close()
  File "/home/tomprince/src/twisted/twisted/python/filepath.py", line 1010, in open
    return open(self.path, mode + 'b')
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 43: ordinal not in range(128)

twisted.test.test_paths.UnicodeFilePathTests.test_unicodeSiblingExtensionSearch
-------------------------------------------------------------------------------

Change History (0)

Note: See TracTickets for help on using tickets.