[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2018-01-15 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 ___ Python tracker ___

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2018-01-15 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset fb8569e36f2629654d5bc9c7ba05978edce408f4 by Mariatta (Miss Islington (bot)) in branch '3.6': bpo-26330: Update shutil.disk_usage() documentation (GH-5184) (GH-5188) https://github.com/python/cpython/commit/fb8569e36f2629654d5bc9c7ba05978edce408f

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2018-01-14 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +5042 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2018-01-14 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset ee3b83547c6b0cac1da2cb44aaaea533a1d1bbc8 by Mariatta (Cheryl Sabella) in branch 'master': bpo-26330: Update shutil.disk_usage() documentation (GH-5184) https://github.com/python/cpython/commit/ee3b83547c6b0cac1da2cb44aaaea533a1d1bbc8 -

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2018-01-14 Thread Eryk Sun
Eryk Sun added the comment: This is the high-level shutil module, so why not try to use the resolved parent directory? For example: def disk_usage(path): try: total, free = nt._getdiskusage(path) except NotADirectoryError: path = os.path.dirname(nt._

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2018-01-14 Thread Cheryl Sabella
Change by Cheryl Sabella : -- versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___ ___ Python

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2018-01-14 Thread Cheryl Sabella
Cheryl Sabella added the comment: I've submitted a PR for the documentation change. -- nosy: +csabella ___ Python tracker ___ ___ Py

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2018-01-14 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +patch pull_requests: +5038 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2016-02-10 Thread STINNER Victor
STINNER Victor added the comment: > Different but kind of related, disk_usage() is not able to accept bytes: On Python 3, I don't think that it's a big issue: bytes filenames are deprecated. See the current thread on python-dev: https://mail.python.org/pipermail/python-dev/2016-February/143150.

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2016-02-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Different but kind of related, disk_usage() is not able to accept bytes: >>> shutil.disk_usage(b'.') Traceback (most recent call last): File "", line 1, in File "C:\python34\lib\shutil.py", line 989, in disk total, free = nt._getdiskusage(path) TypeE

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2016-02-10 Thread STINNER Victor
STINNER Victor added the comment: > You are right, my bad. No problem. I read the doc before replying, and it is not said that the path must exist or must be a directory: https://docs.python.org/dev/library/shutil.html#shutil.disk_usage > I'll fix doc mentioning that on Windows "path" can only

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2016-02-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: You are right, my bad. I'll fix doc mentioning that on Windows "path" can only be a directory (on UNIX it can also be a file). -- ___ Python tracker ___

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2016-02-10 Thread STINNER Victor
Changes by STINNER Victor : -- assignee: -> docs@python components: +Documentation, Windows nosy: +docs@python, paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2016-02-10 Thread STINNER Victor
STINNER Victor added the comment: >total, free = nt._getdiskusage(path) > NotADirectoryError: [WinError 267] The directory name is invalid The underlying C function is GetDiskFreeSpaceEx(): https://msdn.microsoft.com/fr-fr/library/windows/desktop/aa364937%28v=vs.85%29.aspx It takes a lpDire

[issue26330] shutil.disk_usage() on Windows can't properly handle unicode

2016-02-10 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola': On Python 3.4, Windows 7: >>> import shutil, os >>> path = 'psuugxik1s0รจ' >>> os.stat(path) os.stat_result(st_mode=33206, st_ino=6755399441249628, st_dev=3158553679, st_nlink=1, st_uid=0, st_gid=0, st_size=27136, st_atime=1455 116789, st_mtime=1455116789,