Message268849
| Author |
serhiy.storchaka |
| Recipients |
brett.cannon, eric.snow, ncoghlan, serhiy.storchaka |
| Date |
2016年06月19日.11:53:12 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1466337192.83.0.569731150376.issue27352@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Seems there is a bug in the implementation of the IMPORT_NAME opcode in ceval.c.
If the level argument is -1, it is not passed to __import__ (should never happen, but looks correct). If it is an integer != -1 in C long range, it is passed to __import__ (this is correct). But if it is not integer (e.g. None) or can't be converted to C long, an exception is set and __import__ is called with level and not cleared error (this is wrong).
In correct bytecode the level argument can be either integer or None. Default __import__ accepts only integers as the level argument and checks the range. Proposed patch makes the code always passing the level argument to __import__ unless it is None. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年06月19日 11:53:13 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, brett.cannon, ncoghlan, eric.snow |
| 2016年06月19日 11:53:12 | serhiy.storchaka | set | messageid: <1466337192.83.0.569731150376.issue27352@psf.upfronthosting.co.za> |
| 2016年06月19日 11:53:12 | serhiy.storchaka | link | issue27352 messages |
| 2016年06月19日 11:53:12 | serhiy.storchaka | create |
|