> >See http://bugs.python.org/issue9260
> >
> >There's a patch there but it needs additional sophistication to remove
> >deadlocks when doing concurrent circular imports.
>
> I don't think that approach can work, as PEP 302 loaders can
> currently assume the global import lock is being held when
At 02:48 PM 7/22/2011 +0200, Antoine Pitrou wrote:
See http://bugs.python.org/issue9260
There's a patch there but it needs additional sophistication to remove
deadlocks when doing concurrent circular imports.
I don't think that approach can work, as PEP 302 loaders can
currently assume the g
On Fri, Jul 22, 2011 at 7:29 PM, Greg Ewing wrote:
> Is it really necessary to hold the import lock for so long?
> Presumably the import lock is there to protect access to
> things like sys.modules. Is that all? Could it be released
> after the module code is loaded and sys.modules has been
> upda
On Fri, 22 Jul 2011 21:29:23 +1200
Greg Ewing wrote:
>
> This whole episode seems to have resulted from a collision
> between two rather obscure things: that import statements
> involve locking things, and that some fairly innocuous
> looking calls, such as s.encode('ascii'), can trigger an
> imp
On 22 July 2011 10:29, Greg Ewing wrote:
> The reason for *that* was that my main module was a stub
> that imported the real main module, which did all its
> work directly from the module code. So the whole program
> was effectively running inside an import statement and
> holding onto the import
On 22Jul2011 21:29, Greg Ewing wrote:
[...]
| This whole episode seems to have resulted from a collision
| between two rather obscure things: that import statements
| involve locking things,
Necessary to avoid performing the module definitons twice when a module
is imported twice, surely?
| and
I recently encountered a very mysterious bug in which
a background thread would inexplicably hang while attempting
to make a connection using httplib.
Debugging as far as I could at the Python level led to
the surprising conclusion that it was hanging while
using the ascii codec to encode the hos