[issue21719] Returning Windows file attribute information via os.stat()

2014-06-20 Thread STINNER Victor
STINNER Victor added the comment: Can I make one small suggestion for a tweak there? A link to the docs for os.stat() would be good. I created the issue #21813 to enhance the documentation of os.stat_result. -- ___ Python tracker

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-19 Thread Zachary Ware
Zachary Ware added the comment: Committed as 706fab0213db (with the wrong issue number), with just a couple of comment tweaks (mostly to shorten a couple more lines) and some committer drudge-work. Thanks for your contribution, Ben! -- assignee: - zach.ware resolution: - fixed

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-19 Thread Ben Hoyt
Ben Hoyt added the comment: Great, thanks for committing! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21719 ___ ___ Python-bugs-list mailing

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-19 Thread Ben Hoyt
Ben Hoyt added the comment: BTW, thanks for the mention in What's New in Python 3.5: https://docs.python.org/3.5/whatsnew/3.5.html#os Can I make one small suggestion for a tweak there? A link to the docs for os.stat() would be good. So maybe instead of mentioning os.stat_result -- which

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-19 Thread Zachary Ware
Zachary Ware added the comment: If you want to make a patch to that effect, I'll commit it. At this point though, the whatsnew doc is just a stub and the whole document will be beaten into better shape closer to release time. -- ___ Python tracker

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-14 Thread Ben Hoyt
Ben Hoyt added the comment: Uploading a (hopefully final! :-) patch to fix Zach Ware's points from the code review: 1) use stat.FILE_ATTRIBUTE_DIRECTORY constant in test_os.py 2) break line length in stat.rst doc source -- Added file:

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-13 Thread Ben Hoyt
Ben Hoyt added the comment: Full patch to add this to Python 3.5 attached: * code changes to posixmodule.c and _stat.c * tests added in test_os.py and test_stat.py * docs added to os.rst and stat.rst -- keywords: +patch Added file: http://bugs.python.org/file35615/issue21719.patch

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-13 Thread Jim Jewett
Jim Jewett added the comment: Added version 3.5; is 3.4 somehow still correct? Set stage to patch review as there are still comments to deal with, but it looks pretty close to commit review. -- nosy: +Jim.Jewett stage: - patch review versions: +Python 3.4

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-13 Thread Zachary Ware
Zachary Ware added the comment: Not sure what you were going for on the version, Jim; you added 3.4, but this is a new feature for 3.5. -- versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21719

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-13 Thread Ben Hoyt
Ben Hoyt added the comment: Updated patch attached based on code reviews. I'm replying to the code review here as when I tried to reply on bugs.python.org/review I got a Python exception, AttributeError: NoneType has no attribute something or other. FYI, it seems Django is set up in debug

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-13 Thread Zachary Ware
Zachary Ware added the comment: Ben Hoyt wrote: I'm replying to the code review here as when I tried to reply on bugs.python.org/review I got a Python exception, AttributeError: NoneType has no attribute something or other. Generally when you get that you can just hit back and try again, it

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-13 Thread Ben Hoyt
Ben Hoyt added the comment: The idea is that _stat.c will use system-provided values wherever possible, but stat.py should be as accurate as we can make it to provide a backup for when _stat isn't around (either when it's just not built, which isn't an issue on Windows, or in another Python

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-12 Thread Ben Hoyt
Ben Hoyt added the comment: I've got a patch for this. Need to finish the docs and add tests, and then I'll post here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21719 ___

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-11 Thread Ben Hoyt
New submission from Ben Hoyt: I asked recently on python-dev [1] about adding a st_winattrs attribute to stat result objects on Windows, to return the full set of Windows file attribute bits, such as hidden or compressed status. Copying from that thread for a bit more context here: Python's

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-11 Thread Martin v . Löwis
Martin v. Löwis added the comment: Instead of the somewhat cryptic name winattrs, I suggest to call it st_file_attributes, as it is called in the Windows API (actually, GetFileAttributesEx calls it dwFileAttributes, but st_file_attributes could be considered a Pythonic spelling of that).

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-11 Thread Ben Hoyt
Ben Hoyt added the comment: Fair call -- st_file_attributes sounds good to me, and matches the prefix of the FILE_ATTRIBUTES_* constants better too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21719

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-11 Thread STINNER Victor
STINNER Victor added the comment: Instead of the somewhat cryptic name winattrs, I suggest to call it st_file_attributes (...) On Windows, os.stat() calls GetFileInformationByHandle() which fills a BY_HANDLE_FILE_INFORMATION structure, and this structure has a dwFileAttributes attribute.