Issue1255
Created on 2009-01-28.21:01:28 by jfenwick, last changed 2009-07-30.03:22:35 by pjenvey.
msg4104 (view) |
Author: Jacob Fenwick (jfenwick) |
Date: 2009-01-28.21:02:08 |
|
Example:
>>> foo = __import__('os', '', '', [''], -1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: str indices must be integers
|
msg4105 (view) |
Author: Leonardo Soto (leosoto) |
Date: 2009-01-29.00:30:55 |
|
The second and third arguments to __import__ are supposed to be
dictionaries, not string. What code did you found which uses that idiom?
Changing the offending code to:
__import__('os', globals(), locals(), [''], -1)
Should fix the problem
[But, anyway, I'd like to know where the original code was found]
|
msg4106 (view) |
Author: Jacob Fenwick (jfenwick) |
Date: 2009-01-29.03:30:28 |
|
The immediate bug seems to be in django. I found it while testing
django-jython. I have submitted the bug and the patch to django here:
http://code.djangoproject.com/ticket/10144
However, I still think this should be abug against jython, as the test
succeeds in python, whereas it fails in jython. So this means there's
still a difference in how python and jython deal with this situation.
|
msg4961 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2009-07-30.03:22:35 |
|
I'd consider CPython accepting the str args as an implementation detail,
and a buggy one at that. closing out as this should be fixed in the latest
django
|
|
Date |
User |
Action |
Args |
2009-07-30 03:22:35 | pjenvey | set | status: open -> closed resolution: invalid messages:
+ msg4961 nosy:
+ pjenvey |
2009-03-14 14:50:26 | fwierzbicki | set | priority: low versions:
+ 2.5.1, - 2.5b1 |
2009-01-29 03:30:28 | jfenwick | set | messages:
+ msg4106 |
2009-01-29 02:52:56 | fwierzbicki | set | nosy:
+ fwierzbicki |
2009-01-29 00:30:56 | leosoto | set | messages:
+ msg4105 |
2009-01-28 23:36:13 | jfenwick | set | nosy:
+ leosoto |
2009-01-28 21:02:13 | jfenwick | set | messages:
+ msg4104 |
2009-01-28 21:01:29 | jfenwick | create | |
|