Issue 20097: Bad use of `self` in importlib
Created on 2013-12-30 20:26 by cool-RR, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue20097-tests.diff | eric.snow, 2014-01-02 03:17 | review | ||
| Messages (10) | |||
|---|---|---|---|
| msg207105 - (view) | Author: Ram Rachum (cool-RR) * | Date: 2013-12-30 20:26 | |
There's a bad usage of `self` here:
http://hg.python.org/cpython/file/fd846837492d/Lib/importlib/_bootstrap.py#l1431
`self` isn't defined because it's a class method.
|
|||
| msg207106 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2013-12-30 20:29 | |
I don't see a class method at line 1431. |
|||
| msg207107 - (view) | Author: Ram Rachum (cool-RR) * | Date: 2013-12-30 20:32 | |
Sorry, bad link, this is the right link: http://hg.python.org/cpython/file/fd846837492d/Lib/importlib/_bootstrap.py#l1409 |
|||
| msg207110 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2013-12-30 20:40 | |
Thanks! :) |
|||
| msg207143 - (view) | Author: Eric Snow (eric.snow) * ![]() |
Date: 2014-01-02 03:09 | |
Here's a patch with tests that cover find_module() and find_spec() for WindowsRegistryFinder (the missing case) and fixes the bug. |
|||
| msg207144 - (view) | Author: Eric Snow (eric.snow) * ![]() |
Date: 2014-01-02 03:12 | |
The patch passes on my linux box and on my windows 7 laptop (using Visual Studio 2010 Express). |
|||
| msg207145 - (view) | Author: Eric Snow (eric.snow) * ![]() |
Date: 2014-01-02 03:17 | |
Here's an updated patch that fixes as copy-and-paste mistake. |
|||
| msg207199 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2014-01-03 02:15 | |
Would it be possible to put @unittest.skipUnless(...) on WindowsRegistryFinderTests instead of duplicating it? Except of this nit, the patch looks good to me. Note: WindowsRegistryFinder.find_spec() contains the comment: # XXX untested! Need a Windows person to write tests (otherwise mock out appropriately) |
|||
| msg207206 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2014-01-03 05:32 | |
New changeset 7dbb4c6cd30e by Eric Snow in branch 'default': Issue #20097: Fix bad use of "self" in importlib's WindowsRegistryFinder. http://hg.python.org/cpython/rev/7dbb4c6cd30e |
|||
| msg207208 - (view) | Author: Eric Snow (eric.snow) * ![]() |
Date: 2014-01-03 05:39 | |
Thanks for the review, Victor. As to that note, it is the subject of issue #19714. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:56 | admin | set | github: 64296 |
| 2014-01-03 05:39:24 | eric.snow | set | status: open -> closed messages: + msg207208 assignee: brett.cannon -> eric.snow |
| 2014-01-03 05:32:00 | python-dev | set | nosy:
+ python-dev messages: + msg207206 |
| 2014-01-03 02:15:56 | vstinner | set | nosy:
+ vstinner messages: + msg207199 |
| 2014-01-02 03:17:37 | eric.snow | set | files:
+ issue20097-tests.diff messages: + msg207145 |
| 2014-01-02 03:16:56 | eric.snow | set | files: - issue20097-tests.diff |
| 2014-01-02 03:12:27 | eric.snow | set | messages: + msg207144 |
| 2014-01-02 03:09:07 | eric.snow | set | files:
+ issue20097-tests.diff nosy:
+ eric.snow keywords:
+ patch |
| 2013-12-30 22:05:31 | brett.cannon | set | dependencies: + Add tests for importlib.machinery.WindowsRegistryFinder |
| 2013-12-30 22:04:51 | brett.cannon | set | stage: needs patch -> test needed |
| 2013-12-30 20:40:47 | christian.heimes | set | nosy:
+ brett.cannon messages: + msg207110 assignee: brett.cannon |
| 2013-12-30 20:32:27 | cool-RR | set | messages: + msg207107 |
| 2013-12-30 20:29:38 | christian.heimes | set | nosy:
+ christian.heimes messages: + msg207106 |
| 2013-12-30 20:26:41 | cool-RR | create | |

