This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年10月29日 17:46 by arigo, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| x.py | arigo, 2008年10月29日 17:46 | The __getattr__ case fails | ||
| getattr_hooks_25.diff | zseil, 2008年11月17日 16:22 | |||
| getattr_hooks_trunk.diff | zseil, 2008年11月17日 16:22 | |||
| getattr_hooks_24.diff | zseil, 2008年11月17日 23:18 | security fix for Python 2.4 | ||
| Messages (6) | |||
|---|---|---|---|
| msg75322 - (view) | Author: Armin Rigo (arigo) * (Python committer) | Date: 2008年10月29日 17:46 | |
The attached example works in the __add__ and __getattribute__ cases on CPython, but fails in the __getattr__ case. All three cases work as the semantics say they should on Jython, IronPython and PyPy. It's admittedly an obscure use case. There is no reason that __getattr__ should behave differently. The behavior of __add__ and __getattribute__ is the "correct" one, according to the rule that special methods are bound (with __get__) before they are called. |
|||
| msg75440 - (view) | Author: Zaur Shibzoukhov (zaur) | Date: 2008年11月01日 08:09 | |
It's the issue for python 3.0 too |
|||
| msg75971 - (view) | Author: Ziga Seilnacht (zseil) * (Python committer) | Date: 2008年11月17日 16:22 | |
Here is a patch for trunk and 2.5 version. It also contains a fix for another crasher (see the tests). I only tested the 2.5 patch, because I don't have the tools for the trunk installed. |
|||
| msg75987 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年11月17日 22:39 | |
Thanks for the patch! Fixed in r67246. |
|||
| msg75992 - (view) | Author: Ziga Seilnacht (zseil) * (Python committer) | Date: 2008年11月17日 23:18 | |
Here is another patch, for Python 2.4, which contains only the security fix. Benjamin, will you also commit these backports? |
|||
| msg75993 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年11月17日 23:35 | |
Backported to 2.4 in r67250 and 2.5 in r67251. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:40 | admin | set | github: 48480 |
| 2008年11月17日 23:35:32 | benjamin.peterson | set | messages: + msg75993 |
| 2008年11月17日 23:18:04 | zseil | set | files:
+ getattr_hooks_24.diff messages: + msg75992 |
| 2008年11月17日 22:39:55 | benjamin.peterson | set | status: open -> closed nosy: + benjamin.peterson resolution: fixed messages: + msg75987 |
| 2008年11月17日 16:22:47 | zseil | set | files: + getattr_hooks_trunk.diff |
| 2008年11月17日 16:22:22 | zseil | set | files:
+ getattr_hooks_25.diff nosy: + zseil messages: + msg75971 keywords: + patch |
| 2008年11月01日 08:09:32 | zaur | set | nosy:
+ zaur messages: + msg75440 |
| 2008年10月29日 17:46:01 | arigo | create | |