[issue14674] Link to & explain deviations from RFC 4627 in json module docs

2012-08-24 Thread Chris Rebert

Chris Rebert added the comment:

Revised patch yet again to instead speak of "non-object, non-array" values and 
"JSON null, boolean, number, or string" values.

Re: Petri, the patch already mentions the specific parameters one can use to 
get stricter behavior, albeit not in that particular short paragraph. Feel free 
to edit the patch.


Any hope of getting this applied soon-ish? I began drafting this over 3 months 
ago, and yet this issue is tagged "easy"...

--
Added file: http://bugs.python.org/file26981/json.rst.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13212] json library is decoding/encoding when it should not

2012-08-24 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e587426d719f by Ned Deily in branch 'default':
Issue #15037: Use correct path to system terminfo database.
http://hg.python.org/cpython/rev/e587426d719f

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Eric Snow

Eric Snow added the comment:

So this boils down to set_data() not having a mode parameter, right?   Alas, 
the obvious approach, adding it, breaks backward compatibility.  The 
alternative is to use source_from_cache() in set_data() to get the source path, 
and then get the mode there.  Of course, differentiating between the use cases 
for set_data() seems important there too.  In short, "It may be rather hard to 
fix given the limitations of the set_data API".

Regardless, we'll need to be careful to use the loader's cache to avoid extra 
stat calls.

Also, we have to factor in issue6074 (basically do "mode | 0o600").  We'll need 
at least one more test to cover that (as Nick noted in that issue).

I have a patch that is close, but my eyes are getting a little heavy.  
Hopefully I'll have that up tomorrow.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Eric Snow

Changes by Eric Snow :


--
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

I have a patch that works, and that I think may point the way to a replacement 
API for set_data in 3.4. Just running the full test suite before I check it in.

The test you posted definitely saved me a lot of time.

My version bypasses the cache, though. This isn't a disaster, since the main 
reason the cache is there is to speed up *failing* stat calls - this new one 
only incurs the hit when actually writing the bytecode file to disk, which 
should be lost in the noise of the actual IO write operation.

However, suggestions for improvement always welcome :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15775] Add StopParser() to expat

2012-08-24 Thread Nemeskey Dávid

New submission from Nemeskey Dávid:

The C expat library provides XML_StopParser() method that allows the parsing to 
be stopped from the handler functions. It would be nice to have this option in 
Python as well, maybe by adding StopParser() method to the XMLParser class.

--
components: XML
messages: 168980
nosy: nemeskeyd
priority: normal
severity: normal
status: open
title: Add StopParser() to expat
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

Also, my patch precisely recreates 3.2 behaviour, so it will mean #6074 may 
also affect 3.3. That isn't a regression, hence not a release blocker, but 
would still be good to get fixed for rc1.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2012-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

Adding 3.3 to affected versions, since I'm about to check in a fix for #2051 
that will reintroduce this problem.

--
nosy: +eric.snow
versions: +Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15136] Decimal accepting Fraction

2012-08-24 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14965] super() and property inheritance behavior

2012-08-24 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3a831a0a29c4 by Nick Coghlan in branch 'default':
Close #2501: Permission bits are once again correctly copied from the source 
file to the cached bytecode file. Test by Eric Snow.
http://hg.python.org/cpython/rev/3a831a0a29c4

--
nosy: +python-dev
stage:  -> committed/rejected

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2012-08-24 Thread Nick Coghlan

Changes by Nick Coghlan :


--
Removed message: http://bugs.python.org/msg168983

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15762] Windows 8 certification

2012-08-24 Thread Aaron Galea

Aaron Galea added the comment:

Its a distutils issue not py2exe. Not sure where I should post about this 
problem. 

The change I applied was in msvc9compiler.py in distutils. Once this change has 
been applied py2exe was rebuild to generate the correct runw.exe with the 
correct settings in the PE header of the executable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

(oops, transposed the digits in the checkin message)

New changeset 3a831a0a29c4 by Nick Coghlan in branch 'default':
Close #2051: Permission bits are once again correctly copied from the source 
file to the cached bytecode file. Test by Eric Snow.
http://hg.python.org/cpython/rev/3a831a0a29c4

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cfb11045fc8a by Nick Coghlan in branch 'default':
Close #2051: Oops, transposed the digits in the issue number in the previous 
commit
http://hg.python.org/cpython/rev/cfb11045fc8a

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15136] Decimal accepting Fraction

2012-08-24 Thread Mark Dickinson

Mark Dickinson added the comment:

> I think *both* proposals are sensible. Fraction already has .from_decimal
> (using Decimal), so .to_decimal (also using Decimal) is sensible.

Well, there's a difference: conversion from Decimal to Fraction is 
well-defined, with a unique, unambiguous result (excluding non-convertibles 
like infinities and nans);  in particular, the value of any Decimal is exactly 
representable as a Fraction, so there's little information loss.  (There *is* 
still some information loss, since Decimal('1.00') and Decimal('1.0') both 
covert to the same fraction, for example.)

