[issue14768] os.path.expanduser('~/a') doesn't works correctly when HOME is '/'

2012-05-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e472481b6d73 by Jesus Cea in branch '3.2':
Closes #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is 
'/'
http://hg.python.org/cpython/rev/e472481b6d73

New changeset 299dc54ad014 by Jesus Cea in branch '2.7':
Closes #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is 
'/'
http://hg.python.org/cpython/rev/299dc54ad014

New changeset ce39a4ec2906 by Jesus Cea in branch 'default':
MERGE: Closes #14768: os.path.expanduser('~/a') doesn't works correctly when 
HOME is '/'
http://hg.python.org/cpython/rev/ce39a4ec2906

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> 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



[issue14651] pysetup run cmd can't handle option values in the setup.cfg

2012-05-09 Thread Éric Araujo

Changes by Éric Araujo :


--
dependencies: +Custom commands don't work

___
Python tracker 

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



[issue14767] urllib.request.HTTPRedirectHandler raises HTTPError when Location header is relative

2012-05-09 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

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



[issue14768] os.path.expanduser('~/a') doesn't works correctly when HOME is '/'

2012-05-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
assignee:  -> jcea

___
Python tracker 

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



[issue14768] os.path.expanduser('~/a') doesn't works correctly when HOME is '/'

2012-05-09 Thread Bradley Froehle

Bradley Froehle  added the comment:

Patch (for version 2.7) attached.

--
keywords: +patch
Added file: http://bugs.python.org/file25514/issue_14768.patch

___
Python tracker 

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



[issue14768] os.path.expanduser('~/a') doesn't works correctly when HOME is '/'

2012-05-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
keywords: +easy

___
Python tracker 

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



[issue14768] os.path.expanduser('~/a') doesn't works correctly when HOME is '/'

2012-05-09 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

I though that this situation would be happen for ANY env with $HOME ending in 
"/", but it is not the case:

"""
jcea@ubuntu:~$ echo $HOME
/home/jcea
jcea@ubuntu:~$ python
Python 2.7.3 (default, Apr 12 2012, 13:11:53) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.expanduser("~/a")
'/home/jcea/a'


jcea@ubuntu:/home/jcea$ export HOME=/home/jcea/
jcea@ubuntu:/home/jcea$ echo $HOME
/home/jcea/
jcea@ubuntu:/home/jcea$ python
Python 2.7.3 (default, Apr 12 2012, 13:11:53) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.expanduser("~/a")
'/home/jcea/a'
"""

Bradley, would you mind to write a patch & test?

--
nosy: +jcea
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



[issue5471] os.path.expanduser('~') doesnt works correctly when HOME is '/'

2012-05-09 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

See issue #14768.

--
nosy: +jcea

___
Python tracker 

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



[issue14759] BSDDB license missing from liscense page in 2.7.

2012-05-09 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

If your program is not using Berkeley DB in any way, you don't need to worry 
about its license. The situation is similar to Berkeley DB being included in 
you linux distribution: if you don't use it, you don't have to worry.

--

___
Python tracker 

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



[issue14768] os.path.expanduser('~/a') doesn't works correctly when HOME is '/'

2012-05-09 Thread Bradley Froehle

New submission from Bradley Froehle :

When $HOME=/, os.path.expanduser('~/a') returns '//a' rather than '/a'.

This regression was created by a partially incorrect resolution to issue #5471, 
and affects versions 2.7 and 3.2 (at least).

$ HOME=/ python2.7 -c "import os; print os.path.expanduser('~/a')"
//a
$ HOME=/ python3.2 -c "import os; print(os.path.expanduser('~/a'))"
//a

In each case the expected result should be '/a'.

--
components: Library (Lib)
messages: 160321
nosy: bfroehle
priority: normal
severity: normal
status: open
title: os.path.expanduser('~/a') doesn't works correctly when HOME is '/'
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue14759] BSDDB license missing from liscense page in 2.7.

2012-05-09 Thread R. David Murray

R. David Murray  added the comment:

Ah, I see.

No, the docs are correct, I'm the one who was mistaken.  I thought the license 
page was on www.python.org, rather than docs.python.org.  Developers *do* have 
full and easy access to docs.python.org, and we do track doc bugs here.

As with the rest of our documentation, the license documentation page is "more 
complete" than the source version.  (It's actually not in theory, it's just 
that it is collected all in one place...but the docs are shipped in the release 
tarballs, so the info is included in the distribution regardless).  

The license docs, unlike most of the rest of the docs, don't have 'version 
added' and 'deprecated' tags, so you have to refer to license page that relates 
to the specific version of python you are looking at.  However, it is not clear 
to me (given your BSDDB example) that this is in fact the case.  So I'm 
re-opening the issue hoping someone will be willing to do an audit.

But as you say, for due diligence you do have to look at the source as well as 
the docs, even if we fix this.

--
stage: committed/rejected -> needs patch
status: closed -> open
title: Is LICENSES.txt up to date? -> BSDDB license missing from liscense page 
in 2.7.

___
Python tracker 

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



[issue14767] urllib.request.HTTPRedirectHandler raises HTTPError when Location header is relative

2012-05-09 Thread jspenguin

New submission from jspenguin :

If a server returns a relative URL in the 'Location:' header, 
HTTPRedirectHandler will fail because it checks the scheme of the URL before it 
calls urljoin() to convert it to an absolute URL.

--
components: Library (Lib)
files: rel_redirect.py
messages: 160319
nosy: jspenguin
priority: normal
severity: normal
status: open
title: urllib.request.HTTPRedirectHandler raises HTTPError when Location header 
is relative
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file25513/rel_redirect.py

___
Python tracker 

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



[issue14759] Is LICENSES.txt up to date?

2012-05-09 Thread Jeff Laing

Jeff Laing  added the comment:

@Jesús, as has been pointed out already, the Berkeley DB stuff is not part of 
Python 3 so I don't see any point in discussing this with Oracle.

We don't actually use or need the bsddb module, it's just part of the standard 
runtime library that we ship.

We will be removing the bsddb module from our distribution of the runtime 
library, while our app is embedding the 2.7 interpreter.  Once we go to 3.0, 
the problem becomes moot.

When discussing issues related to licensing, a visible audit trail is essential 
to show that one followed a genuine process in a timely fashion.  When the 
lawyers come howling to our door, I want to be able to point at archived 
documentation that showed we were not knowingly continuing to violate a license 
condition once we became aware of it.

With respect to mail.python.org mailing lists, the 
http://docs.python.org/bugs.html page explicitly says "if you want a more 
persistent record of your issue, you can use the issue tracker for 
documentation bugs as well".  That suggested to me that there were more than 
just "developers" listening here.

I feel like it's getting a bit meta if I raise an issue here requesting that 
the website be clarified to note that the documentors don't really look at 
issues here.

:-)

Thanks to all, my immediate problem is resolved, and I now know that I need to 
dig a lot deeper into all the documentation each time we upgrade, rather than 
assume that it's all consistent.

--

___
Python tracker 

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



[issue14766] Non-naive time comparison throws naive time error

2012-05-09 Thread R. David Murray

R. David Murray  added the comment:

Ah.  datetime.timezone wouldn't have that issue since it doesn't deal with DST.

The 3.3 python version of datetime calls utcoffset in the same way as you 
describe, and it is supposed to have the same behavior as the C version, so 
probably 3.2/3.3 has the bug as well.  (It does look like a bug to me.)

Note that 2.6 is in security fix only mode, so this can only get corrected in 
2.7 and 3.2/3.3.

I'm surprised this hasn't been reported before.

--
keywords: +easy
stage:  -> needs patch
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6

___
Python tracker 

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



[issue14766] Non-naive time comparison throws naive time error

2012-05-09 Thread Chris Bergstresser

Chris Bergstresser  added the comment:

It doesn't seem to be a bug in pytz.  AFAICT, the only methods that get called 
during the time comparison is "utcoffset" on the UTC timezone, and "utcoffset" 
on the New York timezone.

Looking closer at it, it seems that Python is calling 
d1.tzinfo.utcoffset(None), rather than d1.tzinfo.utcoffset(d1).  This is a 
problem, because the New York timezone cannot calculate the utcoffset without 
knowing what date it's calculating.  As a result, it returns None rather than 
potentially guessing wrong.

--

___
Python tracker 

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



[issue14766] Non-naive time comparison throws naive time error

2012-05-09 Thread R. David Murray

R. David Murray  added the comment:

An equivalent test using python 3.2's datetime.timezone works fine.  Are you 
sure it isn't a bug in pytz?

--
nosy: +belopolsky, r.david.murray

___
Python tracker 

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



[issue14766] Non-naive time comparison throws naive time error

2012-05-09 Thread Chris Bergstresser

New submission from Chris Bergstresser :

The datetime module says:

An object d of type time or datetime may be naive or aware. d is aware if 
d.tzinfo is not None and d.tzinfo.utcoffset(d) does not return None. If 
d.tzinfo is None, or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns 
None, d is naive.

However, I can create two non-naive timezones (under this definition) which 
throw an exception when they're compared, because one is being considered 
offset-naive:

>>> import pytz, datetime
>>> UTC_TZ = pytz.utc
>>> EASTERN_TZ = pytz.timezone('America/New_York')
>>> d1 = datetime.time(10, tzinfo = UTC_TZ)
>>> d1
datetime.time(10, 0, tzinfo=)
>>> d1.tzinfo

>>> d1.utcoffset(d1)
datetime.timedelta(0)
>>> d2 = datetime.time(10, tzinfo = EASTERN_TZ)
>>> d2
datetime.time(10, 0, tzinfo=)
>>> d2.tzinfo

>>> d2.tzinfo.utcoffset(d2)
datetime.timedelta(-1, 68400)
>>> d1 < d2
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can't compare offset-naive and offset-aware times

--
messages: 160314
nosy: Chris.Bergstresser
priority: normal
severity: normal
status: open
title: Non-naive time comparison throws naive time error
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6c8a117f8966 by Victor Stinner in branch 'default':
Issue #14744: Inline unicode_writer_write_char() and unicode_write_str()
http://hg.python.org/cpython/rev/6c8a117f8966

--
nosy: +python-dev

___
Python tracker 

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



[issue14738] Amazingly faster UTF-8 decoding

2012-05-09 Thread STINNER Victor

STINNER Victor  added the comment:

> The difficulty is that you need to check on both Macs
> with 16-bit and with 32-bit wchar_t.

I don't think that the size of wchar_t is configurable: it should always be 32 
bits on Mac OS X.

--

___
Python tracker 

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



[issue14738] Amazingly faster UTF-8 decoding

2012-05-09 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Actually, it should be enough to run the test suite, since we should
> have tests for this.

I just ran the test suite ("python -m test") on OS X 10.6.8 with 
'decode_utf8_5.patch' applied.  (64-bit --with-pydebug build of Python.)  No 
test failures.


test header:

== CPython 3.3.0a3+ (default:840cb46d0395+, May 9 2012, 20:55:18) [GCC 4.2.1 
(Apple Inc. build 5664)]
==   Darwin-10.8.0-i386-64bit little-endian
==   /Users/mdickinson/Python/cpython/build/test_python_39794

Fragment of configure output relevant to wchar looked like this:

checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking size of wchar_t... 4
checking for UCS-4 tcl... no
checking whether wchar_t is signed... yes
no usable wchar_t found

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue9751] _PyInstance_Lookup() defeats its purpose

2012-05-09 Thread Armin Rigo

Armin Rigo  added the comment:

Unlike other crashers I'm a bit concerned about this one.  It can occur on any 
code that stores custom instances as keys in the __dict__ of an old-style 
instance.  Such code might be unusual-looking, but certainly not unheard-of.  
And the segfault that we get then is very rare and impossible to reproduce in 
practice because it depends on when exactly the GC is running and on the low 
bits of hashes colliding.

--

___
Python tracker 

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



[issue14738] Amazingly faster UTF-8 decoding

2012-05-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I hacked the code (commented out "#if __APPLE__" in
Objects/unicodeobject.c and Modules/python.c) to start this branch on
Linux and ran the test (test_cmd_line) with C locale. It passed. Then I
broke decoder and ran the test again to get the error. I can now confirm
that the code works correctly on a platform with a 32-bit wchar_t.

--

___
Python tracker 

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



[issue14738] Amazingly faster UTF-8 decoding

2012-05-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +janssen

___
Python tracker 

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



[issue14738] Amazingly faster UTF-8 decoding

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> It would be good if someone checked on Macs work with command line
> arguments, including non-valid utf8. The difficulty is that you need
> to check on both Macs with 16-bit and with 32-bit wchar_t.

Actually, it should be enough to run the test suite, since we should
have tests for this.
As for different wchar_t widths, that's the kind of thing we can leave
to the buildbots (assuming our OS X buildbots come back alive some
day :-)).

--

___
Python tracker 

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



[issue14738] Amazingly faster UTF-8 decoding

2012-05-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Issue4388 is related to this Mac-specific portion of the patch.

--

___
Python tracker 

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



[issue14738] Amazingly faster UTF-8 decoding

2012-05-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It would be good if someone checked on Macs work with command line arguments, 
including non-valid utf8. The difficulty is that you need to check on both Macs 
with 16-bit and with 32-bit wchar_t.

--

___
Python tracker 

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



[issue14738] Amazingly faster UTF-8 decoding

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There's a Mac-specific portion in the patch, it would be nice if someone could 
check that it works.

--
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue11352] Update cgi module doc

2012-05-09 Thread Pierre Quentel

Pierre Quentel  added the comment:

Hi,

I started working on a revised version of the whole cgi documentation. I mostly 
changed paragraphs 2 & 3 ("Using the CGI module" and "Higher level interface") 
and replaced them by a paragraph still called "Using the CGI module" + 2 other 
paragraphs for special cases : "Multiple fields with the same name" and "File 
uploads"

The content is basically the same but the new presentation is hopefully more 
clear

The patch is attached as file cgi-doc.patch

--
Added file: http://bugs.python.org/file25512/cgi-doc.patch

___
Python tracker 

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



[issue8617] Better document user site-packages in site module doc

2012-05-09 Thread Maxim Doucet

Maxim Doucet  added the comment:

Fair enough, thank you for the information. As a side note, my original 
question was in fact more suited for issue10745

--

___
Python tracker 

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



[issue8617] Better document user site-packages in site module doc

2012-05-09 Thread Éric Araujo

Éric Araujo  added the comment:

BTW it appears that many people use the most recent 2.7 documentation even if 
they are using 2.6, because the doc is better and there are notes which tell 
you if something was changed or added in 2.7.  For PEP 370 there are notes in 
the doc of the site module and the environment variables but I forgot to add 
one to the distutils doc; I will do that.

--

___
Python tracker 

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



Re: [issue13183] pdb skips frames after hitting a breakpoint and running step

2012-05-09 Thread Senthil Kumaran
> Georg Brandl  added the comment:
> 
> Should be fixed now.

Thanks for the commit fix, Georg. The comment on buildbot failures had
escaped my attention. Sorry for that.

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



[issue8617] Better document user site-packages in site module doc

2012-05-09 Thread Éric Araujo

Éric Araujo  added the comment:

2.6 only gets security fixes now.

--

___
Python tracker 

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



[issue8617] Better document user site-packages in site module doc

2012-05-09 Thread Maxim Doucet

Maxim Doucet  added the comment:

Shouldn't there be an update of the 2.6 documentation too?

After your patch, the 2.7 reflects the existence of the "--user" option (see 
http://docs.python.org/release/2.7.3/install/index.html#alternate-installation-the-user-scheme)
 but not the 2.6 documentation 
(http://docs.python.org/release/2.6.8/install/index.html#alternate-installation).

In my personal experience, I used the "--home" option with python 2.6 to mimic 
what "--user" does and it took me 2 weeks to, by chance, stumble upon 
http://www.python.org/dev/peps/pep-0370/ which informed me that the "--user" 
option was originally available for python 2.6. If it had been on the 2.6 
documentation, it would have been easier and more coherent IMHO.

--
nosy: +maximd

___
Python tracker 

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



[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I came here when I saw this comment in the diff: "# Keep the traditional 
pre-3.3 API intact".  Why keep an internal API intact if we do it partially?

The ExFileObject class above will also simplify the code: simply "return 
self.fileobject(self, tarinfo)" in all cases.

--

___
Python tracker 

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



[issue14712] Integrate PEP 405

2012-05-09 Thread Vinay Sajip

Changes by Vinay Sajip :


Removed file: http://bugs.python.org/file25444/old-patch.diff

___
Python tracker 

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



[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-05-09 Thread Stephen White

Stephen White  added the comment:

Glad this is fixed.  Attached is a Python 2.7 file that demonstrates the 
problem in a pretty minimal way in case it is of any use to anyone.

--
nosy: +Stephen.White
Added file: http://bugs.python.org/file25511/bad-thread.py

___
Python tracker 

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



[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Code search is not proof, I'm afraid.  It is evidence, though, and I
> thought I indicated I thought it was a good argument in favor of
> dropping the class.

Yes, sorry for the vocabulary mismatch :-)

--

___
Python tracker 

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



[issue14764] importlib.test.benchmark broken

2012-05-09 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue14712] Integrate PEP 405

2012-05-09 Thread Vinay Sajip

Changes by Vinay Sajip :


Added file: http://bugs.python.org/file25510/51b73e1c1e94.diff

___
Python tracker 

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



[issue14760] logging: make setLevel() return handler itself for chained configuration

2012-05-09 Thread Vinay Sajip

Vinay Sajip  added the comment:

I agree with Georg. Besides, as far as possible, the API should be consistent 
across versions of Python, unless something is needed to take advantage of 
added features.

With your proposal, users could write library code which then would not work in 
older Python versions - and that's not something we want to encourage.

--
assignee:  -> vinay.sajip
nosy: +vinay.sajip
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



[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread R. David Murray

R. David Murray  added the comment:

Code search is not proof, I'm afraid.  It is evidence, though, and I thought I 
indicated I thought it was a good argument in favor of dropping the class.

--

___
Python tracker 

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



[issue14765] the struct example should give consistent results across different hardware platforms

2012-05-09 Thread Meador Inge

Changes by Meador Inge :


--
resolution:  -> invalid
stage:  -> 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



[issue14765] the struct example should give consistent results across different hardware platforms

2012-05-09 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe  added the comment:

Sadly, I noticed it only after submitting this report.

--

___
Python tracker 

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



[issue14765] the struct example should give consistent results across different hardware platforms

2012-05-09 Thread Meador Inge

Meador Inge  added the comment:

And the examples make an explicit note of that:

"""
.. note::
All examples assume a native byte order, size, and alignment with a
big-endian machine.
"""

AMD64 is little-endian;  the examples are noted to be in big-endian.

Is that note not sufficient?

--

___
Python tracker 

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



[issue14765] the struct example should give consistent results across different hardware platforms

2012-05-09 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

This example [1] assumes you are using a specific platform to check it out. I 
am using amd64, and I get different results. To fix, I prefix the format string 
with '>':

before:
pack('hhl', 1, 2, 3)

after:
pack('>hhl', 1, 2, 3)

1: http://hg.python.org/cpython/file/d3ddbad31b3e/Doc/library/struct.rst#l299

--
assignee: docs@python
components: Documentation
messages: 160291
nosy: docs@python, mark.dickinson, meador.inge, tshepang
priority: normal
severity: normal
status: open
title: the struct example should give consistent results across different 
hardware platforms
type: enhancement
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



[issue14758] SMTPServer of smptd does not support binding to an IPv6 address

2012-05-09 Thread R. David Murray

R. David Murray  added the comment:

Well, that should be fixed anyway (a cleanup added that restores the original 
value).  Then a new TestCase can test the socket stuff.

--

___
Python tracker 

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



[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Yeah, I know it is technically private.  We still tend to keep names
> around unless there's a good reason to delete them (like using them
> leads to broken code anyway).  The code search is some evidence this
> deletion would be OK, but why *not* follow Amaury's suggestion?

I don't see the point of maintaining a private API that's proven to be
unused :) It's an unwarranted maintenance burden (though admittedly a
light one here).

--

___
Python tracker 

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



[issue14762] ElementTree memory leak

2012-05-09 Thread Giuseppe Attardi

Changes by Giuseppe Attardi :


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



[issue14762] ElementTree memory leak

2012-05-09 Thread Giuseppe Attardi

Giuseppe Attardi  added the comment:

You are right, I should discard the elements.

Thank you.

--

___
Python tracker 

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



[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread R. David Murray

R. David Murray  added the comment:

Yeah, I know it is technically private.  We still tend to keep names around 
unless there's a good reason to delete them (like using them leads to broken 
code anyway).  The code search is some evidence this deletion would be OK, but 
why *not* follow Amaury's suggestion?

I'm OK if you reclose this, but I unfortunately I don't think simple 
cleanliness is a good argument (even though I would like it to be).  The other 
arguments are better :)

--

___
Python tracker 

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



[issue14758] SMTPServer of smptd does not support binding to an IPv6 address

2012-05-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue14762] ElementTree memory leak

2012-05-09 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Can this be reproduced in 3.2/3.3?

--
nosy: +jcea

___
Python tracker 

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



[issue14758] SMTPServer of smptd does not support binding to an IPv6 address

2012-05-09 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Unfortunately unit tests overwrite the original smtpd.socket module object with 
test.mock_socket [1] and the latter one doesn't expose socket.getaddrinfo().

[1] http://hg.python.org/cpython/file/d937b527b76e/Lib/test/test_smtpd.py#l54

--

___
Python tracker 

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



[issue14763] string.split maxsplit documented incorrectly

2012-05-09 Thread Fj

Fj  added the comment:

Thank you.

> These functions are anyway deprecated

Well, yes, but it's the only place you can get information about the default 
value of maxsplit, short of looking in the source. Which is kind of wrong.

Maybe you can also fix str.split docstring to say "If maxsplit is not specified 
*or negative*, then there is no limit on the number of splits"?

--

___
Python tracker 

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



[issue14759] Is LICENSES.txt up to date?

2012-05-09 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Could be useful if you directly talk to Oracle about this and communicate what 
you learned. It could even influence pybsddb licensing/documentation :).

--

___
Python tracker 

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



[issue14759] Is LICENSES.txt up to date?

2012-05-09 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

I am the maintainer of Berkeley DB python bindings, "pybsddb": 
http://www.jcea.es/programacion/pybsddb.htm

If I recall correctly, Berkeley DB license is something like this:

1. Your code must be open source, if you distribute the programs to others. You 
can write a program for your business, for instance, and don't care about 
licensing, if it used internally only.

OR

2. You have to pay a license to Oracle.

Choose one.

I could be mistaken...

--
nosy: +jcea

___
Python tracker 

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



[issue14764] importlib.test.benchmark broken

2012-05-09 Thread Antoine Pitrou

New submission from Antoine Pitrou :

It seems the benchmark script didn't survive the migration:


$ ./python -m importlib.test.benchmark
Measuring imports/second over 1 second, best out of 3
Entire benchmark run should take about 33 seconds
Using  as __import__

sys.modules [ 289195 288128 288050 ] best is 289,195
Built-in module [ 48351 48101 48432 ] best is 48,432
Source writing bytecode: small [ Traceback (most recent call last):
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 30, in 
bench
total_time += timer.timeit(1)
  File "/home/antoine/cpython/opt/Lib/timeit.py", line 190, in timeit
timing = self.inner(it, self.timer)
  File "", line 6, in inner
  File "/home/antoine/cpython/opt/Lib/importlib/_bootstrap.py", line 1077, in 
__import__
module = _gcd_import(name)
  File "/home/antoine/cpython/opt/Lib/importlib/_bootstrap.py", line 1024, in 
_gcd_import
return _find_and_load(name, _gcd_import)
  File "/home/antoine/cpython/opt/Lib/importlib/_bootstrap.py", line 974, in 
_find_and_load
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '__importlib_test_benchmark__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/cpython/opt/Lib/runpy.py", line 162, in 
_run_module_as_main
"__main__", fname, loader, pkg_name)
  File "/home/antoine/cpython/opt/Lib/runpy.py", line 75, in _run_code
exec(code, run_globals)
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 239, 
in 
main(import_, options)
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 197, 
in main
for result in benchmark(seconds=seconds, repeat=repeat):
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 108, 
in source_writing_bytecode
for result in bench(name, cleanup, repeat=repeat, seconds=seconds):
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 32, in 
bench
cleanup()
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 106, 
in cleanup
sys.modules.pop(name)
KeyError: '__importlib_test_benchmark__'

--
components: Library (Lib)
messages: 160281
nosy: brett.cannon, pitrou
priority: low
severity: normal
status: open
title: importlib.test.benchmark broken
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



[issue14759] Is LICENSES.txt up to date?

2012-05-09 Thread R. David Murray

R. David Murray  added the comment:

The LICENSE.txt file is "just" the Python license, which has a rather 
convoluted history.  Newer contributions are all under an Apache-style license 
from the individual contributors.  My understanding (but I'm not a lawyer) is 
that everything in the distribution has been vetted as available for use under 
the LISCENSE.txt, which includes commercial use.  If you believe that the 
language either in that file or on the web site does not convey that legally, 
then p...@python.org is who you need to contact.  On the development side, the 
most we can do is update a license if someone figures out that it is 
appropriate to do so.

For the website text, there's a mailing list listed on the mail.python.org 
page.  There's a project ongoing to make updating the web site easier, but 
currently there aren't very many developers who do web site updates, and such 
updates are not tracked on this tracker, just on that mailing list.  (Yes, this 
is not ideal, but it is where we are at right now.)  I've added one of those 
devs as nosy, perhaps he will have additional comments.

--
nosy: +michael.foord
title: Berkeley DB License conditions are onerous (and poorly documented) -> Is 
LICENSES.txt up to date?

___
Python tracker 

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



[issue14763] string.split maxsplit documented incorrectly

2012-05-09 Thread Ezio Melotti

Ezio Melotti  added the comment:

I fixed the doc for string.split/rsplit.  I didn't change the signature because 
all the other functions use the old signature convention (the one with []).  
These functions are anyway deprecated, so I don't think it's worth spending 
more time improving their docs (as long as they are not wrong).

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue14763] string.split maxsplit documented incorrectly

2012-05-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d3ddbad31b3e by Ezio Melotti in branch '2.7':
#14763: fix documentation for string.split/rsplit.
http://hg.python.org/cpython/rev/d3ddbad31b3e

--
nosy: +python-dev

___
Python tracker 

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-09 Thread STINNER Victor

STINNER Victor  added the comment:

> Inlining may be removed to simplify the code

Attached inline_unicode_writer.patch does inline the code but also call only 
unicode_writer_prepare() once for each argument in PyUnicode_Format(). The 
patch removes unicode_writer_write_char() and unicode_writer_write_str() which 
had an overhead for the following patches (format_writer.patch, 
format_writer-2.patch).

> As you can see, there is a regress, and sometimes
> it is not less than improvement.

Oh yes, thanks for your benchmark. I will analyze why my patch slows down these 
cases and try to update my patch to be applicable after 
inline_unicode_writer.patch. I suppose that the _PyUnicodeWriter API has a 
little overhead which is seen by microbenchmarks.

--
Added file: http://bugs.python.org/file25509/inline_unicode_writer.patch

___
Python tracker 

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



[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Lars Gustäbel

Lars Gustäbel  added the comment:

In an earlier draft of my patch, I had kept ExFileObject as a subclass of 
BufferedReader, but I later decided against it. To use BufferedReader directly 
is in my opinion the cleaner solution.

I admit that the change is not fully backward compatible. But a user can still 
write code that works for both 3.3 and the versions before. If he didn't 
subclass ExFileObject his code doesn't even need a change. If he subclassed 
ExFileObject, he might have a problem in either case: either the ExFileObject 
class is missing, or he may be unable to use it the way he did before, because 
all that's left of it is a stub subclass of BufferedReader.

I am well aware that backward compatibility is most important, but I think it 
must still be allowed to change internal (and undocumented) APIs every now and 
then to clean things up a little.
And of course, I did a code search before too, and found no code using 
ExFileObject. This actually doesn't surprise me, as there is really not much 
you can do with it.

--

___
Python tracker 

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



[issue14762] ElementTree memory leak

2012-05-09 Thread Eli Bendersky

Eli Bendersky  added the comment:

Can you specify how you import ET? I.e. from the pure Python or the C 
accelerator?

Also, do you realize that the element iterparse returns should be discarded 
with 'clear'? [see tutorial here: 
http://eli.thegreenplace.net/2012/03/15/processing-xml-in-python-with-elementtree/]

--

___
Python tracker 

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



[issue14761] Memleak in import.c load_source_module()

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Fixed, thank you!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
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



[issue14761] Memleak in import.c load_source_module()

2012-05-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9de4d85e4197 by Antoine Pitrou in branch '3.2':
Issue #14761: Fix potential leak on an error case in the import machinery.
http://hg.python.org/cpython/rev/9de4d85e4197

New changeset 840cb46d0395 by Antoine Pitrou in branch 'default':
Null merge for issue #14761.
http://hg.python.org/cpython/rev/840cb46d0395

--

___
Python tracker 

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



[issue14763] string.split maxsplit documented incorrectly

2012-05-09 Thread Fj

New submission from Fj :

string.split documentation says:

> The optional third argument maxsplit defaults to 0. If it is nonzero, at most 
> maxsplit number of splits occur, and the remainder of the string is returned 
> as the final element of the list (thus, the list will have at most maxsplit+1 
> elements).

It lies! If you give it maxsplit=0 it doesn't do any splits at all! It should 
say:

> The optional third argument maxsplit defaults to **-1**. If it is 
> **nonnegative**, at most maxsplit number of splits occur, ...

Additionally, it could specify default values in the function signature 
explicitly, like re.split does:

string.split(s, sep=None, maxsplit=-1)

instead of

string.split(s, [sep, [maxsplit]])

It seems that the inconsistency stems from the time long forgotten (certainly 
before 2.5) when string.split used the implementation in stropmodule.c 
(obsolete), which does indeed uses maxsplit=0 (and on which the re.split 
convention was based, regrettably).

Currently string.split just calls str.split, and that uses maxsplit=-1 to mean 
unlimited splits.

>From searching "maxsplit" in the bug tracker I understand that split functions 
>have had a rather difficult history and some quirks preserved for the sake of 
>backward compatibility, and not documented for the sake of brevity. In this 
>case, however, the documentation does try to document the particular 
>behaviour, but is wrong, which is really confusing.

Also, maybe an even better fix would be to change the str.split documentation 
to use the proper signature (`str.split(sep=None, maxsplit=-1)`), and simply 
say that string.split(s, sep=None, maxsplit=-1) calls s.split(sep, maxsplit) 
here? Because that's what it does, while having _two_ different, incomplete, 
partially wrong explanations of the same thing is confusing!

--
assignee: docs@python
components: Documentation
messages: 160273
nosy: Fj, docs@python
priority: normal
severity: normal
status: open
title: string.split maxsplit documented incorrectly
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



[issue14761] Memleak in import.c load_source_module()

2012-05-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a775fc27f469 by Antoine Pitrou in branch '2.7':
Issue #14761: Fix potential leak on an error case in the import machinery.
http://hg.python.org/cpython/rev/a775fc27f469

--
nosy: +python-dev

___
Python tracker 

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



[issue14762] ElementTree memory leak

2012-05-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +eli.bendersky, flox

___
Python tracker 

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



[issue7980] time.strptime not thread safe

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

For the record, issue9260 proposes to fix the issues with 
PyImport_ImportModuleNoBlock.

--
nosy: +pitrou

___
Python tracker 

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



[issue9751] _PyInstance_Lookup() defeats its purpose

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, I don't think there's any point in trying to fixing this now.

--
nosy: +pitrou

___
Python tracker 

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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-05-09 Thread Mark Dickinson

Mark Dickinson  added the comment:

Done.

--
Added file: http://bugs.python.org/file25508/random_jumpahead_5.patch

___
Python tracker 

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



[issue9751] _PyInstance_Lookup() defeats its purpose

2012-05-09 Thread Ezio Melotti

Ezio Melotti  added the comment:

I tracked this down a bit and this is what I found:
has_finalizer in Modules/gcmodule.c calls
return _PyInstance_Lookup(op, delstr) != NULL;
_PyInstance_Lookup in Modules/classobject.c calls
v = class_lookup(inst->in_class, name, &klass);
where inst is (PyInstanceObject *)op;
class_lookup in Modules/classobject.c eventually calls
PyObject *value = PyDict_GetItem(cp->cl_dict, name);
where cp is (PyClassObject *)inst->in_class
and since cp is not a valid pointer, cp->cl_dict results in the segfault after 
a few recursive calls of class_lookup.

Confirmed that this only affects 2.7.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue14762] ElementTree memory leak

2012-05-09 Thread Giuseppe Attardi

New submission from Giuseppe Attardi :

I confirm the presence of a serious memory leak in ElementTree, using the 
iterparse() function.
Memory grows disproportionately to dozens of GB when parsing a large XML file.

For further information, see discussion in:
  
http://www.gossamer-threads.com/lists/python/bugs/912164?do=post_view_threaded#912164
but notice that the comments attributing the problem to the OS are quite off 
the mark.

To replicate the problem, try this on a Wikipedia dump:

iterparse = ElementTree.iterparse(file)
id = None
for event, elem in iterparse:
if elem.tag.endswith("title"):
title = elem.text
elif elem.tag.endswith("id") and not id:
id = elem.text
elif elem.tag.endswith("text"):
   print id, title, elem.text[:20]

--
messages: 160266
nosy: Giuseppe.Attardi
priority: normal
severity: normal
status: open
title: ElementTree memory leak
type: resource usage
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



[issue14761] Memleak in import.c load_source_module()

2012-05-09 Thread Damien Cassou

Damien Cassou  added the comment:

@pitrou I just checked Python-2.7.3 and the tip of the mercurial repository. 
It's not in the latter at least.

--

___
Python tracker 

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



[issue14761] Memleak in import.c load_source_module()

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Is it 2.7-only?

--
nosy: +brett.cannon, ncoghlan, pitrou
stage:  -> patch review
type:  -> resource usage

___
Python tracker 

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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-05-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

In test_random, you should use assertLess so that the offending value is 
displayed on failure.

--

___
Python tracker 

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



[issue14761] Memleak in import.c load_source_module()

2012-05-09 Thread Damien Cassou

New submission from Damien Cassou :

In load_source_module() function from import.c, it looks like Py_DECREF is not 
called where it should be. Please find attached a patch that fixes the leak. 

This bug has been found using Coccinelle (http://coccinelle.lip6.fr/) using a 
semantic patch (similar to https://gist.github.com/2634899).

--
components: Interpreter Core
files: fix_load_source_module_leak.patch
keywords: patch
messages: 160262
nosy: benjamin.peterson, cassou, lemburg, tim_one
priority: normal
severity: normal
status: open
title: Memleak in import.c load_source_module()
versions: Python 2.7
Added file: http://bugs.python.org/file25507/fix_load_source_module_leak.patch

___
Python tracker 

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



[issue13210] Support Visual Studio 2010

2012-05-09 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

I concur with Martin.  It is much easier to tweak .vcproj and .props files and 
such after it has been committed, with lesser diffs to worry about.

(A more cautious version of me would have seen this go into a PCBuild10 folder 
first for a shakedown, with a later rename, but I keep that guy and his 
fearmongering quiet most of the time.)

--

___
Python tracker 

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



[issue1378] fromfd() and dup() for _socket on WIndows

2012-05-09 Thread Arthur Kantor

Arthur Kantor  added the comment:

Hi guys

It appears, that this patch was meant to go into both the 2.x and 3.x series, 
but it never made into 2.x  

Are there still plans to apply it to 2.7?

(apologies if I'm asking this in the wrong forum)

--
nosy: +Arthur.Kantor
versions: +Python 2.7 -Python 2.6

___
Python tracker 

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



[issue1439312] Patch for bug 1438185: os.renames deletes junction points

2012-05-09 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue14758] SMTPServer of smptd does not support binding to an IPv6 address

2012-05-09 Thread Hynek Schlawack

Changes by Hynek Schlawack :


--
nosy: +hynek

___
Python tracker 

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



[issue14653] Improve mktime_tz to use calendar.timegm instead of time.mktime

2012-05-09 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Here is a new patch using _PyUnicodeWriter directly in longobject.c.

It may be worth to do it in a separate issue?

decimal digits) is 17% faster with my patch version 2 compared to tip,
and 38% faster compared to Python 3.3 before my optimizations on str%
tuples or str.format(). Creating a temporary PyUnicode is not cheap, at
least for short strings.

Here is my benchmark script (attached) and the results:

Python 3.3 (vanilla):

1.65str(12345)
2.6 '{}'.format(12345)
2.69'A{}'.format(12345)
3.16'\x80{}'.format(12345)
3.23'\u0100{}'.format(12345)
3.32'\U0001{}'.format(12345)
4.6 '{:-10}'.format(12345)
4.89'A{:-10}'.format(12345)
5.53'\x80{:-10}'.format(12345)
5.71'\u0100{:-10}'.format(12345)
5.63'\U0001{:-10}'.format(12345)
4.6 '{:,}'.format(12345)
4.71'A{:,}'.format(12345)
5.28'\x80{:,}'.format(12345)
5.65'\u0100{:,}'.format(12345)
5.59'\U0001{:,}'.format(12345)

Python 3.3 + format_writer.patch:

1.72str(12345)
2.74'{}'.format(12345)
2.99'A{}'.format(12345)
3.4 '\x80{}'.format(12345)
3.52'\u0100{}'.format(12345)
3.51'\U0001{}'.format(12345)
4.24'{:-10}'.format(12345)
4.6 'A{:-10}'.format(12345)
5.16'\x80{:-10}'.format(12345)
6.87'\u0100{:-10}'.format(12345)
6.83'\U0001{:-10}'.format(12345)
4.12'{:,}'.format(12345)
4.6 'A{:,}'.format(12345)
5.09'\x80{:,}'.format(12345)
6.63'\u0100{:,}'.format(12345)
6.42'\U0001{:,}'.format(12345)

Python 3.3 + format_writer-2.patch: 

1.91str(12345)
2.44'{}'.format(12345)
2.61'A{}'.format(12345)
3.08'\x80{}'.format(12345)
3.31'\u0100{}'.format(12345)
3.13'\U0001{}'.format(12345)
4.57'{:-10}'.format(12345)
4.96'A{:-10}'.format(12345)
5.52'\x80{:-10}'.format(12345)
7.01'\u0100{:-10}'.format(12345)
7.34'\U0001{:-10}'.format(12345)
4.42'{:,}'.format(12345)
4.76'A{:,}'.format(12345)
5.16'\x80{:,}'.format(12345)
7.2 '\u0100{:,}'.format(12345)
6.74'\U0001{:,}'.format(12345)

As you can see, there is a regress, and sometimes it is not less than
improvement.

--
Added file: http://bugs.python.org/file25506/issue14744-bench-1.py

___
Python tracker 

___import timeit

def bench(stmt, msg=None, number=10):
if msg is None: msg = stmt
best = min(timeit.repeat(stmt, number=number))
print("%.3g\t%s" % (best * 1e6 / number, msg))

bench('str(12345)')
for s in ('', 'A', '\u0080', '\u0100', '\U0001'):
bench('%a.format(12345)' % (s + '{}',))
for s in ('', 'A', '\u0080', '\u0100', '\U0001'):
bench('%a.format(12345)' % (s + '{:-10}',))
for s in ('', 'A', '\u0080', '\u0100', '\U0001'):
bench('%a.format(12345)' % (s + '{:,}',))
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14760] logging: make setLevel() return handler itself for chained configuration

2012-05-09 Thread anatoly techtonik

anatoly techtonik  added the comment:

Well, there is argparse, but it doesn't support method chaining. Whatever, it 
is just a proposal. If consistency inside stdlib covers calling conventions for 
bundled user-level libs - I am fine with that.

--

___
Python tracker 

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



[issue14760] logging: make setLevel() return handler itself for chained configuration

2012-05-09 Thread anatoly techtonik

anatoly techtonik  added the comment:

s/can/can't/

--

___
Python tracker 

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



[issue14760] logging: make setLevel() return handler itself for chained configuration

2012-05-09 Thread anatoly techtonik

anatoly techtonik  added the comment:

Well, I can remember any other widely used high level objects from stdlib 
either. HTTP servers perhaps, but they are in a poor state.

--

___
Python tracker 

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



[issue14760] logging: make setLevel() return handler itself for chained configuration

2012-05-09 Thread Georg Brandl

Georg Brandl  added the comment:

Well, can you find any other setter method of a "high level object" in the 
stdlib that returns self?

--

___
Python tracker 

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



[issue14760] logging: make setLevel() return handler itself for chained configuration

2012-05-09 Thread anatoly techtonik

anatoly techtonik  added the comment:

List is a standard type and it have None returned for a reson. Logging is a 
library with its own semantic and high level object. Here you don't need to 
return None to explicitly say that the object was modified in place.

--

___
Python tracker 

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



[issue14760] logging: make setLevel() return handler itself for chained configuration

2012-05-09 Thread Georg Brandl

Georg Brandl  added the comment:

-1. Attribute setters or mutating methods returning self is not a common 
pattern in Python. See list.sort().

--
nosy: +georg.brandl

___
Python tracker 

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



[issue14742] test_tools very slow

2012-05-09 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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-05-09 Thread Mark Dickinson

Changes by Mark Dickinson :


--
stage:  -> commit review

___
Python tracker 

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



[issue14245] float rounding examples in FAQ are outdated

2012-05-09 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee: docs@python -> mark.dickinson

___
Python tracker 

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



[issue14760] logging: make setLevel() return handler itself for chained configuration

2012-05-09 Thread anatoly techtonik

New submission from anatoly techtonik :

It would be convenient if instead of:

hdlr = logging.StreamHandler()
hglr.setLevel(logging.DEBUG)
root.addHandler(hdlr)

it would be possible to write:

root.addHandler(logging.StreamHandler().setLevel(logging.DEBUG))

--
components: Library (Lib)
messages: 160252
nosy: techtonik
priority: normal
severity: normal
status: open
title: logging: make setLevel() return handler itself for chained configuration

___
Python tracker 

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