[New-bugs-announce] [issue43395] os.path states that bytes can't represent all MBCS paths under Windows

Eric L. report at bugs.python.org
Thu Mar 4 01:31:25 EST 2021


New submission from Eric L. <ewl+python at lavar.de>:

The os.path documentation at https://docs.python.org/3/library/os.path.html states that:

> Vice versa, using bytes objects cannot represent all file names on Windows (in the standard mbcs encoding), hence Windows applications should use string objects to access all files.

This doesn't sound right and is at least misleading because anything can be represented as bytes, as everything (in a computer) is bytes at the end of the day, unless mbcs is really using something like half-bytes, which I couldn't find any sign of (skimming through the documentation, Microsoft seems to interpret it as DBCS, one or two bytes).

I could imagine that the meaning is that some bytes combinations can't be used as path under Windows, but I just don't know, and that wouldn't be a valid reason to not use bytes under Windows (IMHO).

----------
assignee: docs at python
components: Documentation
messages: 388077
nosy: docs at python, ericzolf
priority: normal
severity: normal
status: open
title: os.path states that bytes can't represent all MBCS paths under Windows
type: enhancement
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43395>
_______________________________________


More information about the New-bugs-announce mailing list