[issue5619] Pass MS CRT debug flags into subprocesses

2012-07-24 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto :


--
nosy: +ishimoto

___
Python tracker 

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



[issue15275] isinstance is called a more times that needed in ntpath

2012-07-24 Thread Manuel de la Pena

Manuel de la Pena  added the comment:

Tests indeed cover the changes made. I don't know about a decent way of doing 
benchmarks for the changes. Any recommendation?

> If this patch is applied I think it would be good to change posixpath too.

I agree and I'd love to do it but in a diff bug to make things self-contained, 
what do you think?

--

___
Python tracker 

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



[issue15435] Strange behavior when AttributeError raise inside a property get function

2012-07-24 Thread Cédric Krier

Cédric Krier  added the comment:

The problem is that the code of the property could raise an AttributeError. So 
this error is not showed by the traceback.

--

___
Python tracker 

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



[issue15435] Strange behavior when AttributeError raise inside a property get function

2012-07-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

Yup. It's unfortunate, but there's really nothing we can do about it - some 
protocols use exceptions, and if you raise an exception type that is part of 
the defined protocol as the result of a genuine error, then you're going to 
have a fun debugging exercise to deal with.

You'll often see a similar misdiagnosis with TypeError in conversion functions 
that try several different conversion techniques.

--
nosy: +ncoghlan
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue10399] AST Optimization: inlining of function calls

2012-07-24 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue14197] OS X framework builds do not create ABI-suffixed libpython3.x

2012-07-24 Thread Ned Deily

Ned Deily  added the comment:

The attached patch ensures that additional SOABI-suffixed symlinks are created 
in the framework lib and lib/pythonx.x/config-yy directories and fixes 
pythons.x-config to not return garbage data for the --ldflags option. 

# current
$ ls -l /Library/Frameworks/Python.framework/Versions/3.2/lib
total 8
lrwxr-xr-x   1 root  wheel 9 Jul 15 17:40 libpython3.2.dylib@ -> ../Python
drwxrwxr-x   2 root  admin   170 Apr 10 11:27 pkgconfig/
drwxrwxr-x  32 root  admin  6290 Apr 10 11:27 python3.2/

# with patch
$ ls -l /Library/Frameworks/Python.framework/Versions/3.2/lib
total 16
lrwxr-xr-x   1 root  wheel 9 Jul 24 02:43 libpython3.2.dylib@ -> ../Python
lrwxr-xr-x   1 root  wheel 9 Jul 24 02:43 libpython3.2m.dylib@ -> ../Python
drwxrwxr-x   2 root  admin   170 Jul 24 02:38 pkgconfig/
drwxrwxr-x  34 root  admin  6494 Jul 24 02:38 python3.2/

# current
$ ls -l 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m/
total 256
-rw-rw-r--  1 root  admin  51118 Apr 10 11:27 Makefile
-rw-rw-r--  1 root  admin  15018 Apr 10 11:27 Setup
-rw-rw-r--  1 root  admin370 Apr 10 11:27 Setup.config
-rw-rw-r--  1 root  admin 41 Apr 10 11:27 Setup.local
-rw-rw-r--  1 root  admin   2902 Apr 10 11:27 config.c
-rw-rw-r--  1 root  admin   1642 Apr 10 11:27 config.c.in
-rwxrwxr-x  1 root  admin   7122 Apr 10 11:27 install-sh*
lrwxr-xr-x  1 root  wheel 15 Jul 15 17:40 libpython3.2.a@ -> ../../../Python
lrwxr-xr-x  1 root  wheel 15 Jul 15 17:40 libpython3.2.dylib@ -> 
../../../Python
-rwxrwxr-x  1 root  admin   7460 Apr 10 11:27 makesetup*
-rw-rw-r--  1 root  admin  18776 Apr 10 11:27 python.o

# with patch
$ ls -l 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/config-3.3m/
total 280
-rw-rw-r--  1 root  admin  55198 Jul 24 02:38 Makefile
-rw-rw-r--  1 root  admin  15009 Jul 24 02:38 Setup
-rw-rw-r--  1 root  admin370 Jul 24 02:38 Setup.config
-rw-rw-r--  1 root  admin 41 Jul 24 02:38 Setup.local
-rw-rw-r--  1 root  admin   2963 Jul 24 02:38 config.c
-rw-rw-r--  1 root  admin   1619 Jul 24 02:38 config.c.in
-rwxrwxr-x  1 root  admin   7122 Jul 24 02:38 install-sh*
lrwxr-xr-x  1 root  wheel 15 Jul 24 02:43 libpython3.2.a@ -> ../../../Python
lrwxr-xr-x  1 root  wheel 15 Jul 24 02:43 libpython3.2.dylib@ -> 
../../../Python
lrwxr-xr-x  1 root  wheel 15 Jul 24 02:43 libpython3.2m.a@ -> 
../../../Python
lrwxr-xr-x  1 root  wheel 15 Jul 24 02:43 libpython3.2m.dylib@ -> 
../../../Python
-rwxrwxr-x  1 root  admin   7460 Jul 24 02:38 makesetup*
-rw-rw-r--  1 root  admin  18896 Jul 24 02:38 python.o

# current
$ python3.2-config --ldflags
-L/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m 
-ldl -framework CoreFoundation -lpython3.2m -framework CoreFoundation 
Python.framework/Versions/3.2/Python

# with patch
$ python3.2-config --ldflags
-L/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.3/config-3.2m 
-ldl -framework CoreFoundation -lpython3.2m

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file26496/issue14197.patch

___
Python tracker 

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



[issue14197] OS X framework builds do not create ABI-suffixed libpython3.x

2012-07-24 Thread Ned Deily

Ned Deily  added the comment:

Georg, I'd like to apply this for both 3.2.4 and 3.3.0b2.  It's a low risk bug 
fix but does solve a real problem for users wanting to embed Python on OS X.  
Issue15353 is also fixed by this.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue15413] os.times() disappeared under Windows

2012-07-24 Thread Georg Brandl

Georg Brandl  added the comment:

Larry?

--

___
Python tracker 

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



[issue15295] Document PEP 420 namespace packages

2012-07-24 Thread Georg Brandl

Changes by Georg Brandl :


--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue14197] OS X framework builds do not create ABI-suffixed libpython3.x

2012-07-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2d4f290ea71c by Ned Deily in branch '3.2':
Issue #14197: For OS X framework builds, ensure links to the shared
http://hg.python.org/cpython/rev/2d4f290ea71c

New changeset 51ac5f06dd04 by Ned Deily in branch 'default':
Issue #14197: merge
http://hg.python.org/cpython/rev/51ac5f06dd04

--
nosy: +python-dev

___
Python tracker 

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



[issue14197] OS X framework builds do not create ABI-suffixed libpython3.x

2012-07-24 Thread Ned Deily

Ned Deily  added the comment:

Fix applied for release in 3.2.4 and (with release manager approval) for 
3.3.0b2.

--
components: +Build -Macintosh, None
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
type: compile error -> 

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread andrea bergamini

New submission from andrea bergamini :

math.pow(43, 10) gives the wrong result: 21611482313284248.0
Instead, the build-in function 43**10 and pow(43, 10) give the correct result: 
21611482313284249L.
This bug has been seen on ActivePython 2.5.1.1. Sorry no tests on recent 
versions.

--
components: Library (Lib)
messages: 166275
nosy: andrea.bergamini
priority: normal
severity: normal
status: open
title: Incredible issue in math.pow
type: behavior

___
Python tracker 

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



[issue15353] ld: library not found for -lpython3.3m because of wrong LDFLAGS_PYTHON

2012-07-24 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the report.  The python-3.3.pc file is correct.  It is a symlink to 
the python-3.3m.pc.  What isn't correct is that OS X framework builds were not 
creating the proper libpython3.3m.{dylib,a} symlinks for use with 
python3.x-config and with pkg-config (if installed).  The fixes applied for 
Issue14197 (for release in 3.2.4 and 3.3.0b2) correct that and ensure that 
python-3.x-conifg --ldflags returns a useful value.

--
components: +Build
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> OS X framework builds do not create ABI-suffixed libpython3.x
type: compile error -> 
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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Ezio Melotti

Ezio Melotti  added the comment:

This is what I get on both 2.7 and 3.3:
>>> import math
>>> math.pow(43, 10)
2.161148231328425e+16
>>> pow(43, 10)
21611482313284249
>>> 43**10
21611482313284249
>>> int(math.pow(43, 10))
21611482313284248

--
nosy: +ezio.melotti, skrah

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

>>> (43**10).bit_length()
55
>>> sys.float_info.mant_dig
53

See 
http://docs.python.org/faq/design.html#why-are-floating-point-calculations-so-inaccurate

--
nosy: +storchaka

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

2012-07-24 Thread Chris Jerdonek

New submission from Chris Jerdonek :

This issue is to include the names in Misc/ACKS into the documentation --
in place of the names from Doc/ACKS.txt.  This was mentioned in the
discussion for issue 15437, which is to add the names from Doc/ACKS.txt
into Misc/ACKS.

This issue should be done shortly after issue 15437.  The current issue
can include (1) converting Misc/ACKS into rst format, (2) deleting
DOC/ACKS.txt (after confirming that any changes since issue 15437 are
reflected in Misc/ACKS), and (3) resolving the intros in the two files
with about.rst's surrounding text so that the text makes sense when
included into the main documentation.

Should Guido's note of acknowledgment in Misc/ACKS be included as is?
And should a new "Python Acknowledgments" section be added to the docs,
or is it okay for this more general acknowledgment to be included in the
section called "About these documents"?  If the former, the "About these
documents" section could link to the more general "Python
Acknowledgments" section to reference documentation contributors.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 166279
nosy: cjerdonek, docs@python, eric.araujo, ezio.melotti, georg.brandl, jcea, 
pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Include Misc/ACKS names into the documentation

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

2012-07-24 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
dependencies: +Merge Doc/ACKS and Misc/ACKS

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

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

Martin v. Löwis  added the comment:

-1. Misc/ACKS is fine where it is. No need to include it into the docs.

--
nosy: +loewis

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

I created a new issue 15439 for including the combined Misc/ACKS into the 
documentation (as Éric mentioned) because the nature of that discussion is 
different, and because the changes will be easier to observe and understand if 
committed separately.

--
title: Merge Doc/ACKS and Misc/ACKS -> Merge Doc/ACKS.txt names into Misc/ACKS

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Martin, just to be sure, this is to be done after issue 15437 (a dependency), 
and the location of Misc/ACKS will not change.  Have you already read the 
discussion there?  Éric said that he recalled it was Georg's preference to do 
this if Doc/ACKS.txt is removed.  (I personally have no opinion.)

--

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread andrea bergamini

andrea bergamini  added the comment:

Ok, but math.pow IMPO has to be aligned to pow and built-in pow (**), otherwise 
this kind of "inaccuracies" can compromise the application behavior. I was 
using this funcion in a cryptographic mechanisms, and this issue resulted in a 
failure. 
Generally speaking, integer numbers should not be affected by inaccuracies. I 
mean, there's no floating point.

--

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread R. David Murray

R. David Murray  added the comment:

If I understand correctly, the math module is providing C standard (Annex F) 
*floating point* mathematical functions.  Mark will have the definitive answer 
once he gets a chance to comment.  Perhaps a documentation clarification is in 
order on this point.

--
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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Stefan Krah

Stefan Krah  added the comment:

I think Serhiy has already explained that 43**10 is too large
to be represented exactly in 53-bit floating point arithmetic.

The math module wraps the floating point functions from the
C standard:

"It provides access to the mathematical functions defined by the C standard."

"Except when explicitly noted otherwise, all return values are floats."


So there's no bug, and the documentation looks fine to me, too.

--

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, the math.pow() doc could use a "seealso" pointing to the built-in pow() 
function perhaps.

--
nosy: +pitrou

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Stefan Krah

Stefan Krah  added the comment:

"Title" referring to the section header of 
http://docs.python.org/dev/library/math.html ...

--

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Stefan Krah

Stefan Krah  added the comment:

How about changing the title to something like:

math -- 53-bit floating point arithmetic

--

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

That could help, but you easily miss the title when looking up the doc for a 
given function.

And since log2() already has a seealso for the corresponding int method, pow() 
could grow one as well.
(and in all honesty I don't know the difference between the "**" operator and 
the built-in pow() function :-))

--

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread andrea bergamini

andrea bergamini  added the comment:

Well, from a library I'm used to expect a good result or an exception. Not a 
value that differs from the correct of one unit! I agree with Antoine, the doc 
should warn about this behavior. I've lost a lot of time before discovering my 
application issue came from the py math library...

--

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-07-24 Thread R. David Murray

R. David Murray  added the comment:

I'm not clear if your script is trying to do this, but there is no way to 
automatically alphabetize the file.  That's why it says "rough" alphabetic 
order.  The issue is that different languages alphabetize different letters in 
different places.  We try to respect the alphabetization of the source language 
as much as practical...which means there is no algorithm that can do the 
sorting, since the names in the file do not carry explicit language information.

--
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



[issue6056] socket.setdefaulttimeout affecting multiprocessing Manager

2012-07-24 Thread Derek Wilson

Derek Wilson  added the comment:

Thanks, Jim, here is an updated patch. 

1) I feel like it is clearly not-a-feature. Currently 2.7 crashes if remote 
managers are used and socket.setdefaulttimeout is anything other than None. 
Crashing seems bad and all this does is keep multiprocessing connection sockets 
non-blocking even if a default timeout is specified (so it maintains current 
behavior rather than crashing).

2) This problem is still evident on 2.7, 3.2 and 3.3 beta 1. This patch is 
against the current dev tip as of a few days ago.

3) here it is!

4) I agree that setblocking is more clear. I made the change.

My test modifications cover the entire suite twice, once without a default 
timeout and once with. This may be excessive? I'm not sure where non-blocking 
sockets might pop up as an issue since there is C code that relies on blocking 
sockets and I haven't dug that deep.

--
Added file: http://bugs.python.org/file26497/mp6056fix.patch

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread R. David Murray

R. David Murray  added the comment:

Your problems didn't come from the "Python" math library, it came from the C 
math library that Python provides a wrapper for, which the documentation does 
clearly state.  And the result you got is accurate...for a floating point 
calculation.

--

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-07-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, the script output looks good (apart from a few duplicates which can be 
resolved by hand, e.g. "Terry Reedy" vs. "Terry J. Reedy").

--

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

I did think through those issues and made a special effort to address them in 
the script.

For starters, the script does not change the order of any names in Misc/ACKS.  
This is to preserve the existing rough alphabetical ordering, and to ensure 
that the diff consists only of insertions (for easier manual checking, if 
desired).

As for inserting new names in rough alphabetical order, I dealt with different 
language characters as follows.  The script has a translation table to map 
non-ascii characters to ascii characters for sorting purposes.  Currently, that 
table is as follows (I'm not sure if all of these characters will render on the 
page):

NON_ASCII = "ÅÉØáäåæçéëíñóôöùúüćęŁńŽКМСабгекнорш“”"
ASCII_SUB = 'AEOceeinooouuuceLnZKMCabrekhopw""'

This mapping can easily be modified if my initial choices are not the best.  As 
an early step, the script collects all non-ascii characters that appear in all 
names to make sure the translation table is up to date (exiting with a message 
otherwise).

When I said "Jeff McNeil" is out of order, that was because the name appears 
after "Jeff Epler" but before "Tom Epperly".  The script maintains a list of 
"out of order" names like this to skip when inserting, to prevent insertions 
from being out of rough alphabetical order.

If different languages use a different ordering on the word level, the script 
will not handle that, however.  It only orders lexicographically by last name, 
and then first name(s).

Much of this information is spelled out in the script's docstring.

--

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

That is correct, Antoine.  Duplicates need to be removed by hand.

To assist in this process, the script currently prints "possible duplicates" to 
stdout after running.  However, the script could easily be modified to display 
an in-line indicator before possible duplicates to make this manual step 
easier, e.g.:

 John Redford
 Terry Reedy
+>>> Terry J. Reedy
 Gareth Rees

Currently, possible duplicates are determined based on whether the last name 
matches an already existing last name.

--

___
Python tracker 

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



[issue11466] getpass.getpass doesn't close tty file

2012-07-24 Thread Anton Barkovsky

Anton Barkovsky  added the comment:

I think I've found the root cause.

On my system (also tested in 3.2) /dev/tty is opened successfully, but wrapping 
it in io.BufferedRandom fails. By the time the exception is raised, FileIO 
object is already created, and then it immediately gets deleted.

I'm attaching a patch that closes the file explicitly in this case.
Be extra careful when reviewing though - this is the first time I'm touching 
Python's C code.

--
Added file: http://bugs.python.org/file26498/closewarning.patch

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-07-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> To assist in this process, the script currently prints "possible
> duplicates" to stdout after running.  However, the script could easily
> be modified to display an in-line indicator before possible duplicates
> to make this manual step easier, e.g.:
> 
>  John Redford
>  Terry Reedy
> +>>> Terry J. Reedy
>  Gareth Rees

Well, no need to be perfectionist IMO. The merging will only be done
once (thrice if we count all branches :-)).

--

___
Python tracker 

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



[issue11466] getpass.getpass doesn't close tty file

2012-07-24 Thread Anton Barkovsky

Changes by Anton Barkovsky :


Removed file: http://bugs.python.org/file26498/closewarning.patch

___
Python tracker 

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



[issue11466] getpass.getpass doesn't close tty file

2012-07-24 Thread Anton Barkovsky

Changes by Anton Barkovsky :


Added file: http://bugs.python.org/file26499/closewarning.patch

___
Python tracker 

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



[issue6056] socket.setdefaulttimeout affecting multiprocessing Manager

2012-07-24 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
nosy: +sbt

___
Python tracker 

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



[issue15440] multiprocess fails to re-raise exception which has mandatory arguments

2012-07-24 Thread Bala FA

New submission from Bala FA :

I use multiprocess in one of my project.  When an exception which
requires mandatory argument is raised by a server process, is not
re-raised properly to client process.  I get an error something like
below

Traceback (most recent call last):
  File "prod.py", line 69, in 
main()
  File "prod.py", line 61, in main
print myobj.fun3()
  File "", line 2, in fun3
  File "/usr/lib64/python2.7/multiprocessing/managers.py", line 759,
in _callmethod
kind, result = conn.recv()
TypeError: ('__init__() takes exactly 2 arguments (1 given)', , ())

However, if an exception which has optional argument is raised by
server process, is re-raised properly to client process.

Below is a reproducer.

#!/usr/bin/python

import sys
import os
import time
import subprocess
from multiprocessing.managers import BaseManager

class MyManager(BaseManager):
pass

class MyException1(Exception):
def __init__(self, msg=''):
self.msg = msg

def __str__(self):
return self.msg

class MyException2(Exception):
def __init__(self, msg):
self.msg = msg

def __str__(self):
return self.msg

class MyClass(object):
def fun1(self):
return 'this is fun1'

def fun2(self):
raise MyException1('fun2 raised')

def fun3(self):
raise MyException2('fun3 raised')

def runManager():
manager = MyManager(address=('', 5), authkey='abc')
manager.register('instance', callable=MyClass)
server = manager.get_server()
print "manager is running"
server.serve_forever()

def startManager():
p = subprocess.Popen(['python', __file__, 'manager'])
time.sleep(1)
return p

def main():
p = startManager()
manager = MyManager(address=('', 5), authkey='abc')
manager.register('instance')
print "connecting to manager"
manager.connect()
myobj = manager.instance()
print myobj.fun1()
try:
print myobj.fun2()
except MyException1, e:
print e
try:
print myobj.fun3()
except MyException2, e:
print e
finally:
p.kill()

if __name__ == '__main__':
if len(sys.argv) == 1:
main()
else:
runManager()

I use python 2.7.3 on fedora 17 on x86_64 (rpm version is
python-2.7.3-6.fc17.x86_64)

--
components: Interpreter Core
messages: 166299
nosy: Bala.FA
priority: normal
severity: normal
status: open
title: multiprocess fails to re-raise exception which has mandatory arguments
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto :

test_posixpath.PosixCommonTest.test_nonascii_abspath fails on Japanese edition
of Windows.

If a file name was invalid byte character, os.chdir() raises 
UnicodeDecodeError()
instead of WindowsError.

This is a byte-api issue on Windows, so we may be able to simply skip this test.

==
ERROR: test_nonascii_abspath (test.test_posixpath.PosixCommonTest)
--
Traceback (most recent call last):
  File "C:\cygwin\home\ishimoto\src\cpython\lib\test\test_genericpath.py", line
318, in test_nonascii_abspath
with support.temp_cwd(b'\xe7w\xf0'):
  File "C:\cygwin\home\ishimoto\src\cpython\lib\contextlib.py", line 48, in __en
ter__
return next(self.gen)
  File "C:\cygwin\home\ishimoto\src\cpython\lib\test\support.py", line 614, in t
emp_cwd
os.chdir(path)
UnicodeDecodeError: 'mbcs' codec can't decode bytes in position 0--1: No mapping
for the Unicode character exists in the target code page.

--

--
components: Unicode, Windows
files: test_nonascii_abspath.patch
keywords: patch
messages: 166300
nosy: ezio.melotti, ishimoto
priority: normal
severity: normal
status: open
title: test_posixpath fails on Japanese edition of Windows
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26500/test_nonascii_abspath.patch

___
Python tracker 

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



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-07-24 Thread Kevin Barry

Kevin Barry  added the comment:

The patch from before needed a slight modification for when Python actually 
defaults to an interactive session on stdin. Since I rebuild this for my 
current distro (Slackware64 13.37,) I switched to the Python 2.6.6 source. This 
might not be the proper way to handle the default case (e.g. 'Py_Main'), but 
it's a start.


The patch (also attached):

--- ./Parser/tokenizer.c.orig   2012-07-23 22:24:56.513992301 -0400
+++ ./Parser/tokenizer.c2012-07-23 22:23:24.329992167 -0400
@@ -805,7 +805,7 @@
 return Py_CHARMASK(*tok->cur++);
 }
 if (tok->prompt != NULL) {
-char *newtok = PyOS_Readline(stdin, stdout, tok->prompt);
+char *newtok = PyOS_Readline(tok->fp? tok->fp : stdin, (tok->fp && 
tok->fp != stdin)? tok->fp : stdout, tok->prompt);
 if (tok->nextprompt != NULL)
 tok->prompt = tok->nextprompt;
 if (newtok == NULL)


Kevin Barry

--
Added file: 
http://bugs.python.org/file26501/Python-2.6.6-Run_Interactive-fix.patch

___
Python tracker 

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto

Atsuo Ishimoto  added the comment:

changed name of test method. In the old patch, new test method shadowed 
existing one.

--
Added file: http://bugs.python.org/file26502/test_nonascii_abspath_2.patch

___
Python tracker 

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto :


Removed file: http://bugs.python.org/file26500/test_nonascii_abspath.patch

___
Python tracker 

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



[issue15436] __sizeof__ is not documented

2012-07-24 Thread Meador Inge

Meador Inge  added the comment:

It is part of runtime services and is mentioned in the documentation for 
'sys.getsizeof' [1]:

"""
getsizeof() calls the object’s __sizeof__ method and adds an additional garbage 
collector overhead if the object is managed by the garbage collector.
"""

[1] http://docs.python.org/library/sys.html?highlight=__sizeof__#sys.getsizeof.

--
nosy: +meador.inge

___
Python tracker 

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



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-07-24 Thread Kevin Barry

Kevin Barry  added the comment:

I've attached a simplified example program (working3.c) that demonstrates both 
the original problem and that the patch 
(Python-2.6.6-Run_Interactive-fix.patch) works. It eliminates the need for a 
pty, 'xterm', and redirection.


Compile the attached program with:

> gcc `python-config --cflags` working3.c -o working3 `python-config --ldflags`

and run it with (before and after patching):

> ./working3


Also, for verification, run 'python' with no arguments to show that default 
interactivity is preserved.

Kevin Barry

--
Added file: http://bugs.python.org/file26503/working3.c

___
Python tracker 

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



[issue15269] Document dircmp.left and dircmp.right

2012-07-24 Thread Eli Bendersky

Eli Bendersky  added the comment:

Yes, code samples would help clarifying the rationale for this request

--
nosy: +eli.bendersky
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



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

2012-07-24 Thread Eli Bendersky

New submission from Eli Bendersky :

The default ignore list of filecmp.dircmp is ['RCS', 'CVS', 'tags'].

This predates even Subversion! I suggest to freshen up this module to also 
ignore the dirs for SVN, Mercurial, Git and Bazaar.


[this is a new feature, so no earlier than 3.4...]

--
components: Library (Lib)
keywords: easy
messages: 166306
nosy: eli.bendersky
priority: low
severity: normal
stage: needs patch
status: open
title: Expand the list of default dirs filecmp.dircmp ignores
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-07-24 Thread Eli Bendersky

Eli Bendersky  added the comment:

The patch looks reasonable to me. Martin/Éric - any objections to committing?

--
nosy: +eli.bendersky

___
Python tracker 

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



[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

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

Martin v. Löwis  added the comment:

LGTM

--

___
Python tracker 

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



[issue15436] __sizeof__ is not documented

2012-07-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> It is part of runtime services and is mentioned in the documentation for
> 'sys.getsizeof' [1]:

Yes, but it is not mentioned in the index.

--

___
Python tracker 

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



[issue15321] bdist_wininst installers may terminate with "close failed in file object destructor:\nsys.excepthook is missing\nlost sys.stderr"

2012-07-24 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue15321] bdist_wininst installers may terminate with "close failed in file object destructor:\nsys.excepthook is missing\nlost sys.stderr"

2012-07-24 Thread Eli Bendersky

Eli Bendersky  added the comment:

Sorry about the commit message. Ignore it, I got the issue number wrong :)

--
nosy: +eli.bendersky

___
Python tracker 

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



[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-07-24 Thread Eli Bendersky

Eli Bendersky  added the comment:

Committed in f315cfa22630

--
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




[issue15321] bdist_wininst installers may terminate with "close failed in file object destructor:\nsys.excepthook is missing\nlost sys.stderr"

2012-07-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f315cfa22630 by Eli Bendersky in branch 'default':
Issue #15321: update PyPI upload doc to say --no-raw passed to rst2html.py. 
Patch by Chris Jerdonek
http://hg.python.org/cpython/rev/f315cfa22630

--
nosy: +python-dev

___
Python tracker 

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



[issue15285] test_timeout failure when system on IPv4 10.x.x.x subnet

2012-07-24 Thread Nam Nguyen

Nam Nguyen  added the comment:

Using a remote server such as python.org is a good idea when you have internet 
connection. When you don't, though, how will the test run?

--
nosy: +Nam.Nguyen

___
Python tracker 

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



[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Thanks a lot, Eli.

--

___
Python tracker 

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



[issue15285] test_timeout failure when system on IPv4 10.x.x.x subnet

2012-07-24 Thread Brian Brazil

Brian Brazil  added the comment:

There's already existing infrastructure not to run certain tests when
there's no internet connection, no ipv6, no tk etc.

--

___
Python tracker 

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



[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-07-24 Thread Éric Araujo

Éric Araujo  added the comment:

It seems to me there are missing words in the text, and it needs porting to the 
packaging docs.

Proposal: [...] being able to run the command above without warnings is not 
sufficient to be sure that PyPI will convert the content successfully.

--
components: +Distutils, Distutils2
nosy: +alexis, tarek
resolution: fixed -> 
stage: committed/rejected -> commit review
status: closed -> open
versions: +Python 2.7, Python 3.2, Python 3.4

___
Python tracker 

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



[issue12428] functools test coverage

2012-07-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le mardi 24 juillet 2012 à 06:00 +, Brian Thorne a écrit :
> Isn't more compatibility between the Python and C implementations
> desired?

IMHO, not when compatibility regards obscure details such as whether
setting an attribute is allowed or not. I don't know why this was
codified in the unit tests in the first place, perhaps Nick can shed
some light.

> Should the caching decorators be tested from multiple threads?

Why not, if there's an easy way to do so.

--

___
Python tracker 

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo
stage:  -> patch review

___
Python tracker 

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



[issue15232] email.generator.Generator doesn't mangle "From " lines in MIME preamble

2012-07-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 0caff799e4bf by R David Murray in branch '3.2':
#15232: make NEWS entry more accurate.
http://hg.python.org/cpython/rev/0caff799e4bf

New changeset d53524c43d0e by R David Murray in branch 'default':
#15232: make NEWS entry more accurate.
http://hg.python.org/cpython/rev/d53524c43d0e

New changeset e9ffde2c7da3 by R David Murray in branch '2.7':
#15232: make NEWS entry more accurate.
http://hg.python.org/cpython/rev/e9ffde2c7da3

--

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

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

Martin v. Löwis  added the comment:

Ok, please rephrase: what do you mean by "inlude ... into ..."? If the place of 
Misc/ACKS doesn't change, in what way is it being included into something? And 
which "documentation" is it being included into, if it doesn't change its 
location?

--

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

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

Martin v. Löwis  added the comment:

Also, if you want to do phonetic translation of non-ASCII, then абгекнор really 
matches abgeknor, and ш is transliterated to "sh" in English (IIUC) (to "sch" 
in German).

But I agree that this is best done manually. What matters is what the script 
produces; the script certainly won't make it into Python's source code. I'm 
sure Chris had fun writing it.

--
keywords:  -easy
nosy: +loewis

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

2012-07-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Ok, please rephrase: what do you mean by "inlude ... into ..."?

http://docs.python.org/about.html#contributors-to-the-python-documentation

--
nosy: +storchaka

___
Python tracker 

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



[issue15413] os.times() disappeared under Windows

2012-07-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d9a881b0d6ca by Antoine Pitrou in branch 'default':
Issue #15413: os.times() had disappeared under Windows.
http://hg.python.org/cpython/rev/d9a881b0d6ca

--
nosy: +python-dev

___
Python tracker 

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



[issue15413] os.times() disappeared under Windows

2012-07-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, I fixed it.

--
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



[issue15439] Include Misc/ACKS names into the documentation

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

Martin v. Löwis  added the comment:

I see; I'm changing my vote to -0 then. I don't think this list of names should 
have been included in the documentation in the first place. Since it is, 
providing the full list of contributors is just as fine.

--

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

The second sense of the word "include" is in the possible implementation.  Éric 
pointed out in the other issue's thread that this can be achieved by modifying 
the existing include directive, for example--

--- a/Doc/about.rst
+++ b/Doc/about.rst
@@ -30,7 +30,7 @@
 documentation, or Python itself.
 
 .. including the ACKS file here so that it can be maintained separately
-.. include:: ACKS.txt
+.. include:: ../Misc/ACKS

The details of the surrounding text still need to be worked out though so that 
it reads right.

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Vincenzo Ampolo

New submission from Vincenzo Ampolo :

As long as computers evolve time management becomes more precise and more 
granular.
Unfortunately the standard datetime module is not able to deal with nanoseconds 
even if OSes are able to. For example if i do:

print "%.9f" % time.time()
1343158163.471209049

I've actual timestamp from the epoch with nanosecond granularity.

Thus support for nanoseconds in datetime would really be appreciated

--
components: ctypes
messages: 166326
nosy: Vincenzo.Ampolo
priority: normal
severity: normal
status: open
title: datetime module has no support for nanoseconds
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +belopolsky, haypo, lemburg
versions: +Python 3.4 -Python 2.7

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Vincenzo Ampolo

Changes by Vincenzo Ampolo :


--
components: +Library (Lib) -ctypes

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Yes, I did. Even though it is throw-away.

By the way, I'm taking Antoine's advice to avoid perfectionism on this. 
Otherwise I'd include your suggestion re: the special characters. :)

--

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

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

Martin v. Löwis  added the comment:

I think Guido's wording should be included literally in the online version. It 
very much explains what this list really is and how to interpret it. The post 
scriptum should be converted into a ReST comment, since it is primarily a note 
to maintainers.

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue15444] Incorrectly writen contributor's names

2012-07-24 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Some contributor's names written incorrectly (in ASCII) in documentation:

Jesús Cea Avión as Jesús Cea Avion
Lars Gustäbel as Lars Gustaebel
Gerhard Häring as Gerhard Haering
Marc-André Lemburg as Marc-Andre Lemburg
Martin von Löwis as Martin von Loewis
Charles-François Natali as Charles-Francois Natali
Žiga Seilnach as Ziga Seilnacht

The proposed patch restores natural spelling (based on Doc/ACKS and Misc/ACKS).

I'm not sure about how to write right: Žiga Seilnach or Seilnacht?

--
assignee: docs@python
components: Documentation
files: doc-nonascii-names.patch
keywords: patch
messages: 166330
nosy: docs@python, ghaering, jcea, lars.gustaebel, lemburg, loewis, neologix, 
storchaka, zseil
priority: normal
severity: normal
status: open
title: Incorrectly writen contributor's names
Added file: http://bugs.python.org/file26504/doc-nonascii-names.patch

___
Python tracker 

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



[issue15444] Incorrectly writen contributor's names

2012-07-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> patch review
versions: +Python 2.7, 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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Vincenzo Ampolo wrote:
> 
> As long as computers evolve time management becomes more precise and more 
> granular.
> Unfortunately the standard datetime module is not able to deal with 
> nanoseconds even if OSes are able to. For example if i do:
> 
> print "%.9f" % time.time()
> 1343158163.471209049
> 
> I've actual timestamp from the epoch with nanosecond granularity.
> 
> Thus support for nanoseconds in datetime would really be appreciated

I would be interested in an actual use case for this.

--

___
Python tracker 

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



[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-24 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

ISTM the simplest approach would be to just set self->args in 
BaseException.__new__() (like in Georg's patch) but to ignore the possibility 
that the user might later set self.args to something stupid "wrong":

diff -r 51ac5f06dd04 Objects/exceptions.c
--- a/Objects/exceptions.c  Tue Jul 24 03:45:39 2012 -0700
+++ b/Objects/exceptions.c  Tue Jul 24 22:12:49 2012 +0100
@@ -44,12 +44,17 @@
 self->traceback = self->cause = self->context = NULL;
 self->suppress_context = 0;

-self->args = PyTuple_New(0);
-if (!self->args) {
-Py_DECREF(self);
-return NULL;
+if (!args) {
+args = PyTuple_New(0);
+if (!args) {
+Py_DECREF(self);
+return NULL;
+}
+} else {
+Py_INCREF(args);
 }

+self->args = args;
 return (PyObject *)self;
 }

Certainly it will not work for all cases (like calling a base classes' __init__ 
with different arguments), but it does cover the *very* common case where 
__init__() is defined but does not call the base classes' __init__().

Such a patch is minimally invasive and, as far as I can see, would not break 
currently working code.

Would this be acceptable for a bugfix release?

--
nosy: +sbt

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Vincenzo Ampolo

Vincenzo Ampolo  added the comment:

On 07/24/2012 01:28 PM, Marc-Andre Lemburg wrote:
> I would be interested in an actual use case for this.

Alice has a dataset with nanosecond granularity. He wants to make a
python library to let Bob access the dataset. Nowadays Alice has to
implement her own time class losing all the flexibility of the datetime
module. With this enhancement she can provide a library that just uses
the standard python datetime module. Her library will get the needed
time format, including nanoseconds.

Many python sql libraries, like the one in django e the one in web2py,
relay on datetime objects for time representation. Bob has a web2py
website that has some data with nanosecond granularity. Nowadays Bob has
to store this data as a string or a long number without the ability to
use the powerful datetime module. With this enhancement Bob doesn't need
to build or learn another interface, he can just use the datetime module
using microseconds or nanoseconds as needed.

Google search for "python datetime nanoseconds" shows more than 141k
results:
https://www.google.com/search?sourceid=chrome&ie=UTF-8&q=python+time#hl=en&biw=1615&bih=938&sclient=psy-ab&q=python+datetime+nanoseconds&oq=python+datetime+nanoseconds

So this is definitively a requested feature. And as soon as technology
evolves more people will ask for it.

I imagine something like:

import datetime
nano_time = datetime.datetime(year=2012, month=07, day=24, hour=14,
minute=35, second=3, microsecond=53, nanosecond=27)

in case you need nanosecond granularity. if you don't need it just skip
the nanosecond part and the module works like it's now. Of course
strftime format should be updated to support nanoseconds.

I can write a patch if some dev can maybe review it.

Before someone takes the datetime source code and starts a third part
module that supports nanoseconds, I think this enhancement has almost
null impact in existing code and makes the datetime module even more
powerful. It's up to the Cpython admins to decide between maintaining
datetime module up to date with new needs or let third part modules take
care of those lacks.

Best Regards,
-- 
Vincenzo Ampolo
http://vincenzo-ampolo.net
http://goshawknest.wordpress.com

--

___
Python tracker 

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



[issue15413] os.times() disappeared under Windows

2012-07-24 Thread Larry Hastings

Larry Hastings  added the comment:

Sorry, I've been on the road a lot.  Thanks, Antoine!

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread R. David Murray

R. David Murray  added the comment:

I believe Marc-Andre was looking for an actual real-world use case rather than 
a hypothetical one.  We discussed this briefly on the irc channel and we think 
Guido vetoed it on a YAGNI basis (we haven't checked the archives though...) so 
a real world use case is probably required.

--
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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Vincenzo Ampolo

Vincenzo Ampolo  added the comment:

This is a real use case I'm working with that needs nanosecond precision
and lead me in submitting this request:

most OSes let users capture network packets (using tools like tcpdump or
wireshark) and store them using file formats like pcap or pcap-ng. These
formats include a timestamp for each of the captured packets, and this
timestamp usually has nanosecond precision. The reason is that on
gigabit and 10 gigabit networks the frame rate is so high that
microsecond precision is not enough to tell two frames apart.
pcap (and now pcap-ng) are extremely popular file formats, with millions
of files stored around the world. Support for nanoseconds in datetime
would make it possible to properly parse these files inside python to
compute precise statistics, for example network delays or round trip times.

Other case is in stock markets. In that field information is timed in
nanoseconds and have the ability to easily deal with this kind of
representation natively with datetime can make the standard module even
more powerful.

The company I work for is in the data networking field, and we use
python extensively. Currently we rely on custom code to process
timestamps, a nanosecond datetime would let us avoit that and use
standard python datetime module.

Best Regards,

---
Vincenzo Ampolo
http://vincenzo-ampolo.net
http://goshawknest.wordpress.com

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Vincenzo Ampolo

Changes by Vincenzo Ampolo :


--
versions: +Python 2.7

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The math module is primarily about exposing the C floating point library 
functions.  Any integer arguments are converted to double.

We could add more docs but that usually doesn't help someone who already has an 
expectation that math.pow does the same thing as int ** int.

--
assignee:  -> rhettinger
nosy: +rhettinger
priority: normal -> low

___
Python tracker 

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



[issue15438] Incredible issue in math.pow

2012-07-24 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
components: +Documentation -Library (Lib)
resolution:  -> invalid

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread R. David Murray

R. David Murray  added the comment:

Are the nanosecond timestamps timestamps or strings?  If they are timestamps 
it's not immediately obvious why you want to convert them to datetime objects, 
so motivating that would probably help.  On the other hand the fact that you 
have an application that does so is certain an argument for real world 
applicability.

--

___
Python tracker 

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



[issue15269] Document dircmp.left and dircmp.right

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Thanks for taking the time to look at this, Eli.

In response to your question, here is one illustrated rationale.

When recursing through a directory using dircmp, it is simplest and cleanest to 
be able to recurse on the subdirs attribute without having to pass pairs of 
paths around or reconstruct dircmp instances.  You can see this for example in 
filecmp's own very concise implementation of dircmp.report_full_closure():

def report_full_closure(self): # Report on self and subdirs recursively
self.report()
for sd in self.subdirs.values():
print()
sd.report_full_closure()

However, dircmp's reporting functionality is self-admittedly "lousy":

def report(self): # Print a report on the differences between a and b
# Output format is purposely lousy
print('diff', self.left, self.right)
...

(Incidentally, observe above that dircmp.report() itself uses the 'left' and 
'right' attributes.)

Given the limitations of report_full_closure(), etc, it is natural that one 
might want to write a custom or replacement reporting function with nicer 
formatting.  When doing this, it would be nice to be able to follow that same 
clean and concise recursion pattern.  For example--

def diff(dcmp):
for sd in dcmp.subdirs.values():
diff(sd)
for name in dcmp.diff_files:
print("%s differs in %s and %s" % (name, dcmp.left, dcmp.right))

dcmp = dircmp('dir1', 'dir2')
diff(dcmp)

If one isn't able to access 'left' and 'right' (or if one simply isn't aware of 
those attributes, which was the case for me at one point), the alternative 
would be to do something like the following, which is much uglier and less DRY:

import os

def diff2(dcmp, dir1, dir2):
for name, sd in dcmp.subdirs.items():
subdir1 = os.path.join(dir1, name)
subdir2 = os.path.join(dir2, name)
diff2(sd, subdir1, subdir2)
for name in dcmp.diff_files:
print("%s differs in %s and %s" % (name, dir1, dir2))

dcmp = dircmp('dir1', 'dir2')
diff2(dcmp, dir1='dir1', dir2='dir2')

An example like diff() above might even be worth including in the docs as an 
example of how subdirs can be used to avoid having to manually call 
os.path.join(...), etc.

There are also non-recursive situations in which being able to access 
dircmp.left and dircmp.right makes for cleaner code.

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread R. David Murray

R. David Murray  added the comment:

Even if accepted this can't get fixed in 2.7, so removing that from versions.

--
versions:  -Python 2.7

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

2012-07-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I agree with Martin and don't think the ACKS list should be exposed further 
than it already is.

--
nosy: +rhettinger

___
Python tracker 

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



[issue15444] Incorrectly writen contributor's names

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

It seems to be the latter: Žiga Seilnacht

http://mail.python.org/pipermail/python-dev/2007-March/071786.html

--
nosy: +cjerdonek

___
Python tracker 

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



[issue15445] Ability to do code injection via logging module configuration listener port.

2012-07-24 Thread Graham Dumpleton

New submission from Graham Dumpleton :

This issue was raised first on secur...@python.org. Guido responded that not 
sensitive enough to be kept to the list and that okay to log a bug report.

This issue may not warrant any action except perhaps an update to
documentation for the logging module to warn about it, but thought
that should raise it just in case someone felt it needed actual code
changes to be made to avoid the issue if possible.

The problem arises in the Python logging modules ability to create a
listener socket which can accept new configuration in the ini file
format.

http://docs.python.org/library/logging.config.html#logging.config.listen

"""To send a configuration to the socket, read in the configuration
file and send it to the socket as a string of bytes preceded by a
four-byte length string packed in binary using struct.pack('>L',
n)."""

This sounds innocuous and the documentation at that point doesn't warn
that you are opening yourself up to security problems in using it.

You get a hint of potential issues later if one reads later
documentation about the file format:

"""The class entry indicates the handler’s class (as determined by
eval() in the logging package’s namespace). The level is interpreted
as for loggers, and NOTSET is taken to mean ‘log everything’."""

There are other mentions about eval() in context of log level and args
for the handler class as well, but not sure that is used for log level
as it says.

The combination of the open listener port for configuration and that
processing of the configuration file uses eval(), means that one could
send a configuration file to the process containing:

[handler_consoleHandler]
class=os.system('echo security issue') or StreamHandler
level=DEBUG
formatter=simpleFormatter
args=(sys.stdout,)

and one could execute an arbitrary command as the user the process runs as.

The problem is tempered by the fact that someone has to enable the
feature, which is likely rare, but also because socket connections to
send new configuration will only be accepted from the same host
('localhost') and the host can not be overridden. So can only be taken
advantage of by someone (potentially a different user) on the same
host and not remotely at least.

The specific code in Python 3.2 is:

section = cp["handler_%s" % hand]
klass = section["class"]
fmt = section.get("formatter", "")
try:
klass = eval(klass, vars(logging))
except (AttributeError, NameError):
klass = _resolve(klass)
args = section["args"]
args = eval(args, vars(logging))
h = klass(*args)

and older Python 2.X versions have similar code.

Although you could perhaps avoid need for eval for class lookup, can't
see that you could do that for args unless you restrict it to literal
values and use a more limited eval like parser.

At the minimum there probably should be a warning in the documentation about 
using the logging module configuration port on untrusted systems with shared 
users.

--
components: Library (Lib)
messages: 166343
nosy: grahamd
priority: normal
severity: normal
status: open
title: Ability to do code injection via logging module configuration listener 
port.
type: security
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



[issue15439] Include Misc/ACKS names into the documentation

2012-07-24 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Is that a -0 then, Raymond?

I think either the combined Misc/ACKS list should be included in the docs, or 
it should be removed entirely.  If what Meador said is true (that people 
already in Misc/ACKS who contribute documentation should not be added)--

> Doc/ACKS.txt is *only* for acknowledging documentation contributions.  Serhiy 
> is already in Misc/ACKS.  No need to add him to Doc/ACKS.txt.

http://mail.python.org/pipermail/python-dev/2012-July/121093.html

Then it's not clear to me why the current docs list is meaningful and what 
exactly it represents.  At the least, the description of the list on the page 
doesn't match the stated practice.

--

___
Python tracker 

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



[issue15445] Ability to do code injection via logging module configuration listener port.

2012-07-24 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2012-07-24 Thread Vincenzo Ampolo

Vincenzo Ampolo  added the comment:

On 07/24/2012 04:20 PM, R. David Murray wrote:
> R. David Murray  added the comment:
> 
> Are the nanosecond timestamps timestamps or strings?  If they are timestamps 
> it's not immediately obvious why you want to convert them to datetime 
> objects, so motivating that would probably help.  On the other hand the fact 
> that you have an application that does so is certain an argument for real 
> world applicability.

It depends. When they are exported for example as csv (this can be the
case of market stock) or json (which is close to my case) that's a
string so having a datetime object may be very helpful in doing datetime
adds, subs, <, deltas and in changing representation to human readable
format thanks to strftime() without loosing precison and maintaining
readability.

Think about a web application. User selects year, month, day, hour,
minute, millisecond, nanosecond of an event and the javascript does a
ajax call with time of this format (variant of iso8601):
-MM-DDTHH:MM:SS.mmnnn (where nnn is the nanosecond representation).
The python server takes that string, converts to a datetime, does all
the math with its data and gives the output back using labeling data
with int(nano_datetime.strftime('MMSSmmnnn')) so I've a sequence
number that javascript can sort and handle easily.

It's basically the same you already do nowadays at microseconds level,
but this time you have to deal with nanosecond data.

I agree with the YAGNI principle and I think that we have a clear
evidence of a real use case here indeed.

Best Regards

--

___
Python tracker 

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



[issue15445] Ability to do code injection via logging module configuration listener port.

2012-07-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
versions: +Python 2.7, Python 3.3

___
Python tracker 

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



[issue15445] Ability to do code injection via logging module configuration listener port.

2012-07-24 Thread Christian Heimes

Christian Heimes  added the comment:

ast.literal_eval() is a good choice for limited evaluation of Python string as 
it only supports data types like numbers, str, dict etc. but no classes or 
function calls.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue15445] Ability to do code injection via logging module configuration listener port.

2012-07-24 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue15439] Include Misc/ACKS names into the documentation

2012-07-24 Thread Meador Inge

Meador Inge  added the comment:

What I meant by that was that Serhiy contributed a code change and was already 
in Misc/ACKS, therefore no ACKS file should have been updated.  I didn't mean 
to imply that someone can't be in both files.  My impression is that Misc/ACKS 
is for code contributions and Docs/ACKS.txt is for documentation contributions.

--
nosy: +meador.inge

___
Python tracker 

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



  1   2   >