[issue12780] Clean up tests for pyc/pyo in __file__
Roundup Robot added the comment: New changeset 1745fd612d73 by R David Murray in branch '3.4': #12780: update inspect test skipIf for PEP 3147. https://hg.python.org/cpython/rev/1745fd612d73 New changeset 8120de25932f by R David Murray in branch 'default': Merge: #12780: update inspect test skipIf for PEP 3147. https://hg.python.org/cpython/rev/8120de25932f -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12780] Clean up tests for pyc/pyo in __file__
R. David Murray added the comment: It is not true that __file__ will always end with '.py'. If *only* the .pyc or .pyo file exists (not the PEP 3147 version, but just modname.pyc on the pythonpath), then __file__ will end with .pyc. It is also the case that __file__ may end with something *else*, such as .so on unix and .pyd on Windows, as it does in this particular case. So, dropping the extension check is the wrong logic fix. The correct fix is to make sure it isn't '.py', because the original check was making sure there wasn't source code to load. When might unicodedata be a python file and not a sourceless (from inspect's point of view) binary? pypy :) I have no idea if this is actually an issue on pypy, but I'd hate to introduce a new failure for them in the process of doing a cleanup. The reason for the __file__ check is that we are looking for an *external* compiled module for the test. Originally I used time, but that failed on windows because time is part of the main binary on windows and has no __file__ attribute. The idea behind doing the __file__ check is that someone re-packaging python might move unicodedata into the main binary on windows, since if I understand correctly which modules are included there is somewhat arbitrary. -- nosy: +r.david.murray resolution: - fixed stage: commit review - resolved status: open - closed versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12780] Clean up tests for pyc/pyo in __file__
Éric Araujo mer...@netwok.org added the comment: Seems reasonable to me. When did/does unicodedata ever have a __file__ attribute? No idea. Maybe it has to do with static vs. dynamic linking? Or alternate VMs? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12780] Clean up tests for pyc/pyo in __file__
Barry A. Warsaw ba...@python.org added the comment: Seems reasonable to me. When did/does unicodedata ever have a __file__ attribute? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12780] Clean up tests for pyc/pyo in __file__
Éric Araujo mer...@netwok.org added the comment: Barry, could you review the second part of the patch? (the first was committed) -- nosy: +barry versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12780] Clean up tests for pyc/pyo in __file__
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 98d13885a574 by Vinay Sajip in branch '3.2': Issue #12780: Removed checks in logging for .pyc/.pyo in __file__. http://hg.python.org/cpython/rev/98d13885a574 New changeset ac0c04d8eafb by Vinay Sajip in branch 'default': Issue #12780: Merged fix from 3.2. http://hg.python.org/cpython/rev/ac0c04d8eafb -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12780] Clean up tests for pyc/pyo in __file__
New submission from Éric Araujo mer...@netwok.org: After PEP 3147, __file__ always points to the py file, not pyc/pyo. I found two instances of obsolete code. -- files: fix-11599.diff keywords: patch messages: 142375 nosy: benjamin.peterson, eric.araujo, vinay.sajip priority: normal severity: normal stage: commit review status: open title: Clean up tests for pyc/pyo in __file__ versions: Python 3.3 Added file: http://bugs.python.org/file22940/fix-11599.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12780] Clean up tests for pyc/pyo in __file__
Changes by Éric Araujo mer...@netwok.org: Removed file: http://bugs.python.org/file22940/fix-11599.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12780] Clean up tests for pyc/pyo in __file__
Changes by Éric Araujo mer...@netwok.org: Added file: http://bugs.python.org/file22941/__file__-cant-contain-pyc-in-3.2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12780 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com