[issue6972] zipfile.ZipFile overwrites files outside destination path

2012-04-08 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 +# make sure the zip file isn't traversing out of the path
 +if not targetpath.startswith(basepath):

Check is insufficient. basepath='/etc/asd', member.filename='../asdfgh'.

The issue10905 has relations with this issue.

P. S. Viewing patches in this issue is not working.

--

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



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-08 Thread mattip

mattip matti.pi...@gmail.com added the comment:

I was going to add a test for this to Lib/test/test_math.py, but found this 
comment:
# copysign(INF, NAN) may be INF or it may be NINF, since
# we don't know whether the sign bit of NAN is set on any
# given platform. 

I would try to claim this is fixable, by this patch:

--- Include\pymath.h.orig   Sun Apr 08 10:02:37 2012
+++ Include\pymath.hSun Apr 08 10:02:41 2012
@@ -150,7 +150,7 @@
  * doesn't support NaNs.
  */
 #if !defined(Py_NAN)  !defined(Py_NO_NAN)
-#define Py_NAN (Py_HUGE_VAL * 0.)
+#define Py_NAN abs(Py_HUGE_VAL * 0.)
 #endif

 /* Py_OVERFLOWED(X)

Should I rework the tests to reflect this and submit a patch?

--

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



[issue2193] Cookie Colon Name Bug

2012-04-08 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Ping.

--
nosy: +storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2193
___
___
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-04-08 Thread d9pouces

d9pouces pyt...@19pouces.net added the comment:

Here is the new patch, allowing read and write binary, json and xml plist files.

It includes both the plistlib.py and test/test_plistlib.py patches.
JSON format does not allow dates and data, so XML is used by default to write 
files.
I use the json library to write JSON plist files, but its output is slightly 
different from the Apple default output: keys of dictionaries are in different 
order. Thus, I removed the test_appleformattingfromliteral test for JSON files.

Similarly, my binary writer does not write the same binary files as the Apple 
library: my library writes the content of compound objects (dicts, lists and 
sets) before the object itself, while Apple writes the object before its 
content. Copying the Apple behavior results in some additional weird lines of 
code, for little benefit. Thus, I also removed the  
test_appleformattingfromliteral test for binary files.

Other tests are made for all the three formats.

--
Added file: http://bugs.python.org/file25156/plistlib_with_test.diff

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



[issue14222] Use time.steady() to implement timeout

2012-04-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 The not subject to adjustment property is more desirable than not.
 The undefined reference point property isn't harmful in this context 
 (the start time isn't exposed).

So you're closing the issue while you're in agreement with it?

--

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



[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

While converting code from Python 2 to Python 3, I came across the gotcha 
that strings implement __iter__ in Python 3 but not in Python 2.

Looking through the documentation, I don't seem to see anything like this 
mentioned in the library portion of either Python 2 or 3's documentation:

http://docs.python.org/library/stdtypes.html#iterator-types
http://docs.python.org/py3k/library/stdtypes.html#iterator-types

Or in the documentation describing differences between 2 and 3:

http://docs.python.org/release/3.0.1/whatsnew/3.0.html

In fact, the Python 2 and 3 sections on iterator types seem largely the same.  
Python 2's documentation even seems a bit misleading in this regard.  At the 
beginning of this section, it says, Sequences, described below in more detail, 
always support the iteration methods [of which __iter__() is the main one].  
And str and unicode are the first two types mentioned in that next section on 
sequence types.

Here is a blog post I came across about this issue:

http://plope.com/Members/chrism/python_2_vs_python_3_str_iter

I think it would be worth highlighting this issue somewhere in the Python 
documentation, or at least acknowledging the change (unless I'm simply looking 
in the wrong place, in which case maybe it should be made more visible).

--
assignee: docs@python
components: Documentation
messages: 157783
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: Document whether strings implement __iter__
type: enhancement
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Why is it so important if strings implement __iter__?  They are iterable in 
both versions, since iteration falls back on __getitem__ if no __iter__ is 
defined.  For user code it is irrelevant which of the iteration protocols is 
present.

--
nosy: +georg.brandl

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



[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

It is not so important.  I just feel that the change should be acknowledged 
somewhere -- insofar as the existing user documentation on iterator types 
already discusses __iter__().  As it stands now, the Python 2 documentation is 
a bit misleading because it seems to suggest that strings implement __iter__().

With regard to falling back to __getitem__(), that might actually be worth 
mentioning in the section on iterator types.  Up until today, I didn't know 
there was a distinction between a sequence protocol and an iterator 
protocol, as discussed here, for example--

http://blog.axant.it/archives/306

For user code, the user might want different behavior depending on whether 
something behaves like a list.  For that, they might be relying on something 
like the presence of __iter__().

--

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



[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

behaves like a list is misleading.  If you mean checking for iterable-ness, 
calling iter() on the object is the way to do it.

--

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



[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Okay, then that also might be worth mentioning.  As it stands now, the emphasis 
in the section on iterator types is on __iter__() (e.g. it is the main focus of 
the introduction), whereas iter() is barely mentioned (only in the sections on 
dicts and file objects).  So in addition to the suggestions above, perhaps the 
introduction to the section on iterator types could include a link to the 
iter() function with a description of its relationship to iterator types.

--

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



[issue14423] Getting the starting date of iso week from a week number and a year.

2012-04-08 Thread Esben Agerbæk Black

Changes by Esben Agerbæk Black esbe...@gmail.com:


Added file: http://bugs.python.org/file25157/isodates.patch

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



[issue10576] Add a progress callback to gcmodule

2012-04-08 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

A new patch, taking Antoine's review and comments into account.

--
Added file: http://bugs.python.org/file25158/gccallback.patch

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



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
components: +Interpreter Core -None
nosy: +mark.dickinson

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



[issue6972] zipfile.ZipFile overwrites files outside destination path

2012-04-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

To clarify what Serhiy said about the patches, the link to the patch works, but 
the Reitveld review button isn't working.  I get 'No issue exists with that id 
(6972)'.

--
nosy: +loewis

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



[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Honestly, I don't think there's much point in these optimizations. The first 
one (The sequence length and separator length are both 0) is probably useless.

--

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



[issue14524] Python-2.7.3rc2/Modules/_ctypes/libffi/src/dlmalloc.c won't compile on ia64-hp-hpux11.31 without -DHAVE_USR_INCLUDE_MALLOC_H

2012-04-08 Thread Paul A.

Paul A. p...@freeshell.org added the comment:

On Sun, Apr 08, 2012 at 02:01:05AM +, R. David Murray wrote:
 
 R. David Murray rdmur...@bitdance.com added the comment:
 
 Is this a bug report about configure, or a bug report about a crash during 
 compilation after you've adjusted the configure parameters?  It seems like 
 you are reporting two different things here.

You're right I see that doesn't quite make sense now.  The crash is
obviously much more critical.  I don't suppose there's a way of changing
the bug's title?  I'll open a new one if not.

 For the configure issue, would you care to suggest a patch?  I don't believe 
 we have any core developers with access to hpux.

Sure, I'd like to eventually, but knowing very little about auto-tools
that likely won't be very soon.  Are there docs anyone can recommend?

--

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



[issue14525] ia64-hp-hpux11.31 won't compile Python-2.6.8rc2 without -D_TERMIOS_INCLUDED

2012-04-08 Thread Paul A.

Paul A. p...@freeshell.org added the comment:

On Sun, Apr 08, 2012 at 02:06:46AM +, R. David Murray wrote:
 
 R. David Murray rdmur...@bitdance.com added the comment:
 
 Can you suggest a patch?  As I said on the other issue I don't believe any 
 core developers have access to hpux.

Sure, once I figure out what that patch will be.

--

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



[issue14526] Python-2.6.8rc2 test never finishes ia64-hp-hpux11.31

2012-04-08 Thread Paul A.

Paul A. p...@freeshell.org added the comment:

On Sun, Apr 08, 2012 at 02:13:39AM +, R. David Murray wrote:
 
 R. David Murray rdmur...@bitdance.com added the comment:
 
 Oh, wait, I see you are testing the security RC.  Is this a new problem, or 
 does it also occur with the previous released version of 2.6?

Yes... I'm not on that box right now, but from what I recall 2.6.7 and
2.7.2 did the same thing.  But seems as though the 2.7.3 rc has regressed.

--

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



[issue14526] Python-2.6.8rc2 test never finishes ia64-hp-hpux11.31

2012-04-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Can you clarify?  In what sense has the 2.7.3 rc regressed?

--

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



[issue14527] How to link with an external libffi?

2012-04-08 Thread Paul A.

Paul A. p...@freeshell.org added the comment:

On Sun, Apr 08, 2012 at 05:58:29AM +, Ross Lagerwall wrote:
 
 Ross Lagerwall rosslagerw...@gmail.com added the comment:
 
 If it is in a non-standard location, try setting the environment variables:
 
 LDFLAGS linker flags, e.g. -Llib dir if you have libraries in a 
 nonstandard directory lib dir
 CPPFLAGS(Objective) C/C++ preprocessor flags, e.g. -Iinclude dir if you 
 have headers in a nonstandard directory include dir

I'm pretty sure I've already been doing that, but I'll verify again soon
when I get the chance.

--

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



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-08 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Hmm.  I don't see this as a bug:  the sign of a nan isn't really all that 
meaningful anyway, and this doesn't (AFAIK) contradict any documentation.

On the other hand, given that most other aspects of floating-point are now 
reasonably portable across platforms (or at least those platforms that support 
IEEE 754), it may make sense to standardise this too, as a minor improvement 
for Python 3.3.

The patch does not look correct to me:  did you mean 'fabs' rather than 'abs'?  
Even then, the C standard says nothing (not even in annex F) about how fabs 
should behave when applied to a NaN.

Instead, if the platform supports IEEE 754 (e.g., if the short float repr code 
is in use), we could hard-code a NaN bit representation.  (Even though there 
are 2**53-2 distinct bit patterns representing NaNs, there are nevertheless a 
couple of obvious ones to choose:  there are exactly two quiet NaNs that don't 
arise by silencing a signaling NaN.  The one with the sign bit cleared would be 
an obvious choice;  I think it's the negation of the one that Intel uses by 
default, which does indeed have its sign bit set.)

--

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



[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-08 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

multiprocessing.reduction still appears to use DuplicateHandle to copy sockets.
I propose adding a pair of custom functions to _multiprocessing, that pickles 
and unpickles handles.  It can detect socket handles as being different from 
e.g. pipe handles by using WSADuplicateSocket and return a bytes object, 
similar to what is already done in socketmodule (see issue 14310)
On non-windows, this would be a no-op.
_multiprocessing already linkes with winsock, whereas the subprocess is part of 
python core which doesn't.

--
nosy: +kristjan.jonsson
status: closed - open

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



[issue14288] Make iterators pickleable

2012-04-08 Thread Kristján Valur Jónsson

Changes by Kristján Valur Jónsson krist...@ccpgames.com:


--
resolution:  - fixed
status: open - closed

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



[issue14520] Buggy Decimal.__sizeof__

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

Martin v. Löwis mar...@v.loewis.de added the comment:

There are really two options:

a) if an object is a container, and the contained is accessible to reflection 
(preferably through gc.get_referents), then the container shouldn't account for 
the size of the contained.
b) if the contained is not accessible (except for sys.get_objects() in a debug 
build), then the container should provide the total sum.

A memory debugger is supposed to find all objects (e.g. through gc.get_objects, 
and gc.get_referents), eliminate duplicate references, and then apply 
sys.getsizeof for each object. This should then not leave out any memory, and 
not count any memory twice.

--
nosy: +loewis

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



[issue14529] distutils's build_msi command ignores the data_files argument

2012-04-08 Thread Mario Vilas

New submission from Mario Vilas mvi...@gmail.com:

When creating an MSI installer on Python 2.7 (Windows, both in 32 and 64 bits) 
the data_files argument of the setup function is completely ignored. This 
results in broken installations.

--
assignee: eric.araujo
components: Distutils
messages: 157799
nosy: Mario.Vilas, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: distutils's build_msi command ignores the data_files argument
versions: Python 2.7

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



[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-08 Thread Andrew Svetlov

Andrew Svetlov andrew.svet...@gmail.com added the comment:

If fylesystem doesn't support unicode (only Windows directly does as I know) 
str filename should to be converted by `sys.getfilesystemencoding()`. `os.exec` 
family already does it as well as other fs functions — but they are supports 
bytes also.
Mayby deprecation bytes for high-level Popen is good idea.

--

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



[issue14530] distutils's build_wininst command fails to correctly interpret the data_files argument

2012-04-08 Thread Mario Vilas

New submission from Mario Vilas mvi...@gmail.com:

I tried the following:

setup(

data_files = [(sys.prefix_exec, os.path.join('Win32', 'BeaEngine.dll'))]

  # (... rest of the setup call here...)

)

This works perfectly when running the python setup.py install. But when 
generating an installer (not MSI but the exe file), the installer places the 
'BeaEngine.dll' in a subdirectory called 'python27'. For 64 bit builds, the 
subdirectory is called 'Python27-x64' instead.

The paths to my python installations are C:\Python27 and C:\Python27-x64 
respectively. The target folders should have been those, not 
C:\Python27-x64\Python27-x64 which is clearly wrong.

So far my workaround was this:

data_files = [(os.path.join(sys.prefix_exec,'..'), os.path.join('Win32', 
'BeaEngine.dll'))]

But of course, now my setup.py script only works for generating the installer, 
not for installing the module from sources.

--
assignee: eric.araujo
components: Distutils
messages: 157801
nosy: Mario.Vilas, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: distutils's build_wininst command fails to correctly interpret the 
data_files argument
versions: Python 2.7

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



[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 Honestly, I don't think there's much point in these optimizations. The first 
 one (The sequence length and separator length are both 0) is probably 
 useless.

This optimization changes the behavior.

... def __repr__(self): return 'B(' + super().__repr__() + ')'
... 
 B()
B(b'')
 B().join([])
b''

With the patch we get B(b'').

Regardless of whether optimization (which is negligible in this case), I don't 
know whether to consider such side effect desirable or undesirable.

bytes.join need to optimize for the 0- and 1-byte delimiter, but the proposed 
patch leads to pessimization:

Unpatched:
$ ./python -m timeit -s 'seq=[bytes([i]*10) for i in range(256)]' 
'b.join(seq)'
10 loops, best of 3: 43.3 msec per loop

Patched:
$ ./python -m timeit -s 'seq=[bytes([i]*10) for i in range(256)]' 'b 
.join(seq)'
10 loops, best of 3: 70.3 msec per loop

--

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



[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 Regardless of whether optimization (which is negligible in this case), I 
 don't know whether to consider such side effect desirable or undesirable.

After some thought, I realized that this is an erroneous behavior.

--

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



[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Side note: Windows requires that args be quoted with , not ', to work 
properly, at least with these args.

Main note: the patched test adds a space to the separator, but that is not 
enough to account for the difference.

c:\Programs\Python32python -m timeit -s seq=[bytes([i]*1000) for i in 
range(256)] b''.join(seq)
1 loops, best of 3: 31.7 usec per loop

c:\Programs\Python32python -m timeit -s seq=[bytes([i]*1000) for i in 
range(256)] b' '.join(seq)
1 loops, best of 3: 34.1 usec per loop

The behavior change is wrong and test_bytes.py seems to need augmentation. It 
begins with XXX This is a mess. [...].

class BaseBytesTest(unittest.TestCase):
def test_join(self)
tests b''.join([]) but as far as I can tell, not b'something'.join([]), the 
failing case found by Serhiy.
It end with # XXX more

--

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



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Edward Yang

New submission from Edward Yang ezy...@mit.edu:

When generating a backtrace from an interactive Python session (e.g. the input 
is from stdin, Python attempts to actually find a file named stdin, to 
somewhat hilarious consequences.

See the strace'd Python session below:

 foo
open(/etc/default/apport, O_RDONLY|O_LARGEFILE) = 3
Traceback (most recent call last):
  File stdin, line 1, in module
open(stdin, O_RDONLY|O_LARGEFILE)   = -1 ENOENT (No such file or directory)
open(stdin, O_RDONLY|O_LARGEFILE)   = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/pylint-0.24.0-py2.7.egg/stdin, 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/logilab_astng-0.22.0-py2.7.egg/stdin,
 O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/logilab_common-0.56.1-py2.7.egg/stdin,
 O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/unittest2-0.5.1-py2.7.egg/stdin,
 O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/stdin,
 O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/gitdb-0.5.4-py2.7-linux-i686.egg/stdin,
 O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/smmap-0.8.1-py2.7.egg/stdin, 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/async-0.6.1-py2.7-linux-i686.egg/stdin,
 O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/decorator-3.3.1-py2.7.egg/stdin,
 O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.7.2-py2.7-linux-i686.egg/stdin,
 O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/Sphinx-1.0.7-py2.7.egg/stdin, 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/docutils-0.8.1-py2.7.egg/stdin, 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/Jinja2-2.6-py2.7.egg/stdin, 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/Pygments-1.4-py2.7.egg/stdin, 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/nose-1.1.2-py2.7.egg/stdin, 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/home/ezyang/Dev/6.02/stdin, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No 
such file or directory)
open(/home/ezyang/Dev/pyafs/stdin, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No 
such file or directory)
open(/home/ezyang/Dev/wizard/stdin, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No 
such file or directory)
open(/home/ezyang/Dev/twisted/stdin, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No 
such file or directory)
open(/usr/local/lib/python2.6/site-packages/stdin, O_RDONLY|O_LARGEFILE) = 
-1 ENOENT (No such file or directory)
open(/home/ezyang/Work/shared-python/build/lib.linux-i686-2.6/stdin, 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open(/home/ezyang/Work/snarfs/python/coil/stdin, O_RDONLY|O_LARGEFILE) = -1 
ENOENT (No such file or directory)
open(/home/ezyang/Dev/py-github/src/stdin, O_RDONLY|O_LARGEFILE) = -1 
ENOENT (No such file or directory)
open(/usr/lib/python2.7/stdin, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such 
file or directory)
open(/usr/lib/python2.7/plat-linux2/stdin, O_RDONLY|O_LARGEFILE) = -1 
ENOENT (No such file or directory)
open(/usr/lib/python2.7/lib-tk/stdin, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No 
such file or directory)
open(/usr/lib/python2.7/lib-old/stdin, O_RDONLY|O_LARGEFILE) = -1 ENOENT 
(No such file or directory)
open(/usr/lib/python2.7/lib-dynload/stdin, O_RDONLY|O_LARGEFILE) = -1 
ENOENT (No such file or directory)
open(/usr/local/lib/python2.7/dist-packages/stdin, O_RDONLY|O_LARGEFILE) = 
-1 ENOENT (No such file or directory)
open(/usr/lib/python2.7/dist-packages/stdin, O_RDONLY|O_LARGEFILE) = -1 
ENOENT (No such file or directory)
open(/usr/lib/python2.7/dist-packages/Numeric/stdin, O_RDONLY|O_LARGEFILE) 
= -1 ENOENT (No such file or directory)
open(/usr/lib/python2.7/dist-packages/PIL/stdin, O_RDONLY|O_LARGEFILE) = -1 
ENOENT (No such file or directory)
open(/usr/lib/python2.7/dist-packages/gst-0.10/stdin, O_RDONLY|O_LARGEFILE) 
= -1 ENOENT (No such file or directory)
open(/usr/lib/python2.7/dist-packages/gtk-2.0/stdin, O_RDONLY|O_LARGEFILE) 
= -1 ENOENT (No such file or directory)
open(/usr/lib/pymodules/python2.7/stdin, O_RDONLY|O_LARGEFILE) = -1 ENOENT 
(No such file or directory)
open(/usr/lib/pymodules/python2.7/libubuntuone/stdin, O_RDONLY|O_LARGEFILE) 
= -1 ENOENT (No such file or directory)

[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 Main note: the patched test adds a space to the separator, but that is not 
 enough to account for the difference.

Sorry, I copied the wrong line.

$ ./python -m timeit -s seq=[bytes([i]*10) for i in range(256)] b' 
'.join(seq)
10 loops, best of 3: 45.6 msec per loop

But the conclusions are not affected, for larger byte strings patched
version will be 1.5-2 times slower in limit.

--

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



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-08 Thread mattip

mattip matti.pi...@gmail.com added the comment:

You are correct, the patch should use fabs
I would go with a standard, cross-platform definition of Py_NAN so that pickled 
objects could be opened by other platforms. Would this patch be better? It's 
more complicated as I needed to cast the repr of Py_NAN to a unsigned char[]. 
It passes the tests in test.test_math and handles the copysign in a more 
intuitive way

 math.copysign(1., float('nan')) = 1. on win32, microsoft compiler

diff -r efeca6ff2751 Include/pymath.h
--- a/Include/pymath.h  Thu Apr 05 22:51:00 2012 +0200
+++ b/Include/pymath.h  Sun Apr 08 22:20:16 2012 +0300
@@ -152,8 +152,13 @@
  * doesn't support NaNs.
  */
 #if !defined(Py_NAN)  !defined(Py_NO_NAN)
+#if DBL_MANT_DIG == 53 /* ieee 754 doubles */
+extern double * _Py_NAN;
+#define Py_NAN (*_Py_NAN)
+#else
 #define Py_NAN (Py_HUGE_VAL * 0.)
 #endif
+#endif

 /* Py_OVERFLOWED(X)
  * Return 1 iff a libm function overflowed.  Set errno to 0 before calling
diff -r efeca6ff2751 Modules/_math.c
--- a/Modules/_math.c   Thu Apr 05 22:51:00 2012 +0200
+++ b/Modules/_math.c   Sun Apr 08 22:20:16 2012 +0300
@@ -24,6 +24,10 @@
 static const double two_pow_p28 = 268435456.0; /* 2**28 */
 static const double zero = 0.0;

+#if DBL_MANT_DIG == 53 /* ieee 754 doubles */
+static const unsigned char _Py_NAN_as_char[8] = {0, 0, 0, 0, 0, 0, 0xf8, 0x7f};
+extern double * _Py_NAN = (double *)(_Py_NAN_as_char);
+#endif
 /* acosh(x)
  * Method :
  *  Based on

--

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



[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

Sorry, I agree with Georg, this isn't a bug, not even a documentation bug.  A 
type is free to implement iteration either by way of __iter__ or by way of 
__getitem__.  How it chooses to do so is an implementation detail (and 
different implementations have made different choices).

--
nosy: +rhettinger
resolution:  - invalid
status: open - closed

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



[issue14532] multiprocessing module performs a time-dependent hmac comparison

2012-04-08 Thread Jon Oberheide

New submission from Jon Oberheide j...@oberheide.org:

The multiprocessing module performs a time-dependent comparison of the HMAC 
digest used for authentication:

def deliver_challenge(connection, authkey):
import hmac
assert isinstance(authkey, bytes)
message = os.urandom(MESSAGE_LENGTH)
connection.send_bytes(CHALLENGE + message)
digest = hmac.new(authkey, message).digest()
response = connection.recv_bytes(256)# reject large message
if response == digest:
connection.send_bytes(WELCOME)
else:
connection.send_bytes(FAILURE)
raise AuthenticationError('digest received was wrong')

This comparison should be made time-independent as to not leak information 
about the expected digest and allow an attacker to derive the full digest.

More info on such timing attacks:

http://rdist.root.org/2009/05/28/timing-attack-in-google-keyczar-library/
http://rdist.root.org/2010/07/19/exploiting-remote-timing-attacks/

--
components: Library (Lib)
messages: 157809
nosy: Jon.Oberheide
priority: normal
severity: normal
status: open
title: multiprocessing module performs a time-dependent hmac comparison

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



[issue14532] multiprocessing module performs a time-dependent hmac comparison

2012-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +sbt

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



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

That does seem like silly behavior.  On the other hand, the only ill effect is 
likely the time required to execute the series of open calls which, in the 
interactive case, would not even be noticed on most systems.  Would you be 
interested in writing a patch?

--
nosy: +ned.deily
priority: normal - low
stage:  - needs patch
versions: +Python 3.2, Python 3.3 -Python 3.4

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



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Edward Yang

Edward Yang ezy...@mit.edu added the comment:

stdin is a valid name of a file on Unix systems. So the fix is not so clear.

ezyang@javelin:~$ python
Python 2.7.2+ (default, Oct  4 2011, 20:03:08) 
[GCC 4.6.1] on linux2
Type help, copyright, credits or license for more information.
 a
Traceback (most recent call last):
  File stdin, line 1, in module
Here’s an idea: when a (multi-variable) calculus course arrives at the 
topic of the *chain rule*, it should use as a worked example the multilayer 
perceptron—a topic you usually only find in an introductory artificial 
intelligence course. In fact, it’s ideal, since the treatment of this topic in 
most AI courses (at this point, I’ve taken two—a byproduct of slightly 
mismatched class schedules when you study abroad) involves *no* extra 
theoretical computer science content whatsoever. If you know the definition of 
a multilayer perceptron, any Calculus student who knows the chain rule should 
be able to work out the back-propagation algorithm—or perhaps I should call it 
a *recurrence.* 
NameError: name 'a' is not defined

--

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



[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 5493d44b56d8 by Antoine Pitrou in branch '3.2':
Issue #7978: socketserver now restarts the select() call when EINTR is returned.
http://hg.python.org/cpython/rev/5493d44b56d8

New changeset 97a0c6230ece by Antoine Pitrou in branch 'default':
Issue #7978: socketserver now restarts the select() call when EINTR is returned.
http://hg.python.org/cpython/rev/97a0c6230ece

--
nosy: +python-dev

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



[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset d941d1fcc6e6 by Antoine Pitrou in branch '2.7':
Issue #7978: socketserver now restarts the select() call when EINTR is returned.
http://hg.python.org/cpython/rev/d941d1fcc6e6

--

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



[issue14533] Modify regrtest to make test_main optional

2012-04-08 Thread R. David Murray

New submission from R. David Murray rdmur...@bitdance.com:

The attached patch makes 'test_main' optional for stdlib tests.  If a test 
module does not have a 'test_main', regrtest will use the unittest 
loadTestsFromModule loader to load the tests.

This moves us further in the direction of using normal unittest facilities 
instead of specialized regrtest ones.  Any test module that can be correctly 
run currently using python unittest -m test.test_xxx could be converted to use 
this by simply deleting its test_main, thus no longer requiring manual 
maintenance of the list of tests to run.  Not all tests can be converted that 
easily, however, since test_main sometimes does some additional things (such as 
reap_children or reap_threads).

--
files: dont_require_test_main.patch
keywords: patch
messages: 157816
nosy: michael.foord, pitrou, r.david.murray
priority: normal
severity: normal
status: open
title: Modify regrtest to make test_main optional
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file25159/dont_require_test_main.patch

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



[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

You must recompute the timeout when select() is interrupted: see issue #12338.

--

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



[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 You must recompute the timeout when select() is interrupted: see issue 
 #12338.

Ah, right. It's a minor issue, though. I would suggest opening a separate issue 
for it. The patch is now committed to all 3 branches (I'm finally convinced 
this is a bug worth fixing), so I'm closing this issue.

--
assignee: gregory.p.smith - 
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed
type: behavior - enhancement
versions: +Python 2.7

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



[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
type: enhancement - behavior

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



[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2012-04-08 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

SocketServer has been changed to restart select() on EINTR, but it doesn't 
recompute the timeout.

--

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



[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2012-04-08 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

 SocketServer has been changed to restart select() on EINTR,
 but it doesn't recompute the timeout.

See issue #7978.

--

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



[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2012-04-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Note that socketserver's timeout is not really important: it's just used for a 
polling loop, with a default of 0.5 seconds.

--

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



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +haypo

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



[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Jerzy Kozera

Jerzy Kozera jerzy.koz...@gmail.com added the comment:

I forgot to mention my patch is 3.3-only, sorry - it depends on changes from 
#12555 (http://hg.python.org/cpython/rev/41a1de81ef2b#l18.21 to be precise). To 
support 3.2 and 2.7:
 (1) select.error must be caught as in the original patch,
 (2) e.args[0] must be used - select.error doesn't have 'errno' attribute.
Should I prepare the patch for 3.2 and 2.7?

Regarding not updating the timeout, it was already mentioned above. Though as 
an afterthought, it might be worrying that if the process is receiving repeated 
signals with interval between them less than timeout, we might fall into 
infinite loop of select() when it should timeout, but that is probably very 
obscure case.

--

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



[issue14533] Modify regrtest to make test_main optional

2012-04-08 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

Looks good to me. Note that if module level setup and teardown is needed for 
running tests then it should be possible to do this with setUpModule and 
tearDownModule functions (unless those should *only* be done when running under 
regrtest).

--

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



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

The filename is retrieved from: traceback-frame-f_code-co_filename. 
co_filename is an arbitrary string. Example:

 exec(compile(1+a, /etc/passwd, exec))
Traceback (most recent call last):
  File stdin, line 1, in module
  File /etc/passwd, line 1, in module
root:x:0:0:root:/root:/bin/bash
NameError: name 'a' is not defined

root:x:0:0:root:/root:/bin/bash is the first line of the /etc/passwd file.

--

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



[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset f8e7fcd581ff by Antoine Pitrou in branch '3.2':
Fix the patch for issue #7978: select() raises select.error before 3.3, not 
OSError.
http://hg.python.org/cpython/rev/f8e7fcd581ff

New changeset 4298d6e79ecb by Antoine Pitrou in branch '2.7':
Fix the patch for issue #7978: select() raises select.error before 3.3, not 
OSError.
http://hg.python.org/cpython/rev/4298d6e79ecb

--

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



[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

  To support 3.2 and 2.7:
  (1) select.error must be caught as in the original patch,
  (2) e.args[0] must be used - select.error doesn't have 'errno'
 attribute.
 Should I prepare the patch for 3.2 and 2.7?

It shouldn't be necessary, I've just committed fixes.
Thanks for noticing!

--

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



[issue14502] Document better what happens on releasing an unacquired lock

2012-04-08 Thread Jim Jewett

Jim Jewett jimjjew...@gmail.com added the comment:

On Fri, Apr 6, 2012 at 10:32 PM, R. David Murray rep...@bugs.python.org wrote:

 R. David Murray rdmur...@bitdance.com added the comment:

 I, on the other hand, would prefer if it were made part of the API contract 
 that an
 error is raised, and to fix any stdlib implementations *of that API* that 
 don't conform
 to that.  (That is, locks from other modules may well not follow that API, 
 and their
 documentation should cover their API.)

Do you consider it reasonable that all stdlib Locks follow that API,
and change to raise either RuntimeError or a subclass?

I don't feel comfortable declaring that (not even only for future
feature releases), but if you do, or Guido does, or ... etc ... I'll
submit patches for at least dummy_threading and logging.

-jJ

--

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



[issue14526] Python-2.6.8rc2 test never finishes ia64-hp-hpux11.31

2012-04-08 Thread Paul A.

Paul A. p...@freeshell.org added the comment:

On Sun, Apr 08, 2012 at 04:16:39PM +, R. David Murray wrote:
 
 R. David Murray rdmur...@bitdance.com added the comment:
 
 Can you clarify?  In what sense has the 2.7.3 rc regressed?

Shouldn't have left that out -- I was referring to the crash in that
other bug I opened.  I don't think that was happening in 2.7.2, but I
should really confirm before spouting off too loudly.

I'm not on that network today, so let me get back to you tomorrow.

--

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



[issue14533] Modify regrtest to make test_main optional

2012-04-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I can't imagine when you'd *not* want setUpModule/tearDownModule to run, so 
that's a reasonable conversion path.  The other path for reap_children and 
reap_threads would be to apply them to the individual classes that require them 
within the test module.  Which you do depends on how many test classes need the 
cleanups, I think.

I'm sure there will be other subtleties to be solved for other modules.  Note 
that I'm not advocating anyone go through and wholesale convert test modules.  
But I think any time someone would otherwise have to update the list of tests 
in test_main, converting that test to eliminate test_main should be considered.

--

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



[issue14502] Document better what happens on releasing an unacquired lock

2012-04-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I think dummy_threading should be fixed (but only in 3.3, just in case it 
causes any backward compatibility issues with someone's code).

Logging I'd leave to Vinay to decide about.

I'm assuming that if any of the others devs nosy on this issue disagree with me 
that they will speak up :)

--
nosy: +vinay.sajip

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



[issue12537] mailbox's _become_message is very fragile

2012-04-08 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 5c1c402a63e5 by R David Murray in branch 'default':
#12537: in mailbox avoid depending on knowledge of email package internals
http://hg.python.org/cpython/rev/5c1c402a63e5

--
nosy: +python-dev

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



[issue12537] mailbox's _become_message is very fragile

2012-04-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

David, thanks for your assistance.  I didn't wind up using your patch, but the 
work you did was valuable in preparing the patch I committed.

What I did was turn your 'detect the attributes' recipe into a unit test.  I 
then applied your patch, but it didn't quite work.  I eventually figured out 
that the fix I suggested wasn't quite right, that in fact the right place to 
delete the attributes is in _become_message.  So I moved the list of attributes 
you developed in your patch into class attributes, so that what the final patch 
does is to copy everything *except* the attributes you found.

So, a successful resolution, thank you.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - behavior

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



[issue14523] IDLE's subprocess startup error

2012-04-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I'm sorry, but the bug tracker isn't a good place to get help.  You'll have 
better luck getting assistance for this on the python-list mailing list (see 
mail.python.org).

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type: crash - 

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