[New-bugs-announce] [issue7697] os.getcwd() should raise UnicodeDecodeError for arbitrary bytes

Florent Xicluna report at bugs.python.org
Wed Jan 13 23:35:09 CET 2010


New submission from Florent Xicluna <laxyf at yahoo.fr>:

When the current working directory is not decodable, the os.getcwd() function should raise an error.

>>> sys.getfilesystemencoding()
'utf-8'
>>> cwd=b'/tmp/\xe7'
>>> os.mkdir(cwd); os.chdir(cwd)
>>> os.getcwdb()
b'/tmp/\xe7'
>>> os.getcwd()  # Should raise UnicodeDecodeError
'/tmp/\udce7'

Python 2 raises the error.

----------
components: Extension Modules
messages: 97740
nosy: flox
severity: normal
status: open
title: os.getcwd() should raise UnicodeDecodeError for arbitrary bytes
type: behavior
versions: Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7697>
_______________________________________


More information about the New-bugs-announce mailing list