Re: [Python-Dev] Draft PEP: "Simplified Package Layout and Partitioning"

2011-07-22 Thread Greg Ewing
Antoine Pitrou wrote: The additional confusion lies in the fact that a module can be shadowed by something which is not a module (a mere global variable). I find it rather baffling. I think we're stuck with that as long as we use the same syntax for importing a submodule and importing a non-mo

Re: [Python-Dev] Draft PEP: "Simplified Package Layout and Partitioning"

2011-07-22 Thread Greg Ewing
P.J. Eby wrote: "from x import y" means "import x; y = x.y". It actually means slightly more that that if y is a submodule, in which case it means "import x.y; y = x.y". -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.or

[Python-Dev] Import lock considered mysterious

2011-07-22 Thread Greg Ewing
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

Re: [Python-Dev] Python launcher command line usage (Was: 3.2.1 encoding surprise)

2011-07-22 Thread Michael Foord
On 22/07/2011 02:30, Vlad Riscutia wrote: If versioned filenames are added in addition to python.exe, it still might look confusing for most users: Why do I have python and python3.2 executables? What's the difference? I'd rather go with -v argument either way, for people that /know/ they want

Re: [Python-Dev] Import lock considered mysterious

2011-07-22 Thread Cameron Simpson
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

Re: [Python-Dev] Import lock considered mysterious

2011-07-22 Thread Paul Moore
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

Re: [Python-Dev] Import lock considered mysterious

2011-07-22 Thread Antoine Pitrou
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

Re: [Python-Dev] Python launcher command line usage (Was: 3.2.1 encoding surprise)

2011-07-22 Thread Brian Curtin
On Thu, Jul 21, 2011 at 20:30, Vlad Riscutia wrote: > If versioned filenames are added in addition to python.exe, it still might > look confusing for most users: Why do I have python and python3.2 > executables? What's the difference? I'd rather go with -v argument either > way, for people that *

Re: [Python-Dev] Import lock considered mysterious

2011-07-22 Thread Nick Coghlan
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

Re: [Python-Dev] Import lock considered mysterious

2011-07-22 Thread P.J. Eby
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

Re: [Python-Dev] Import lock considered mysterious

2011-07-22 Thread Antoine Pitrou
> >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

Re: [Python-Dev] Python launcher command line usage (Was: 3.2.1 encoding surprise)

2011-07-22 Thread Vlad Riscutia
OK then. I don't have a *strong* opinion against it, just thought that most people have one version of Python, maybe 2 versions as in 2.x and 3.x, so I would understand python2.exe, python3.exe but yeah, it's not that big of a deal either way. Thank you, Vlad On Fri, Jul 22, 2011 at 6:41 AM, Bria

[Python-Dev] Summary of Python tracker Issues

2011-07-22 Thread Python tracker
ACTIVITY SUMMARY (2011-07-15 - 2011-07-22) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open2886 ( +6) closed 21507 (+33) total 24393 (+39) Open issues wit

Re: [Python-Dev] 3.2.1 encoding surprise

2011-07-22 Thread Glenn Linderman
On 7/21/2011 5:44 PM, Mark Hammond wrote: On 22/07/2011 9:02 AM, Glenn Linderman wrote: Bad logic is get_configured_value! get_configured_value only looks in the global configuration file if there is a local configuration file that doesn't have the setting. It should look in the global configu