On the other hand, not every Fraction is exactly representable as a Decimal, so 
the result of conversion from Fraction to Decimal needs information about how 
many decimal places to produce, what rounding mode to use, what the ideal 
exponent should be in the case of exact results, etc.  I think Zachary's idea 
of supporting a context argument, and using the current context if none is 
supplied, is the way to go here.  The division should end up using an ideal 
exponent of 0, which doesn't seem unreasonable.

To the patch:  It looks fine, as far as it goes.  It needs tests.  To avoid the 
repetition of the division code, I'd suggest doing something like:

if context is None:
context = getcontext()

Yes, supporting __format__ is going to be a bit more work. :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10076] Regex objects became uncopyable in 2.5

2012-08-24 Thread Анхбаяр Лхагвадорж

Анхбаяр Лхагвадорж added the comment:

Ding.

--
nosy: +Анхбаяр.Лхагвадорж

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15753] No-argument super in method with variable arguments raises SystemError

2012-08-24 Thread James

James added the comment:

It turns out I don't really understand how frame objects work.  My patch can 
crash python if you do this:

>>> class A:
... def f(*args):
... args = 1
... print(super())
... 
>>> A().f()
python: Objects/typeobject.c:6516: super_init: Assertion 
`((PyObject*)(obj))->ob_type))->tp_flags & ((1L<<26))) != 0)' failed.
Aborted

Is there a way of checking if the first argument has been overwritten, or do 
you just have to assume that if it is still a tuple, it hasn't been?  Should 
the super documentation mention that assigning to self (or args in this case) 
can make the no-argument version work incorrectly?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Stefan Holek

New submission from Stefan Holek:

With virtualenv I can do

$ virtualenv .

but with pyvenv I get

$pyvenv .
Error: Directory exists: /Users/stefan/sandbox/foo

Please allow pyvenv to apply to existing directories.

--
components: None
messages: 168990
nosy: stefanholek
priority: normal
severity: normal
status: open
title: Allow pyvenv to work in existing directory
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15723] Python breaks OS' append guarantee on file writes

2012-08-24 Thread Charles-François Natali

Charles-François Natali added the comment:

I wouldn't rely on O_APPEND too much:
- it won't work on NFS, and probably other non-local filesystems
- it doesn't actually guarantee atomicity, because even though the the file 
offset and the write is done with locking, there is still the possibility of 
partial write

--
nosy: +neologix

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15723] Python breaks OS' append guarantee on file writes

2012-08-24 Thread Ralf Schmitt

Changes by Ralf Schmitt :


--
nosy: +schmir

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11776] Constructor signatures missing in types module documentation

2012-08-24 Thread Mike Hoy

Mike Hoy added the comment:

Lambda Changes patch.

--
Added file: 
http://bugs.python.org/file26982/issue11776-first-easy-part-lambda-.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15777] test_capi refleak

2012-08-24 Thread Ross Lagerwall

New submission from Ross Lagerwall:

results for fa745ed89b7a on branch "default"


test_capi leaked [2, 2, 2] references, sum=6


Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', 
'3:3:/home/antoine/cpython/refleaks/reflogEr4Oyp', '-x']


A fix is in progress...

--
assignee: rosslagerwall
messages: 168993
nosy: rosslagerwall
priority: normal
severity: normal
stage: needs patch
status: open
title: test_capi refleak
type: resource usage
versions: Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15765] test_getcwd_long_pathnames (in test_posix) kills NetBSD

2012-08-24 Thread Charles-François Natali

Charles-François Natali added the comment:

This doesn't look thread-related:
"""
load: 0.50  cmd: python 10630 [runnable] 0.27u 13.07s 46% 10976k
load: 0.87  cmd: python 10630 [runnable] 0.27u 94.24s 98% 10976k
"""

See the huge system time?
This probably means that the kernel is struggling with path name
resolution, although that's surprising because 4099 is a reasonable
limit.
Do you have something like strace or truss on NetBSD?
The first thing to try could be to lower the limit, and see what
happens, but it's really likely a FS scalibility limit you're hitting
(altough, once again, that's really surprising given the reasonable
limit). Are you running those under VMs?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15753] No-argument super in method with variable arguments raises SystemError

2012-08-24 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

The failing assertion is the "assert(PyTuple_Check(obj))" added by your patch.
At this point, "obj" is not the arguments tuple, but the first entry in 
"f->f_localsplus". Maybe this block should be moved a bit earlier?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15634] Add serialized decorator to the threading module

2012-08-24 Thread Charles-François Natali

Charles-François Natali added the comment:

"synchronized" has the merit of reusing Java's denomination, which this 
decorator intends to mimic, see 
http://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html

Basically, synchronize works with the object/class (implicit) reentrant lock.

--
nosy: +neologix

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15753] No-argument super in method with variable arguments raises SystemError

2012-08-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15753] No-argument super in method with variable arguments raises SystemError

2012-08-24 Thread James

James added the comment:

Sorry, I wasn't very clear.  super() currently works by assuming that self is 
the first entry in f_localsplus, which is defeated, for example, by doing:

>>> class A:
... def f(self):
... del self
... super()
... 
>>> A().f()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4, in f
SystemError: super(): arg[0] deleted
>>> class B:
... def f(self):
... self = 1
... super()
... 
>>> B().f()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4, in f
TypeError: super(type, obj): obj must be an instance or subtype of type

I don't know if this is the intended behaviour (in which case, my assertion 
that obj is a tuple should be replaced by just checking whether it is a tuple 
and raising an exception otherwise; and I suppose the super documentation 
should mention this caveat), or whether this should be fixed somehow.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Does it mean implicit implying --upgrade option if venv dir is '.'?

--
nosy: +asvetlov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15777] test_capi refleak

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 081507b4ae40 by Ross Lagerwall in branch '3.2':
Issue 15777: Fix a refleak in _posixsubprocess.
http://hg.python.org/cpython/rev/081507b4ae40

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14455] plistlib unable to read json and binary plist files

2012-08-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

plutil(1) supports writing json format. 

That written, the opensource parts of CoreFoundation on opensource.apple.com 
don't support reading or writing json files. 

I'm therefore -1 w.r.t. adding support for json formatted plist files, support 
for json can be added when Apple actually supports that it the system libraries 
and hence the format is stable.

--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue626452] Support RFC 2392 in email package

2012-08-24 Thread moijes12

moijes12 added the comment:

r.david.murray: I'd love to work on this and that is why I'm following this and 
634412. But I'm just getting started with contributing to Python and I've 
contributed to only to 15442 and thats not even accepted yet.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15753] No-argument super in method with variable arguments raises SystemError

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Changing exception type is not backward compatible and should be documented at 
least if that change is really required.
Personally I slightly prefer to leave SystemError untouched

--
nosy: +asvetlov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-24 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10606] Misspelling of Jamie Zawinski's surname in urllib.parse docstring

2012-08-24 Thread Michal Božoň

Michal Božoň added the comment:

this is still unfixed in Python 2.x

--
nosy: +mykhal
versions: +Python 2.6, Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Vinay Sajip

Vinay Sajip added the comment:

Running

pyvenv --clear .

should work, but doesn't because of the way the venv directory is initialised - 
a shutil.rmtree() call is used. This can cause problems on Windows (current 
directory is regarded as open and so cannot be deleted) and also on Posix, 
because the inode changes and you get "file not found" errors because e.g. the 
shell has pointers to the old inode and the venv files are added to the new 
inode.

The attached patch should work, as it deletes the venv directory contents 
rather than the venv directory itself. I'll just check with Georg that it's OK 
to commit this - I don't see any problem, as it's a bug-fix rather than a new 
feature, but I think it best to run it past him.

--
keywords: +patch
nosy: +georg.brandl
Added file: http://bugs.python.org/file26983/pyvenv.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13370] test_ctypes fails when building python with clang

2012-08-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

What code duplication do you mean?

The code in the switch statement at line 71 looks similar for the various case, 
but it isn't: there is variation in the types uses in the casts (and 
particularly in the cast used to read the input value).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13370] test_ctypes fails when building python with clang

2012-08-24 Thread Ronald Oussoren

Changes by Ronald Oussoren :


Removed file: http://bugs.python.org/file26972/smime.p7s

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13370] test_ctypes fails when building python with clang

2012-08-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Attached version of the patch without the change to the powerpc specific code. 

I will commit this version later today (after another testing round).

--
Added file: http://bugs.python.org/file26984/issue_13370-2.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15748] Various symlink test failures in test_shutil on FreeBSD

2012-08-24 Thread Trent Nelson

Trent Nelson added the comment:

Link to my freebsd-fs e-mail: 
http://lists.freebsd.org/pipermail/freebsd-fs/2012-August/014964.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

I'm not sure it makes sense to call this new API "PyGILState_EnsureEx". My 
concern is that the behaviour is quite different in the presence of an existing 
thread state:

Ensure:
- if a thread state exists, use that interpreter
- otherwise, use the default interpreter configured in the pystate.c globals

New API:
- if a thread state exists, and the interpreter doesn't match the requested 
one, fail with an error
- otherwise, use the requested interpreter

I guess it makes sense if we treat the NULL pointer as the degenerate case 
meaning "use the interpreter of this thread, or the default interpreter if no 
interpreter has been declared for this thread". PyGILState_Ensure would then 
simply call PyGILState_EnsureEx(NULL) internally.

So, my question for Graham would be, given this ability, would mod_wsgi still 
need the ability to change the default interpreter? Or would it be enough for 
you to be able to register the threads *you* create with a specific interpreter?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I don't like current --clear behavior, it's really useless because now venv 
just deletes everything from virtual environment.
You lose not only virtual env but files from your project also.
virtualenv cleans only /Lib directory, that's much better.

I think venv --clear should cleanup everything which it creates (I mean 
bin/include/lib for Posix and Scripts/Include/Lib for Windows). Not sure about 
pyvenv.cfg

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> New API:
> - if a thread state exists, and the interpreter doesn't match the
> requested one, fail with an error
> - otherwise, use the requested interpreter

That's not what I'm proposing. What I'm proposing is that the new API
uses a per-interpreter TLS key (so you can have several thread states
per OS thread).

So basically:

Ensure:
- look up global TLS key, which returns the thread state
- if no thread state (TLS lookup failed), create a new one for the main
interpreter and register it on the global TLS key

New API:
- look up the interpreter's TLS key, which returns the thread state
- if no thread state (TLS lookup failed), create a new one for the
interpreter and register it on the interpreter's TLS key

Graham is merely suggesting for simplification that "global TLS key" ==
"main interpreter's TLS key", so Ensure(...) ==
EnsureEx(main_interpreter, ...).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Vinay Sajip

Vinay Sajip added the comment:

Venvs should be regarded as throwaway; there is really no reason to add other 
files (e.g. project files) to venvs.

Two common patterns are:

1. Use a single place for all venvs (virtualenvwrapper does this)
2. Use a venv in a subdirectory of a project directory

The current implementation follows PEP 405, and the functionality was discussed 
on python-dev before being finalised.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15765] test_getcwd_long_pathnames (in test_posix) kills NetBSD

2012-08-24 Thread Trent Nelson

Trent Nelson added the comment:

Hacked the test to print out info each loop:


test_getcwd_long_pathnames (test.test_posix.PosixTester) ... [0/0] 
getcwd-test-directory-0123456789abcdef-01234567890abcdef
[1/57] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[2/114] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[3/171] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[4/228] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[5/285] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[6/342] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[7/399] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[8/456] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[9/513] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[10/570] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[11/627] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[12/684] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[13/741] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[14/798] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[15/855] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[16/912] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[17/969] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[18/1026] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[19/1083] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[20/1140] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[21/1197] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[22/1254] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[23/1311] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[24/1368] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[25/1425] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[26/1482] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[27/1539] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[28/1596] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[29/1653] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[30/1710] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[31/1767] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[32/1824] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[33/1881] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[34/1938] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[35/1995] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[36/2052] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[37/2109] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[38/2166] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[39/2223] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[40/2280] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[41/2337] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[42/2394] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[43/2451] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[44/2508] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[45/2565] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[46/2622] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[47/2679] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[48/2736] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[49/2793] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[50/2850] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[51/2907] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[52/2964] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[53/3021] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[54/3078] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[55/3135] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[56/3192] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[57/3249] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[58/3306] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[59/3363] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[60/3420] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[61/3477] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[62/3534] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[63/3591] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[64/3648] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[65/3705] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[66/3762] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[67/3819] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[68/3876] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[69/3933] getcwd-test-directory-0123456789abcdef-01234567890abcdef
[70/3990] getcwd-test-directory-0123456789abcdef-01234567890abcdef
^C^C
load: 1.08  cmd: python 4486 [runnable] 0.07u 14.38s 40% 10012k
load: 1.08  cmd: python 4486 [runnable] 0.07u 14.91s 40% 1001

[issue15751] Support subinterpreters in the GIL state API

2012-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

And the current "autoTLSkey" could move into the interpreter state object? I 
like it - that's a lot more flexible than the approach I was thinking of.

--
title: Add PyGILState_SwitchInterpreter -> Support subinterpreters in the GIL 
state API

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15751] Support subinterpreters in the GIL state API

2012-08-24 Thread Graham Dumpleton

Graham Dumpleton added the comment:

It is past my bed time and not thinking straight, but I believe Antoine is 
aligned with what I had in mind, as need multiple thread states per OS thread 
where each is associated with separate interpreter.

My main reason for allowing NULL to EnsureEX rather than requiring 
main_interpreter to be explicitly passed, is that way way back in time, my 
recollection is that getting access to the main interpreter pointer was a pain 
as you had to iterate over the list of interpreters and assume it was the last 
one due to it being created first. I don't remember there being a special 
global variable or function for getting a pointer to the main interpreter. This 
may well have changed since and there is an easier way do let me know. So saw 
it as a convenience.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Well, I see. Agree with your patch then, it is correct.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15511] _decimal does not build in PGUpdate mode

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cbd4fbb90e95 by Martin v. Löwis in branch 'default':
Issue #15511: Drop explicit dependency on pythonxy.lib from amd64 configuration.
http://hg.python.org/cpython/rev/cbd4fbb90e95

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15511] _decimal does not build in PGUpdate mode

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I now recall that I worked around this issue, by just copying python33.lib in 
the place where it's expected.

The right solution is not to configure a dependency on the .lib, as it will 
automatically be added by the pragma in the include file. The search path comes 
from the property files.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15710] logging module crashes in Python 2.7.3 for handler.setLevel(long)

2012-08-24 Thread Vinay Sajip

Vinay Sajip added the comment:

I don't feel it would be correct to allow long for log levels, since a log 
level is not intended to have that range. It would be more sensible to get the 
ESAPI developers to use a more appropriate boundary value; in general, negative 
log values are not used (they are not necessary).

--
resolution:  -> invalid
status: open -> pending
type: crash -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15710] logging module crashes in Python 2.7.3 for handler.setLevel(long)

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This seems to miss the point that it's a regression. int and long are supposed 
to be interchangeable for most purposes.

--
nosy: +pitrou
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Richard Oudkerk added the comment:

After playing with the patch on Linux it seems that Linux much prefers the 
realloc() scheme to the list-of-chunks scheme.

This new patch only does list-of-chunks on Windows.

--
Added file: http://bugs.python.org/file26985/readall-combined.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Attached is an alternative benchmark program which does not use subprocess.

--
Added file: http://bugs.python.org/file26986/readall-benchmark.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Changes by Richard Oudkerk :


Removed file: http://bugs.python.org/file26952/push-thru-cat.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Changes by Richard Oudkerk :


Removed file: http://bugs.python.org/file26970/readall-combined.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> After playing with the patch on Linux it seems that Linux much prefers
> the realloc() scheme to the list-of-chunks scheme.

What about the method call overhead in RawIO.readall(), and the
different progression of buffer sizes? (the realloc scheme uses larger
and larger read() sizes, while RawIO.readall() uses a constant read()
size).

By the way, not every non-Windows OS is Linux, so the patch is wrong.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15573] Support unknown formats in memoryview comparisons

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Is this still blocking the release? If so, it should be resolved within the 
next twelve hours, or else it may block the release until September.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15442] Expand the list of default dirs filecmp.dircmp ignores

2012-08-24 Thread R. David Murray

R. David Murray added the comment:

moijes12, thanks for the patch.  Since this is a new feature we'll need to wait 
until the 3.3 RC1 repo is branched before applying it.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Why is this blocking the release? It looks like a problem that can be solved in 
a bug fix release, or else by requiring that Python 3.3 users use a recent 
ncurses release.

--
nosy: +loewis
priority: release blocker -> normal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Stefan, your patch array_deprecate_u.diff is fine. If you get to it, please 
also rephrase the clause "Python's unicode type"; not sure what the convention 
is to refer to Py_UNICODE now (perhaps "historical unicode type").

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15765] test_getcwd_long_pathnames (in test_posix) kills NetBSD

2012-08-24 Thread Trent Nelson

Trent Nelson added the comment:

Looks like this is a duplicate of issue 9185.  The fix used for that just needs 
to be extended to cover NetBSD as well.  See proposed patch.  I'll commit this 
to 2.7 in a day or two if there are no objections.

Antoine: added you as nosy as you were involved with the original patch.

--
keywords: +patch
resolution:  -> duplicate
Added file: http://bugs.python.org/file26987/getcwd_netbsd.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15249] email.generator.BytesGenerator doesn't mangle "From " lines when non-ASCII bytes are present

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 119c645f310e by R David Murray in branch '3.2':
#15249: Mangle From lines correctly when body contains invalid bytes.
http://hg.python.org/cpython/rev/119c645f310e

New changeset b6ee4e8c7a77 by R David Murray in branch 'default':
Merge #15249: Mangle From lines correctly when body contains invalid bytes.
http://hg.python.org/cpython/rev/b6ee4e8c7a77

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15249] email.generator.BytesGenerator doesn't mangle "From " lines when non-ASCII bytes are present

2012-08-24 Thread R. David Murray

R. David Murray added the comment:

Thanks, LittleQ.  And Petri.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Georg Brandl

Georg Brandl added the comment:

LGTM, please apply.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Georg Brandl

Georg Brandl added the comment:

I don't agree that this is a blocker; would be nice to fix it, of course.

--
priority: release blocker -> critical

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

os.path.isdir("foo") will return True if "foo" is a symlink to a directory, and 
then shutil.rmtree("foo") will fail:

>>> os.path.isdir("foo")
True
>>> os.path.islink("foo")
True
>>> shutil.rmtree("foo")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/opt/lib/python3.3/shutil.py", line 456, in rmtree
"Not a directory: '{}'".format(path))
NotADirectoryError: [Errno 20] Not a directory: 'foo'

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0668fc196ce5 by Andrew Svetlov in branch 'default':
Issue #15776: Allow pyvenv to work in existing directory with --clean.
http://hg.python.org/cpython/rev/0668fc196ce5

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

It is bug in shutil.rmtree, right?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15136] Decimal accepting Fraction

2012-08-24 Thread Stefan Krah

Stefan Krah added the comment:

I agree with Mark's arguments. Yesterday I tried to use as_decimal() in
a small program and it did not feel natural to me. I'll probably continue
to use Decimal(f.numerator) / f.denominator.

If this goes in, I'd prefer that as_decimal() always uses a localcontext().
As the patch stands, using as_decimal() pollutes the global context flags, 
which can be quite unexpected:

>>> from fractions import Fraction as F
>>> F(1, 3).as_decimal()
Decimal('0.')
>>>
>>> import decimal
>>> decimal.getcontext()
Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-99, Emax=99, 
capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[InvalidOperation, 
DivisionByZero, Overflow])
>>>


If the function takes a context argument, it might be better to move it
into the decimal module as Decimal.from_fraction(context).


So I'm -1/7 on as_decimal(), but +1 for the __format__() method.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Brett Cannon

Brett Cannon added the comment:

It will get fixed today.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Senthil, either the module globals should be re-added for compatibility, or the 
commits should be reverted, IMO.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> It is bug in shutil.rmtree, right?

Read the documentation:

 shutil.rmtree(path, ignore_errors=False, onerror=None)

Delete an entire directory tree; path must point to a directory (but
not a symbolic link to a directory)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a0b3cb52816e by Georg Brandl in branch '3.2':
Closes #9374: add back now-unused module attributes; removing them is a 
backward compatibility issue, since they have a public-seeming name.
http://hg.python.org/cpython/rev/a0b3cb52816e

New changeset c93fbc2caba5 by Georg Brandl in branch 'default':
Closes #9374: merge with 3.2
http://hg.python.org/cpython/rev/c93fbc2caba5

New changeset a43481210964 by Georg Brandl in branch '2.7':
Closes #9374: add back now-unused module attributes; removing them is a 
backward compatibility issue, since they have a public-seeming name.
http://hg.python.org/cpython/rev/a43481210964

--
resolution: remind -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Georg Brandl

Changes by Georg Brandl :


--
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Georg Brandl

Georg Brandl added the comment:

Another *perfect* example how even the most innocuous-seeming patch can be 
wrong.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Good point.
I will prepare the patch to fix this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

New submission from Dave Malcolm:

In Python 3.2 and earlier:
>>> str(ImportError(b'foo'))
"b'foo'"

In Python 3.3:
>>> str(ImportError(b'foo'))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __str__ returned non-string (type bytes)

This appears to be due to commit 76272.

I'm attaching a patch which fixes it, though perhaps ImportError should 
type-check the arguments

Motivation:
This leads to a failure of the test suite for "docutils" when run under Python 
3.3 betas, specifically:

==
ERROR: test_unicode (test_error_reporting.ErrorStringTests)
--
Traceback (most recent call last):
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/test3/test_error_reporting.py",
 line 154, in test_unicode
str(ErrorString(ImportError(self.bs
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/build/lib/docutils/utils/error_reporting.py",
 line 124, in __str__
super(ErrorString, self).__str__())
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/build/lib/docutils/utils/error_reporting.py",
 line 74, in __str__
return str(self.data)
TypeError: __str__ returned non-string (type bytes)

See 
http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/test/test_error_reporting.py?revision=7464&view=markup
 for the test code.  Arguably docutils could just pick a different exception 
subclass.

--
messages: 169042
nosy: brett.cannon, dmalcolm
priority: normal
severity: normal
status: open
title: str(ImportError(b'foo')) fails
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> This appears to be due to commit 76272.

Could you give the changeset id? Revision numbers are not portable from one 
repository clone to another.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> What about the method call overhead in RawIO.readall(), and the
> different progression of buffer sizes? (the realloc scheme uses larger
> and larger read() sizes, while RawIO.readall() uses a constant read()
> size).

For this benchmark the call overhead does not seem to be noticeable, and using 
larger or adaptive read buffers does not seem to help either.  (I have tried 
both on Linux.)

> By the way, not every non-Windows OS is Linux, so the patch is wrong.

Wrong in the sense of not necessarily optimal for unknown platforms?  Well, the 
patch retains the old (intended) behaviour on other platforms, so I would call 
that conservative rather than wrong.  Are you suggesting switching behaviour 
depending on whether some macro is defined?


64-bit Linux with current patch (and using new benchmark):
amount = 1 MB; time taken = 0.003 secs; rate = 317.22 MB/s
amount = 2 MB; time taken = 0.007 secs; rate = 283.74 MB/s
amount = 4 MB; time taken = 0.011 secs; rate = 359.58 MB/s
amount = 8 MB; time taken = 0.020 secs; rate = 395.58 MB/s
amount = 16 MB; time taken = 0.030 secs; rate = 528.18 MB/s
amount = 32 MB; time taken = 0.051 secs; rate = 627.72 MB/s
amount = 64 MB; time taken = 0.088 secs; rate = 726.36 MB/s
amount = 128 MB; time taken = 0.133 secs; rate = 960.23 MB/s
amount = 256 MB; time taken = 0.258 secs; rate = 992.32 MB/s
amount = 512 MB; time taken = 0.482 secs; rate = 1062.30 MB/s

On 64-bit Linux with previous patch:
amount = 1 MB; time taken = 0.006 secs; rate = 158.07 MB/s
amount = 2 MB; time taken = 0.011 secs; rate = 177.23 MB/s
amount = 4 MB; time taken = 0.024 secs; rate = 169.32 MB/s
amount = 8 MB; time taken = 0.047 secs; rate = 170.39 MB/s
amount = 16 MB; time taken = 0.098 secs; rate = 163.65 MB/s
amount = 32 MB; time taken = 0.220 secs; rate = 145.19 MB/s
amount = 64 MB; time taken = 0.253 secs; rate = 253.32 MB/s
amount = 128 MB; time taken = 0.724 secs; rate = 176.80 MB/s
amount = 256 MB; time taken = 0.874 secs; rate = 293.02 MB/s
amount = 512 MB; time taken = 2.292 secs; rate = 223.38 MB/s

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Dave Malcolm added the comment:

Sorry, it's 6825fd9b00ed

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12623] "universal newlines" subprocess support broken with select- and poll-based communicate()

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I like to leave fixes to 3.4.
Any change can produce side-effects, which can be nightmare for upcoming 
release candidate.
Sure, Georg will share my opinion.
Though absence '\n' -> '\r\n' for input if OS is Windows and 
universal_newlines=True is not good.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Changes by Dave Malcolm :


--
keywords: +patch
Added file: http://bugs.python.org/file26988/fix-str-of-bogus-ImportError.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> For this benchmark the call overhead does not seem to be noticeable,
> and using larger or adaptive read buffers does not seem to help
> either.  (I have tried both on Linux.)

Ok, thank you.

> > By the way, not every non-Windows OS is Linux, so the patch is wrong.
> 
> Wrong in the sense of not necessarily optimal for unknown platforms?
> Well, the patch retains the old (intended) behaviour on other
> platforms, so I would call that conservative rather than wrong.

Hmm, you are right, there is no regression indeed.
I guess I don't like very much the idea of switching code paths based on
the platform for pure optimization reasons, but in this case it seems
useful (and simple enough).

> Are you suggesting switching behaviour depending on whether some macro
> is defined?

No, that would definitely be overkill.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Dave Malcolm added the comment:

(patch added)

--
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brian.curtin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Éric Araujo

Éric Araujo added the comment:

> Two common patterns are:
>
> 1. Use a single place for all venvs (virtualenvwrapper does this)
> 2. Use a venv in a subdirectory of a project directory

I’m a recent virtualenv user, but before I became a virtualenvwrapper fan I 
used to create venvs in the project top-level directory (typically a Mercurial 
clone root), using “virtualenv .”.

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Eric Snow

Eric Snow added the comment:

My patch was very similar.  _cache_bytecode() is a good addition.  Good point 
about the cache, too.

I'm not convinced that source_path is the right thing to add to the API (even 
just for SourceFileLoader).  I would have thought mode would have been more 
appropriate:

  def set_data(self, path, data, *, mode=0o666):

Then the "mode = _os.stat(source_path).st_mode" bit would get moved to 
_cache_bytecode().

My reasoning is that set_data() is useful to write any data relative to the 
Loader.  The concrete use case in the stdlib is for writing the .pyc files.  
Otherwise I'm not certain why the idea of "source_path" should be associated 
with set_data().  On the other hand, the idea of "mode" likewise may not be 
univeral enough to enshrine in the API, but I'd think it's more so than 
source_path.

I was going to ask about backward compatability, but then I realized that 
SourceFileLoader is new in 3.3 (SourceLoader is new in 3.2).  I'm also 
wondering why set_data() is not a part of the FileLoader API, but that's a 
question for another time (and version).  :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 91909962d7f5 by Brett Cannon in branch 'default':
Issue #15778: Coerce ImportError.args to a string when it isn't
http://hg.python.org/cpython/rev/91909962d7f5

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-08-24 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Oops. I had not seen Eric and Mattiahs comment to this issue, which
pointed out to the problem. Sorry for not acting on this.

Thanks Georg for adding those module attributes back.

On Fri, Aug 24, 2012 at 9:17 AM, Roundup Robot  wrote:
>
> Roundup Robot added the comment:
>
> New changeset a0b3cb52816e by Georg Brandl in branch '3.2':
> Closes #9374: add back now-unused module attributes; removing them is a 
> backward compatibility issue, since they have a public-seeming name.
> http://hg.python.org/cpython/rev/a0b3cb52816e
>
> New changeset c93fbc2caba5 by Georg Brandl in branch 'default':
> Closes #9374: merge with 3.2
> http://hg.python.org/cpython/rev/c93fbc2caba5
>
> New changeset a43481210964 by Georg Brandl in branch '2.7':
> Closes #9374: add back now-unused module attributes; removing them is a 
> backward compatibility issue, since they have a public-seeming name.
> http://hg.python.org/cpython/rev/a43481210964
>
> --
> resolution: remind -> fixed
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Link to & explain deviations from RFC 4627 in json module docs

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Chris, I'm gonna take a look if nobody beats me to it.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Brett Cannon

Brett Cannon added the comment:

I agree with Eric: set_data() is meant to be generic so as to allow writing 
arbitrary data, not just bytecode files. So while accepting a mode argument 
makes sense and I'm fine with in terms of possible API change (in the future), 
having a source_path argument I'm not comfortable with. So I'm going to just 
take Eric's idea and commit the change. I'm also making the argument _mode just 
to make sure no one relies on it until we can discuss API changes in the 
context of Python 3.4 sine we will need to clean up the loader APIs to have 
abstract source/bytecode stuff that can play nicely with file-based APIs to 
allow for reading generic file assets once we have all of these little bugs 
worked out.

And as for why set_data() is not part of FileLoader, that's because it isn't 
necessary to load files. =) It's in SourceFileLoader purely to facilitate 
writing bytecode files, but set_data() is not used at all in terms of the 
actual loading of source code (or bytecode files for that matter).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

New submission from James Hutchison:

Windows 7 64-bit, Python 3.2.3

This is a very odd issue and I haven't figured out what caused it. I have a 
python script that runs continuously. When it receives a request to do a task, 
it creates a new thread (not a new process), does the task, then sends out an 
e-mail to indicate it was done. It doesn't do this a lot (maybe 10 - 30 times a 
day). This is all the script does.

Well today, it randomly broke. It was working fine, then suddenly I was getting 
the following error when it would create an SMTP object:

socket.error: [Errno 10013] An attempt was made to access a socket in a way 
forbidden by its access permissions

What I found was, even after trying a different script that did nothing but 
create a simple SMTP connection to localhost, running with admin privileges, 
and even after rebooting the machine, I was getting this error. I checked my 
firewall and didn't see any changes (I share a group policy so I do not have 
full control). I also tried the script on a different machine and found no 
issue. The issue also persisted between IDLE and simply running python.exe

When I tried to debug the issue, I discovered the following piece of code made 
the issue go away:

s = socket.socket()
s.bind(('',50007))
s.listen(1);
s.close();

And it hasn't come back since. I've tried to reproduce the circumstances that 
my script was running by creating SMTP instances in a loop but haven't been 
able to recreate the error. Checking my log, there isn't anything abnormal that 
occurred just before this issue (like attempting to do the task several times 
at once or something).

--
components: Library (Lib)
messages: 169055
nosy: Jimbofbx
priority: normal
severity: normal
status: open
title: socket error [Errno 10013] when creating SMTP object
type: behavior
versions: Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0c661c5632e0 by Brett Cannon in branch 'default':
Issue #2051: Tweak last commit for this issue to pass in mode instead
http://hg.python.org/cpython/rev/0c661c5632e0

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Stefan Holek

Stefan Holek added the comment:

Hm. What I am actually after is to "bless" an existing directory – source files 
and all – with a virtualenv (or pyvenv). I am not interested in the command 
deleting anything from anywhere, why thank you.

Workflow:

$ git clone g...@github.com:stefanholek/foo
$ cd foo
$ virtualenv .
$ ./bin/python setup.py develop
$ ./bin/python setup.py -q test

This is how I use virtualenv at the moment and I'd rather not lose that 
ability. Thanks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Link to & explain deviations from RFC 4627 in json module docs

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 132886ef135d by Antoine Pitrou in branch '3.2':
Issue #14674: Add a discussion of the json module's standard compliance.
http://hg.python.org/cpython/rev/132886ef135d

New changeset 16c0e26fc9cd by Antoine Pitrou in branch 'default':
Issue #14674: Add a discussion of the json module's standard compliance.
http://hg.python.org/cpython/rev/16c0e26fc9cd

New changeset d413b36dbee5 by Antoine Pitrou in branch '2.7':
Issue #14674: Add a discussion of the json module's standard compliance.
http://hg.python.org/cpython/rev/d413b36dbee5

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >