[issue16045] add more unit tests for built-in int()

2012-09-27 Thread Chris Jerdonek

Chris Jerdonek added the comment:

>From http://bugs.python.org/review/16036/ for issue 16036:

> Somewhere should be exposed that x must be str, bytes, bytearray or a 
> subclass.

We can add tests for this, too (if not already there).

--

___
Python tracker 

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



[issue16056] shadowed test names in std lib regression tests

2012-09-27 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Running find_duplicate_test_names.py (after changing the print
statements) on the 2.7 branch, gives the following output:

$ ./python find_duplicate_test_names.py Lib/test/
Duplicate test method names:
Lib/test/test_unicode.py: .UnicodeTest.test_capitalize
Lib/test/test_iter.py: .TestCase.test_unicode_join_endcase

The duplicate in Lib/test/test_iter.py is defined on purpose.

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



[issue16056] shadowed test names in std lib regression tests

2012-09-27 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
stage:  -> needs patch
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



[issue16056] shadowed test names in std lib regression tests

2012-09-27 Thread Ezio Melotti

Ezio Melotti added the comment:

The script could be actually be added somewhere (e.g. Tools/scripts) and run as 
part of `make patchcheck` on the test files that got changed.

--

___
Python tracker 

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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In function convert_integral_to_int() in file Objects/abstract.c integral 
double decrefed and dereferenced after decrefing if returned value of __int__() 
is not int. Python 3.3 only affected.

Here is a patch.

--
components: Interpreter Core
files: float2int_dbl_decref.patch
keywords: patch
messages: 171371
nosy: benjamin.peterson, storchaka
priority: normal
severity: normal
status: open
title: Double decref and dereferencing after decref in int()
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file27316/float2int_dbl_decref.patch

___
Python tracker 

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



[issue16046] python -O does not find *.pyo files

2012-09-27 Thread STINNER Victor

STINNER Victor added the comment:

It would be nice to have a test.

--
nosy: +haypo

___
Python tracker 

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



[issue11461] UTF-16 incremental decoder doesn't support partial surrogate pair

2012-09-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In issue14624 utf-16 decoder has been significantly reworked. Here is adapted 
for 3.3 patch.

--
keywords: +needs review
nosy: +storchaka
Added file: http://bugs.python.org/file27317/partial_utf16-3.3.patch

___
Python tracker 

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



[issue16059] Serialize MD5 computation-state and resume later

2012-09-27 Thread R. David Murray

R. David Murray added the comment:

In the python context I believe what you are asking for is to make hashlib hash 
objects pickleable.

--
nosy: +r.david.murray
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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I find my first patch more readable and efficient, but if these comments
> are conformant to pep7.. Attaching updated patch (issue8425.3.patch)

It was only a suggestion. Both forms are good enougth.

> Yes, but bench.py is available, fell free to run it with whatever
> configuration; my example was done with a --with-pydebug and clang
> compiler.

Yes, I ran it in release mode (gcc, 32-bit Linux) and confirm your results.

In general except minor whitespace defects last patch LGTM.

--

___
Python tracker 

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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Mark Dickinson

Mark Dickinson added the comment:

Nice catch!  And indeed, the following code generates a segfault on my machine:


class B(object):
def __int__(self):
return 43.0

class A(object):
def __trunc__(self):
return B()

int(A())


The patch should probably include a regression test.

--
nosy: +mark.dickinson
priority: normal -> high

___
Python tracker 

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



[issue5542] Socket is closed prematurely in httplib, if server sends response before request body has been sent

2012-09-27 Thread ABR

ABR added the comment:

I can report that this occurs on Python 2.7.3, when using urllib[x] wrapped in 
'requests'.  Trying to access a site using basic auth over https will not work 
with certain servers, whereas it will work over plain http.

I tried searching to see if a corresponding https issue exists, but this came 
up instead.  :-)

--
nosy: +ABR

___
Python tracker 

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



[issue16061] performance regression in string replace for 3.3

2012-09-27 Thread Mark Lawrence

New submission from Mark Lawrence:

Quoting Steven D'Aprano on c.l.p.

"But add a call to replace, and things are very different:

[steve@ando ~]$ python2.7 -m timeit -s "s = 'b'*1000" "s.replace('b', 'a')"
10 loops, best of 3: 9.3 usec per loop
[steve@ando ~]$ python3.2 -m timeit -s "s = 'b'*1000" "s.replace('b', 'a')"
10 loops, best of 3: 5.43 usec per loop
[steve@ando ~]$ python3.3 -m timeit -s "s = 'b'*1000" "s.replace('b', 'a')"
10 loops, best of 3: 18.3 usec per loop


Three times slower, even for pure-ASCII strings. I get comparable results for 
Unicode. Notice how slow Python 2.7 is:

[steve@ando ~]$ python2.7 -m timeit -s "s = u'你'*1000" "s.replace(u'你', u'a')"
1 loops, best of 3: 65.6 usec per loop
[steve@ando ~]$ python3.2 -m timeit -s "s = '你'*1000" "s.replace('你', 'a')"
10 loops, best of 3: 2.79 usec per loop
[steve@ando ~]$ python3.3 -m timeit -s "s = '你'*1000" "s.replace('你', 'a')"
1 loops, best of 3: 23.7 usec per loop

Even with the performance regression, it is still over twice as fast as
Python 2.7.

Nevertheless, I think there is something here. The consequences are nowhere 
near as dramatic as jmf claims, but it does seem that replace() has taken a 
serious performance hit. Perhaps it is unavoidable, but perhaps not.

If anyone else can confirm similar results, I think this should be raised as a 
performance regression.

Quoting Serhiy Storchaka in response.

"Yes, I confirm, it's a performance regression. It should be avoidable.
Almost any PEP393 performance regression can be avoided. At least for
such corner case. Just no one has yet optimized this case."

--
messages: 171378
nosy: BreamoreBoy
priority: normal
severity: normal
status: open
title: performance regression in string replace for 3.3
type: performance
versions: Python 3.3

___
Python tracker 

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



[issue16062] Socket closed prematurely in httplib for https

2012-09-27 Thread ABR

New submission from ABR:

When attempting to use basic auth over https with a server that sends 401 and 
closes the connection as soon as the headers missing auth are received, the 
process aborts with a broken pipe when (presumably) trying to send the POST 
body.

session = requests.session(auth=(USER, PASSWORD), verify=False)
resp = session.post('https://foo.com/something')
  --> requests.exceptions.ConnectionError: [Errno 32] Broken pipe

--
components: Library (Lib)
messages: 171379
nosy: ABR
priority: normal
severity: normal
status: open
title: Socket closed prematurely in httplib for https
type: behavior
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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> And indeed, the following code generates a segfault on my machine:

I was going to give similar example and assign crash type to issue, but on my 
machine it does not generate a segfault.

> The patch should probably include a regression test.

Someone borrowed Guido's time machine and have already done this test (see 
NonIntegral in Lib/test/test_int.py).

--

___
Python tracker 

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



[issue10217] python-2.7.amd64.msi install fails

2012-09-27 Thread Alexander L. Belikoff

Alexander L. Belikoff added the comment:

Same problem for Python 3.2.3. Log file for failed installation attached.

--
nosy: +abelikoff
versions: +Python 3.2 -Python 2.7
Added file: http://bugs.python.org/file27318/python.zip

___
Python tracker 

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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Mark Dickinson

Mark Dickinson added the comment:

That test doesn't look quite the same, though:  the return value of __trunc__ 
is an object that has __trunc__ rather than __int__.  And all the existing 
tests pass on my machine without issues.

--

___
Python tracker 

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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Mark Dickinson

Mark Dickinson added the comment:

Here's patch that adds a regression test.

--
Added file: http://bugs.python.org/file27319/float2int_dbl_decref_2.patch

___
Python tracker 

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



[issue16063] HMAC trans_5C is a string, causing a TypeError

2012-09-27 Thread Adam Glenn

New submission from Adam Glenn:

When passing 2 unicode objects to hmac.new() I'm getting "TypeError: character 
mapping must return integer, None or unicode" I've tried this using 
hashlib.sha1 and hashlib.md5 and the behavior is the same. What I think is 
happening is that the trans_5C join at the top of this module is a string so 
it's causing the type error when I try to generate the new hmac object at line 
72.

--
components: None
messages: 171384
nosy: Adam.Glenn
priority: normal
severity: normal
status: open
title: HMAC trans_5C is a string, causing a TypeError
type: behavior
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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, it generates a segfault in debug mode.

LGTM.

--
type: behavior -> crash

___
Python tracker 

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



[issue16061] performance regression in string replace for 3.3

2012-09-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Interpreter Core
nosy: +storchaka

___
Python tracker 

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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 690287f8ea95 by Mark Dickinson in branch 'default':
Issue #16060: Fix a double DECREF in int() implementation.  Thanks Serhiy 
Storchaka.
http://hg.python.org/cpython/rev/690287f8ea95

--
nosy: +python-dev

___
Python tracker 

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



[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-27 Thread Larry Hastings

New submission from Larry Hastings:

I wrote the following script called "bonkers.py":
--
import sys
print(sys.argv[0])
--

then ran
% python3 -m unittest bonkers

It printed
--
['python -m unittest', 'bonkers']
--

Shouldn't it say "python3", not "python"?  Maybe it should use sys.executable?  
(Though that gets tricky if there are spaces in the filename.)

--
assignee: michael.foord
components: Library (Lib)
messages: 171387
nosy: larry, michael.foord
priority: normal
severity: normal
stage: needs patch
status: open
title: unittest -m claims executable is "python", not "python3"
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Mark Dickinson

Mark Dickinson added the comment:

Applied.  Thanks!

I'm not sure whether this is worthy of inclusion in Python 3.3.0;  on one hand, 
it's a segfault from core Python.  On the other, it doesn't look that easy to 
trigger by accident.

On balance, I'd say it's safe to wait for Python 3.3.1 for this.  Adding Georg 
to the nosy in case he disagrees.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue16060] Double decref and dereferencing after decref in int()

2012-09-27 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue16061] performance regression in string replace for 3.3

2012-09-27 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Unicode
nosy: +ezio.melotti, haypo
stage:  -> needs patch
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



[issue16057] Subclasses of JSONEncoder should not be insturcted to call JSONEncoder.decode

2012-09-27 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti, petri.lehtinen
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue16065] Python/distutils setup.py: passing --prefix / makes --root ignored

2012-09-27 Thread Ron Hubbard

New submission from Ron Hubbard:

setup.py loses the DESTDIR aka --root iff "/" is passed as prefix


http://seclists.org/nmap-dev/2012/q3/1025

I can reproduce this now, but only with a prefix of "/". For example,
this works:

$ python setup.py install --prefix "/a" --root "/home/david/destdir"
copying build/scripts-2.7/ndiff -> /home/david/destdir/a/bin

But this doesn't:

$ python setup.py install --prefix "/" --root "/home/david/destdir"
copying build/scripts-2.7/ndiff -> /bin

This looks like a Python/distutils bug.


the same seems to happen on python install:
when installing python 2.7.2, "2to3", "idle", "pydoc" and "smptd.py" are 
installed into /bin rather than into the chosen destdir

./python -E ./setup.py install \
--prefix=/ \
--install-scripts=//bin \
--install-platlib=//lib/python2.7/lib-dynload \
--root=//opt/python/
[...]
running install
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers


running install_scripts
copying build/scripts-2.7/smtpd.py -> /bin
copying build/scripts-2.7/idle -> /bin
copying build/scripts-2.7/pydoc -> /bin
copying build/scripts-2.7/2to3 -> /bin
changing mode of /bin/smtpd.py to 755
changing mode of /bin/idle to 755
changing mode of /bin/pydoc to 755
changing mode of /bin/2to3 to 755
running install_egg_info
Writing /lib/python2.7/lib-dynload/Python-2.7.2-py2.7.egg-info
if test -f //opt/python//bin/python -o -h //opt/python//bin/python; \
then rm -f //opt/python//bin/python; \
else true; \
fi
(cd //opt/python//bin; ln python2.7 python)
rm -f //opt/python//bin/python-config
(cd //opt/python//bin; ln -s python2.7-config python-config)
test -d //opt/python//lib/pkgconfig || /bin/install -c -d -m 755 
//opt/python//lib/pkgconfig
rm -f //opt/python//lib/pkgconfig/python.pc
[snip]

--
components: Build
messages: 171389
nosy: arschficker
priority: normal
severity: normal
status: open
title: Python/distutils setup.py: passing --prefix / makes --root ignored
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



[issue16065] Python/distutils setup.py: passing --prefix / makes --root ignored

2012-09-27 Thread Ron Hubbard

Changes by Ron Hubbard :


--
type:  -> security

___
Python tracker 

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



[issue16065] Python/distutils setup.py: passing --prefix / makes --root ignored

2012-09-27 Thread Ron Hubbard

Ron Hubbard added the comment:

python 2.7.2 installation:
CFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE" ./configure -C --prefix="/" || exit 1
make -j9  || exit 1
make DESTDIR="//opt/python" install || exit 1

what python generates out of 
   --install-scripts=//bin \
   --install-platlib=//lib/python2.7/lib-dynload \
is both wrong (i.e. the platlib stuff also ignores DESTDIR passed to make)

--

___
Python tracker 

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



[issue13028] python wastes linux users time by checking for dylib on each dynamic library load

2012-09-27 Thread Ron Hubbard

Changes by Ron Hubbard :


--
type:  -> resource usage

___
Python tracker 

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



[issue16056] shadowed test names in std lib regression tests

2012-09-27 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The attached patch uses the infrastructure of patchcheck.py and
merges the script into patchcheck.py instead of adding a new script.

--
keywords: +patch
Added file: http://bugs.python.org/file27320/duplicate_test_names.patch

___
Python tracker 

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



[issue16056] shadowed test names in std lib regression tests

2012-09-27 Thread Xavier de Gaye

Xavier de Gaye added the comment:

patchcheck output with the patch applied:

$ make patchcheck
./python ./Tools/scripts/patchcheck.py
Getting the list of files that have been added/changed ... 1 file
Fixing whitespace ... 0 files
Fixing C file whitespace ... 0 files
Fixing docs whitespace ... 0 files
Duplicate test names found in ... 1 file:
  Lib/test/test_heapq.py: test name 'TestErrorHandling.test_get_only'
Docs modified ... NO
Misc/ACKS updated ... NO
Misc/NEWS updated ... NO
configure regenerated ... not needed
pyconfig.h.in regenerated ... not needed

Did you run the test suite?

--

___
Python tracker 

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



[issue16036] simplify int() signature docs

2012-09-27 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching updated patch that clarifies the accepted non-numeric types as Serhiy 
suggested on Rietveld.

I also made a few other changes like linking to "integer literal" and updating 
the "base-radix" reference.  As I began to suspect, the latter was left over 
from a prior version of the docs (when the keyword argument was named "radix"):

http://hg.python.org/cpython/file/18db8c4d4487/Doc/library/functions.rst#l559

I will commit later today unless there are further suggestions.

--
Added file: http://bugs.python.org/file27321/issue-16036-4-default.patch

___
Python tracker 

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



[issue16066] Truncated POST data in CGI script on Windows 7

2012-09-27 Thread Alexander Martin

New submission from Alexander Martin:

POST data is truncated randomly when sent to a python script running on a 
simple python CGI server on Windows 7 with Python 3.2.3.

The same server and script files run successfully on MAC OSX 10.8 with Python 
3.2.3. A similar server (adapted for lower Python version) and the same script 
file do work fine on Windows 7 with Python 2.7.2. 

Steps to reproduce: Attached zip contains server script, HTML file and Python 
script, that receives an uploaded file and saves it to disk. Upload an image 
file and submit the form inside the HTML file to Python script. Repeat form 
submission multiple times. In more than 50% of test cases, the uploaded file 
will not be completely available inside the Python script. That means size of 
the same uploaded file varies with each POST request. Additionally, the Python 
server will reset the HTTP connection sometimes.

--
components: Windows
files: Truncated_POST_data_in_CGI_script_on_Win7.zip
messages: 171394
nosy: Alexander.Martin, brian.curtin, tim.golden
priority: normal
severity: normal
status: open
title: Truncated POST data in CGI script on Windows 7
type: behavior
versions: Python 3.2
Added file: 
http://bugs.python.org/file27322/Truncated_POST_data_in_CGI_script_on_Win7.zip

___
Python tracker 

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



[issue10217] python-2.7.amd64.msi install fails

2012-09-27 Thread Martin v . Löwis

Martin v. Löwis added the comment:

The only trace to a potential error I could find is

Assembly Error:The requested operation failed. A system reboot is required to 
roll back changes made.
Assembly Error (sxs): Please look into Component Based Servicing Log located at 
-134744968ndir\logs\cbs\cbs.log to get more diagnostic information.

So if you can find cbs.log on your system, please attach it as well. Please 
check that it doesn't contain any confidential information before posting it.

However, some people reported that this problem actually means that you need to 
reboot before you can perform the installation (because of a failure to reboot 
after some prior installation that required reboot). So please also reboot and 
report whether it solved the problem.

--

___
Python tracker 

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



[issue16056] shadowed test names in std lib regression tests

2012-09-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e99c0425da59 by Benjamin Peterson in branch 'default':
renmae test method to avoid conflict (#16056)
http://hg.python.org/cpython/rev/e99c0425da59

--
nosy: +python-dev

___
Python tracker 

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



[issue16056] shadowed test names in std lib regression tests

2012-09-27 Thread Chris Jerdonek

Chris Jerdonek added the comment:

To simplify and keep the discussions more focused, etc, I would create a new 
issue for the patch to patchcheck (and mark it "enhancement").  Both issues can 
still reference each other.

--

___
Python tracker 

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



[issue16067] UAC prompt for installation shows temporary file name

2012-09-27 Thread Edward Brey

New submission from Edward Brey:

When installing on Windows, the UAC prompt shows a temporary random file name 
for the MSI file. To solve this, use the /d switch with  signtool when signing 
the MSI file.

Cf. http://stackoverflow.com/q/4315840

--
components: Installation
messages: 171398
nosy: breyed
priority: normal
severity: normal
status: open
title: UAC prompt for installation shows temporary file name
type: behavior
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



[issue16068] with statement executes type(obj).__exit__ rather than getattr(obj, "__exit__")

2012-09-27 Thread Paul Wiseman

New submission from Paul Wiseman:

I found this behaviour today and thought it was weird so asked the question on 
SO here 
http://stackoverflow.com/questions/12632894/why-doesnt-getattr-work-with-exit/12632972#12632972

basically if I attributes are returned dynamically, they seem to get overlooked 
by the code that runs the with statements.

>>> class FileHolder(object):
...def __init__(self,*args,**kwargs):
...self.f= file(*args,**kwargs)
...def __getattr__(self,item):
...return getattr(self.f,item)
...
>>> a= FileHolder("a","w")
>>> a.write

>>> with a as f:
...   print f
...
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: __exit__
>>> a.__exit__


--
components: Library (Lib)
messages: 171399
nosy: Paul.Wiseman
priority: normal
severity: normal
status: open
title: with statement executes type(obj).__exit__ rather than 
getattr(obj,"__exit__")
type: behavior
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



[issue16069] packaging shows up on docs.python.org/dev

2012-09-27 Thread Chris Jerdonek

New submission from Chris Jerdonek:

Date: Tue, 11 Sep 2012 16:20:54 +0200
To: d...@python.org
Subject: [docs] packaging documentation should be removed

docs.python.org/dev still carries documentation for packaging, despite the 
package
having been removed. http://docs.python.org/dev/library/packaging.html has
"3.3.0a4 Documentation" in the footer, so I presume that the page is a leftover.
Google returns results which point to the obsolete page, which is misleading.

(from http://mail.python.org/pipermail/docs/2012-September/010519.html )

--
assignee: docs@python
components: Documentation
messages: 171400
nosy: chris.jerdonek, docs@python
priority: normal
severity: normal
status: open
title: packaging shows up on docs.python.org/dev
type: enhancement
versions: Python 3.3

___
Python tracker 

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



[issue16068] with statement executes type(obj).__exit__ rather than getattr(obj, "__exit__")

2012-09-27 Thread Paul Wiseman

Paul Wiseman added the comment:

I got pointed to an explanation in the docs! 
http://docs.python.org/reference/datamodel.html#special-method-lookup-for-new-style-classes

It was confusing, though :)

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue16070] Structure and native Structure (LittleEndianStructure on Windows) supports __slots__, but BigEndianStructure doesn't

2012-09-27 Thread HCT

New submission from HCT:

using official CPython 3.2.3 with a simple demonstration script (attached) to 
demonstrate inconsistency between ctypes structures

from ctypes import *

class cbs( BigEndianStructure ):
__slots__ = tuple()
def __init__( self, *args, **kw ):
super().__init__( *args, **kw )
self.a = 11

class cls( LittleEndianStructure ):
__slots__ = tuple()
def __init__( self, *args, **kw ):
super().__init__( *args, **kw )
self.a = 11

class cs( Structure ):
__slots__ = tuple()
def __init__( self, *args, **kw ):
super().__init__( *args, **kw )
self.a = 11

try :
cbs1=cbs()
except AttributeError as e:
print(e)

try :
cls1=cls()
except AttributeError as e:
print(e)

try :
cs=cs()
except AttributeError as e:
print(e)



yields

'cls' object has no attribute 'a'
'cs' object has no attribute 'a'



I expect cbs to throw error too, but itwent through the initalization and 
silently ignored the __slots__ defined in the class

--
components: ctypes
files: slots_test.py
messages: 171402
nosy: hct
priority: normal
severity: normal
status: open
title: Structure and native Structure (LittleEndianStructure on Windows) 
supports __slots__, but BigEndianStructure doesn't
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file27323/slots_test.py

___
Python tracker 

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



[issue16071] fix link to email.message.Message in mailbox docs

2012-09-27 Thread Chris Jerdonek

New submission from Chris Jerdonek:

> Date: Thu, 13 Sep 2012 00:28:20 -0700
> To: d...@python.org
> Subject: [docs] Bug in documentation for mailbox module
>
> I think I may have found a minor bug in the documentation for the
> mailbox module, at:
>
> http://docs.python.org/library/mailbox.html
>
> Right at the beginning of section 18.4.2. ("Message objects"), when
> describing the mailbox.Message class, is the following:
>
> "A subclass of the email.Message module?s *Message*. Subclasses of
> mailbox.Message add mailbox-format-specific state and behavior."
>
> The word "Message" indicated above with asterisks is a hyperlink to:
>
> http://docs.python.org/library/mailbox.html#mailbox.Message
>
> I think it should instead link to:
>
> http://docs.python.org/library/email.message.html#email.message.Message

(from: http://mail.python.org/pipermail/docs/2012-September/010520.html )

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 171403
nosy: barry, chris.jerdonek, docs@python, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: fix link to email.message.Message in mailbox docs
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



[issue16072] fix documentation of string.replace() signature

2012-09-27 Thread Chris Jerdonek

New submission from Chris Jerdonek:

> Date: Thu, 13 Sep 2012 09:42:47 -0400
> To: 
> Subject: [docs] Problem with the documentation for string.replace
>
> >From http://docs.python.org/library/string.html
>
> string.replace(str, old, new[, 
> maxreplace])?
> Return a copy of string str with all occurrences of substring old replaced by 
> new. If the optional argument maxreplace is given, the first maxreplace 
> occurrences are replaced.
>
> it would appear this needs to be
> string.replace(old, new[, 
> maxreplace])?

(from: http://mail.python.org/pipermail/docs/2012-September/010521.html )

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 171404
nosy: chris.jerdonek, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: fix documentation of string.replace() signature
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



[issue16073] fix map() statement in list comprehension example

2012-09-27 Thread Chris Jerdonek

New submission from Chris Jerdonek:

> Date: Thu, 20 Sep 2012 15:14:36 -0400
> To: d...@python.org
> Subject: [docs] map objects are not lists
>
> 5.1.3. List 
> Comprehensions
>
> List comprehensions provide a concise way to create lists. Common
> applications are to make new lists where each element is the result of some
> operations applied to each member of another sequence or iterable, or to
> create a subsequence of those elements that satisfy a certain condition.
>
> For example, assume we want to create a list of squares, like:

>
 squares = []>>> for x in range(10):... squares.append(x**2)...>>> 
 squares[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
>
> We can obtain the same result with:
>
> squares = [x**2 for x in range(10)]
>
> This is also equivalent to squares = map(lambda x: x**2, range(10)), but
> it?s more concise and readable.
>
>
> I think that the last sentence above should read:
>
> squares = list(map(lambda x: x**2, range(10)))
>
> In other words, the map function returns a map object, not a list object,
> so the list() function needs to be used to convert it to something that is
> truly equivalent to the previous definitions of "squares".  (In case it
> matters, I am using Python-3.3.0rc2 on RHEL 6.3.)

(from http://mail.python.org/pipermail/docs/2012-September/010525.html )

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 171405
nosy: chris.jerdonek, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: fix map() statement in list comprehension example
type: enhancement
versions: Python 3.3

___
Python tracker 

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



[issue13028] python wastes linux users time by checking for dylib on each dynamic library load

2012-09-27 Thread Thomas Lee

Thomas Lee added the comment:

I know this is an old-ish issue, but I can't reproduce anything like this on 
Debian Wheezy with either Python 2.7 or tip (3.x). I think we need more details 
of what you're trying to do here Roger.

1. What exactly did you do to reproduce the strace output below?
2. What flavor of Linux did you attempt this on?

Further, a more detailed description of what you expected to happen vs. what 
actually happened would be a big help here.

As Victor says, .dylib shouldn't appear in strace output on Linux at all (and 
my testing seems to confirm this).

--
nosy: +thomaslee

___
Python tracker 

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



[issue16061] performance regression in string replace for 3.3

2012-09-27 Thread Thomas Lee

Thomas Lee added the comment:

My results aren't quite as dramatic as yours, but there does appear to be a 
regression:

$ ./python -V
Python 2.7.3+

$ ./python -m timeit -s "s = 'b'*1000" "s.replace('b', 'a')"
10 loops, best of 3: 16.5 usec per loop

$ ./python -V
Python 3.3.0rc3+

$ ./python -m timeit -s "s = 'b'*1000" "s.replace('b', 'a')"
1 loops, best of 3: 22.7 usec per loop

--
nosy: +thomaslee

___
Python tracker 

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



[issue16062] Socket closed prematurely in httplib for https

2012-09-27 Thread Thomas Lee

Thomas Lee added the comment:

Thanks ABR. You may be better off raising a ticket against requests 
(https://github.com/kennethreitz/requests).

I'm assuming what you want to happen here is for the session.post() call to 
return the 401 response without raising an exception. Perfectly reasonable, but 
to the best of my knowledge the "requests" library isn't in Python's standard 
library -- and so this is not the place to get it fixed :)

--
nosy: +thomaslee

___
Python tracker 

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