[issue27998] Remove support of bytes paths in os.scandir()

2016-10-04 Thread STINNER Victor

STINNER Victor added the comment:

I suggest to modify posixmodule.c to support bytes on Windows at the C
level.

Since Windows uses utf8, there is no more real reason to drop bytes support
only on Windows.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27998] Remove support of bytes paths in os.scandir()

2016-10-04 Thread Guido van Rossum

Guido van Rossum added the comment:

It went back and forth. The current feeling is to *keep* that support,
especially since their deprecation on Windows has been *undone* in
3.6. Feel free to update the title (though the initial comments may be
harder to understand without the context of the original title).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27998] Remove support of bytes paths in os.scandir()

2016-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm confused by the current title of this issue. Should the support of bytes 
paths in os.scandir() be removed or preserved? In latter case we can remove 
workaround code from os and glob.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27998] Remove support of bytes paths in os.scandir()

2016-09-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Nice!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27998] Remove support of bytes paths in os.scandir()

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't know what is the benefit of removing support of bytes paths in 
os.scandir(), but supporting bytes paths allows to remove ugly workarounds from 
os and glob modules.

 Lib/glob.py |   16 !!
 Lib/os.py   |   67 -!!!
 2 files changed, 73 deletions(-), 10 modifications(!)

--
keywords: +patch
Added file: http://bugs.python.org/file44810/cleanup_scandir_bytes.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27998] Remove support of bytes paths in os.scandir()

2016-09-07 Thread Steve Dower

Steve Dower added the comment:

There are only two references to bytes in the pep:

> Like the other functions in the os module, scandir() accepts either a 
> bytes or str object for the path parameter, and returns the 
> DirEntry.name and DirEntry.path attributes with the same type as
> path . However, it is strongly recommended to use the str type, as
> this ensures cross-platform support for Unicode filenames. (On
> Windows, bytes filenames have been deprecated since Python 3.3). 

I'm not concerned about supporting bytes here (with PEP 529, obviously), though 
the strong recommendation to use str should certainly stand.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27998] Remove support of bytes paths in os.scandir()

2016-09-07 Thread STINNER Victor

STINNER Victor added the comment:

I'm ok to support os.scandir(bytes) on Windows.

My long term goal was to drop bytes support on Windows, but it seems like the 
new trend is more to keep this support and even enhance it.

It's quite easy to support os.scandir(bytes) on Windows, whereas it seems 
tricky and annoying to have to emulate the feature in pure Python.

Note: I was the BDFL-delegate for the PEP 471 ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27998] Remove support of bytes paths in os.scandir()

2016-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

But why? The code of os and glob modules could be simpler if add the support.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27998] Remove support of bytes paths in os.scandir()

2016-09-07 Thread Steve Dower

Changes by Steve Dower :


--
title: Add support of bytes paths in os.scandir() -> Remove support of bytes 
paths in os.scandir()

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com