On Thu, 2 May 2013, Sylvain Thénault wrote:
On 30 avril 15:43, Chris Wong wrote:
Problem #1
----------
The fix in _search_zip is just to fix some error handling code that
probably was never tested. I don't think "file"... actually now that
I look at that patch, removing the file parameter was wrong, it
should be filepath instead of file. Oops, I can fix that.
Don't worry, this later pb has already been fixed. I'll take a look and
hopefuly integrate your other proposal.
I should explain the logic in the patch then. find_module() will return
None for the filename for built-in modules. (see below) I don't know why
the Python devs changed this behavior. I don't know what the correct
behavior in that case should be, but I would imagine it's not possible to
search the similarly named zip file (since there is no filename, nor is it
possible to find it on the system). Alternatively, you could detect that
it's a built in module and skip the check as well.
For Python 2.6.6
Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import imp
imp.find_module
<built-in function find_module>
imp.find_module('posix')
(None, 'posix', ('', '', 6))
But for Python 3.3.1
Python 3.3.1 (default, Apr 26 2013, 12:08:46)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
import imp
imp.find_module('posix')
(None, None, ('', '', 6))
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects