[issue34944] Update _dirnameW to accept long path names

2018-10-09 Thread Joe Pamer
Change by Joe Pamer : -- keywords: +patch pull_requests: +9157 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34944> ___ ___ Python-

[issue34944] Update _dirnameW to accept long path names

2018-10-09 Thread Joe Pamer
New submission from Joe Pamer : The fix for issue 32557 updated os__getdiskusage_impl to use _dirnameW for obtaining the parent directory of a file. This would cause a regression if the path exceeded 260 characters, since _dirnameW currently returns -1 if given a path >= MAX_PATH in len

[issue32557] allow shutil.disk_usage to take a file path on Windows also

2018-09-20 Thread Joe Pamer
Joe Pamer added the comment: Awesome - thanks, Steve - this is all super helpful! If you're cool with it I'd like to stick to using _dirnameW for now, and then follow up with another set of PRs for the fixes you've recommended. -- ___

[issue32557] allow shutil.disk_usage to take a file path on Windows also

2018-09-19 Thread Joe Pamer
Joe Pamer added the comment: Just to loop back, I updated the PR to avoid MAX_PATH and only allocate in the "not a directory" case. Thanks for getting back to me so quickly! One question, though, is that it *does* seem like MAX_PATH is still referenced in several places in pos

[issue32557] allow shutil.disk_usage to take a file path on Windows also

2018-09-18 Thread Joe Pamer
Joe Pamer added the comment: Got it - thanks! That sounds good to me, so I'll take a look at how other functions are working around MAX_PATH and update the diff to also avoid the copy when possible. -- ___ Python tracker <https://bugs.py

[issue32557] allow shutil.disk_usage to take a file path on Windows also

2018-09-17 Thread Joe Pamer
Joe Pamer added the comment: Hi! I decided to try fixing this one as a way to get acquainted with the code base. I went ahead and updated the backing NT C function, but please let me know if you'd prefer I update disk_usage as proposed. Thanks! -- nosy: +jo