-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Move tarfile.filemode() into stat module #59012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As per: |
I'm not sure filemode() is the best name for this. On the other hand, I don't have any suggestion. |
I mention this because I wonder if you think stat should have more tests (and TestCase classes). If so, a new issue could be opened after this is applied and mentioned on mentor list as an entry level issue for newer contributors.
import warnings
def filemode(mode):
"Deprecated in this location; use stat.filemode."
warnings.warn("The undocumented tarfile.filemode function\n"
"has been moved to stat and documented there.",
DeprecationWarning, 2)
return stat.filemode(mode) Removal could be scheduled for 3.5 if not 3.4. There apparently is a way (unknown to me) to add a test that will fail in the future as a reminder.
|
Updated patch in attachment. |
Looks good enough to me except for the alias docstring. If someone does dir(tarfile) and help(filemode), they should get the message that it is a deprecated alias and should not use it. |
New changeset 492e6c6a01bb by Giampaolo Rodola' in branch 'default': |
New changeset 539fbd6e58f6 by Giampaolo Rodola' in branch 'default': |
Thanks. It should now be fixed. |
And there are test failures under Windows too :) ====================================================================== Traceback (most recent call last):
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_stat.py", line 42, in test_link
os.symlink(os.getcwd(), TESTFN)
NotImplementedError: CreateSymbolicLinkW not found ====================================================================== Traceback (most recent call last):
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_stat.py", line 38, in test_directory
self.assertEqual(get_mode(), 'drwx------')
AssertionError: 'drwxrwxrwx' != 'drwx------'
- drwxrwxrwx
+ drwx------
====================================================================== Traceback (most recent call last):
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_stat.py", line 27, in test_mode
self.assertEqual(get_mode(), '-rwx------')
AssertionError: '-rw-rw-rw-' != '-rwx------'
- -rw-rw-rw-
+ -rwx |
New changeset 39d24533c6b7 by Giampaolo Rodola' in branch 'default': |
Let's see how it goes now. |
Previous issue should have been fixed by now. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: