[Python-Dev] Windows: Remove support of bytes filenames in the os module?

Alexander Walters tritium-list at sdamon.com
Mon Feb 8 12:10:50 EST 2016



On 2/8/2016 12:02, Brett Cannon wrote:
>
>
> If Unicode string don't work in Python 2 then what is Python 2/3 to do 
> as a cross-platform solution if we completely remove bytes support in 
> Python 3? Wouldn't that mean there is no common type between Python 2 
> & 3 that one can use which will work with the os module except native 
> strings (which are difficult to get right)?

The only solution then would be to do `if not PY3: arg = 
arg.encode(...);; os.SOMEFUNC(arg)`, pardon my psudocode.  Its annoying, 
but at least its not a language syntax change which means it isn't 
intractable, just an annoying roadblock.  If I had my druthers it would 
be put off until after 2.x is well and truly dead.



More information about the Python-Dev mailing list