[issue14019] Unify tests for str.format and string.Formatter

2012-02-15 Thread Nick Coghlan

New submission from Nick Coghlan :

A couple of issues have arisen where features were added to str.format without 
similarly being added to string.Formatter.

This is only possible because the test cases for the two are currently almost 
entirely separate.

A common set of tests defined as (fmt, args, kwargs, output) tuples would help 
ensure that the implementations remained consistent in the future.

--
components: Tests
messages: 153392
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Unify tests for str.format and string.Formatter
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



[issue13579] string.Formatter doesn't understand the !a conversion specifier

2012-02-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

Agreed that this is a bug in string.Formatter rather than a new feature.

There's already a separate bug for the autonumbering problem: 
http://bugs.python.org/issue13598

And I created a new issue about unifying some of the tests: 
http://bugs.python.org/issue14019

%-style string formatting is its own thing - it doesn't share semantics or code 
with str.format or string.Formatter.

--

___
Python tracker 

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



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-02-15 Thread Jan Kratochvil

Jan Kratochvil  added the comment:

What more can be done to get it fixed?  I do not mind Python but GDB linking is 
broken due to it.  And while I can workaround it in GDB I am not used for 
workarounding one Free package in another Free package.  Free software has the 
advantage problems can be fixed at the right place.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-15 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Frankly, other short strings may give away even more, because you can
> put several into the same dict.

Please don't make such claims without some reasonable security analysis:
how *exactly* would you derive the hash seed when you have the hash
values of all 256 one-byte strings (or all 2**20 one-char Unicode
strings)?

> I would prefer that the randomization not kick in until strings are at
> least 8 characters, but I think excluding length 1 is a pretty obvious
> win.

-1. It is very easy to create a good number of hash collisions already
with 6-character strings. You are opening the security hole again that
we are attempting to close.

--

___
Python tracker 

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



[issue14001] CVE-2012-0845 Python v2.7.2 / v3.2.2 (SimpleXMLRPCServer): DoS (excessive CPU usage) by processing malformed XMLRPC / HTTP POST request

2012-02-15 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

As a security issue, it applies to 2.6 and 3.1 as well.

--
versions: +Python 2.6, Python 3.1

___
Python tracker 

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



[issue13598] string.Formatter doesn't support empty curly braces "{}"

2012-02-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

One potential problem with the simple approach to fixing this is that up until 
now, string.Formatter has been thread safe. Because all the formatting state 
was held in local variables and passed around as method arguments, there was no 
state on the instance object to protect.

Now, this only applies if you start using the new feature, but it should be 
noted in the documentation and What's New that you need to limit yourself to 
accessing each formatter instance from a single thread.

It's also enough for me to say "no, not in a maintenance release".

Adding two attributes also seems unnecessary, and the pre-increment looks 
strange. Why not:

In __init__:
auto_field_count = 0

Then as the auto numbering checking, something like:

auto_field_count = self.auto_field_count
if field_name:
if auto_field_count > 0:
   # Can't switch auto -> manual
auto_field_count = -1
elif auto_field_count < 0:
   # Can't switch manual -> auto
else:
field_name = str(auto_field_count)
self.auto_field_count += 1

(Alternatively, I'd ask the question: why do we prevent mixing manual numbering 
and explicit numbering anyway? It's not like it's ambiguous at all)

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



[issue13987] Handling of broken markup in HTMLParser on 2.7

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 11a31eb5da93 by Ezio Melotti in branch '2.7':
#13987: HTMLParser is now able to handle EOFs in the middle of a construct.
http://hg.python.org/cpython/rev/11a31eb5da93

--
nosy: +python-dev

___
Python tracker 

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



[issue13987] Handling of broken markup in HTMLParser on 2.7

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3d7904e3f4b9 by Ezio Melotti in branch '2.7':
#13987: HTMLParser is now able to handle malformed start tags.
http://hg.python.org/cpython/rev/3d7904e3f4b9

--

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2012-02-15 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue13987] Handling of broken markup in HTMLParser on 2.7

2012-02-15 Thread Ezio Melotti

Ezio Melotti  added the comment:

This should be fixed now.
The first two chunks of the attached patch have been committed in the two 
changesets linked in the previous messages.  The third chunk about the end tag 
has been fixed as part of #13933.  The error previously raised by unknown_decl 
has been removed in 4743a3a1e669.  More fixes have been backported as part of 
#13960.
2.7 should now behave like 3.2 non-strict.

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

___
Python tracker 

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



[issue14020] Improve HTMLParser doc

2012-02-15 Thread Ezio Melotti

New submission from Ezio Melotti :

Attached patch reworks a bit the HTMLParser doc:
 - moved the basic example on the top and showed the output;
 - added a more complete parser with other examples;
 - fixed some factual errors;
 - added additional information for some methods;
 - added a couple of headers to divide the sections;
 - rephrased the text a bit to be more coherent and clear;
 - fixed a few links, typos, and terms;

I think the note about IE condcoms could be removed by the handle_comment doc, 
since it's already in the examples at the bottom.  A note in handle_data about 
the behavior with buffered input might be added in addition to the example at 
the bottom.

--
assignee: ezio.melotti
components: Documentation
files: issue14020.diff
keywords: patch
messages: 153401
nosy: eli.bendersky, eric.araujo, ezio.melotti, terry.reedy
priority: normal
severity: normal
stage: commit review
status: open
title: Improve HTMLParser doc
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24523/issue14020.diff

___
Python tracker 

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



[issue7644] bug in nntplib.body() method with possible fix

2012-02-15 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

I have also added a test for NTTP.head(), enjoy.

--
keywords: +patch
Added file: http://bugs.python.org/file24524/nntp-file-test.diff

___
Python tracker 

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



[issue14015] surrogateescape largely missing from documentation

2012-02-15 Thread Éric Araujo

Changes by Éric Araujo :


--
versions:  -Python 3.1

___
Python tracker 

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



[issue14004] Distutils filelist selects too many files on Windows

2012-02-15 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

It's not that I forgot to set DISTUTILS_DEBUG, I simply did not set it. If the 
bug were still present, I would have seen a line indicating that 
.hg/last-message.txt was being copied.

For completeness, here's the output with the DEBUG setting:

PS C:\Users\jaraco\projects\public\keyring> $env:DISTUTILS_DEBUG=1
PS C:\Users\jaraco\projects\public\keyring> 
..\cpython\PCbuild\amd64\python.exe setup.py sdist 2> NULL | findstr hg
 adding .hg\last-message.txt
exclude_pattern: applying regex 
r'(^|/|\\)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)(/|\\).*'
 removing .hg\last-message.txt

--
Added file: http://bugs.python.org/file24525/smime.p7s

___
Python tracker 

___

smime.p7s
Description: S/MIME cryptographic signature
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14004] Distutils filelist selects too many files on Windows

2012-02-15 Thread Éric Araujo

Éric Araujo  added the comment:

So it looks like that even if the exclusion of .hg removes 
.hg/last-message.txt, it should not have been added in the first place, as the 
command was include and not recursive-include.

At first glance, Nadeem’s proposed fix is not right: paths in MANIFEST.in use 
'/', but then filelist produces paths using os.sep, so that the MANIFEST file 
and other operations done by the sdist command use native paths.  So even 
though the currently supported OSes all accept '/', I think the right thing is 
to use os.sep.

(About posixpath: It is always available and can be used e.g. to manipulate URI 
paths.)

--

___
Python tracker 

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



[issue12297] Clarifications to atexit.register and unregister doc

2012-02-15 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks.  I’ve also realized that the doc does not mention that any callable can 
be used; I don’t know if we should say it explicitly (I think I did a change 
like that recently in another file), or if we expect people to just know it 
from experience, or if we should add an entry for “function” in the glossary.

--

___
Python tracker 

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



[issue14020] Improve HTMLParser doc

2012-02-15 Thread Éric Araujo

Éric Araujo  added the comment:

Didn’t review in detail but the plan LGTM.

In a subsequent commit, you could update the markup to use nested class/method 
directives.

--

___
Python tracker 

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



[issue12297] Clarifications to atexit.register and unregister doc

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 55fc092dad72 by Éric Araujo in branch '3.2':
Improve doc for atexit.register and unregister (#12297)
http://hg.python.org/cpython/rev/55fc092dad72

New changeset f7163afecb97 by Éric Araujo in branch 'default':
Merge fixes for #1326113 and #12297 from 3.2
http://hg.python.org/cpython/rev/f7163afecb97

--
nosy: +python-dev

___
Python tracker 

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



[issue1326113] Letting "build_ext --libraries" take more than one lib

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 53df93a9c002 by Éric Araujo in branch '3.2':
Fix parsing of build_ext --libraries option (#1326113)
http://hg.python.org/cpython/rev/53df93a9c002

New changeset f7163afecb97 by Éric Araujo in branch 'default':
Merge fixes for #1326113 and #12297 from 3.2
http://hg.python.org/cpython/rev/f7163afecb97

--
nosy: +python-dev

___
Python tracker 

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



[issue1326113] Letting "build_ext --libraries" take more than one lib

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 96f5718bf005 by Éric Araujo in branch '2.7':
Fix parsing of build_ext --libraries option (#1326113)
http://hg.python.org/cpython/rev/96f5718bf005

--

___
Python tracker 

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



[issue12297] Clarifications to atexit.register and unregister doc

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a99632426af5 by Éric Araujo in branch '2.7':
Improve doc for atexit.register (#12297)
http://hg.python.org/cpython/rev/a99632426af5

--

___
Python tracker 

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



[issue1326113] Letting "build_ext --libraries" take more than one lib

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4ba43318e56b by Éric Araujo in branch 'default':
Fix parsing of packaging’s build_ext --libraries option (#1326113)
http://hg.python.org/cpython/rev/4ba43318e56b

--

___
Python tracker 

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



[issue1326113] Letting "build_ext --libraries" take more than one lib

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 60dd0041c9bc by Éric Araujo in branch 'default':
Fix parsing of build_ext --libraries option (#1326113)
http://hg.python.org/distutils2/rev/60dd0041c9bc

New changeset 158697fd8fa1 by Éric Araujo in branch 'python3':
Merge #1326113 fix from default
http://hg.python.org/distutils2/rev/158697fd8fa1

--

___
Python tracker 

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



[issue1326113] Letting "build_ext --libraries" take more than one lib

2012-02-15 Thread Éric Araujo

Éric Araujo  added the comment:

Here you are!  Thanks for the testing.

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



[issue12297] Clarifications to atexit.register and unregister doc

2012-02-15 Thread Éric Araujo

Éric Araujo  added the comment:

Closing as fixed, but if you have any feedback on my function vs. callable 
question, please share.

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

___
Python tracker 

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



[issue14021] Write pkg_info with local encoding(GBK) will be a problem.

2012-02-15 Thread 勇刚 罗

New submission from 勇刚 罗 :

D:\CI\bld\vcs\pygit2>python setup.py install
Find C:\Python32\python.exe
Using C:\Python32\python.exe
running install
running bdist_egg
running egg_info
writing pygit2.egg-info\PKG-INFO
Traceback (most recent call last):
  File "setup.py", line 106, in 
**kwargs)
  File "C:\Python32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
  File "C:\Python32\lib\distutils\dist.py", line 917, in run_commands
self.run_command(cmd)
  File "C:\Python32\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
  File 
"C:\Python32\lib\site-packages\distribute-0.6.24-py3.2.egg\setuptools\command\install.py",
 line 73, in run
self.do_egg_install()
  File 
"C:\Python32\lib\site-packages\distribute-0.6.24-py3.2.egg\setuptools\command\install.py",
 line 93, in do_egg_install
self.run_command('bdist_egg')
  File "C:\Python32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
  File "C:\Python32\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
  File 
"C:\Python32\lib\site-packages\distribute-0.6.24-py3.2.egg\setuptools\command\bdist_egg.py",
 line 172, in run
self.run_command("egg_info")
  File "C:\Python32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
  File "C:\Python32\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
  File 
"C:\Python32\lib\site-packages\distribute-0.6.24-py3.2.egg\setuptools\command\egg_info.py",
 line 172, in run
writer(self, ep.name, os.path.join(self.egg_info,ep.name))
  File 
"C:\Python32\lib\site-packages\distribute-0.6.24-py3.2.egg\setuptools\command\egg_info.py",
 line 384, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
  File "C:\Python32\lib\distutils\dist.py", line 1015, in write_pkg_info
self.write_pkg_file(pkg_info)
  File "C:\Python32\lib\distutils\dist.py", line 1031, in write_pkg_file
file.write('Author: %s\n' % self.get_contact() )
UnicodeEncodeError: 'gbk' codec can't encode character '\xf1' in position 20: 
illegal multibyte sequence

D:\CI\bld\vcs\pygit2>
It's better to use utf8 instead.

--
assignee: tarek
components: Distutils
messages: 153415
nosy: eric.araujo, tarek, 勇刚.罗
priority: normal
severity: normal
status: open
title: Write pkg_info with local encoding(GBK) will be a problem.
type: crash
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



[issue14021] Write pkg_info with local encoding(GBK) will be a problem.

2012-02-15 Thread Éric Araujo

Éric Araujo  added the comment:

Hi.  This code was changed to use UTF-8 as you recommend.  The next version of 
Python 3.2 should have the fix.  You can get this version from hg.python.org 
(see instructions in the devguide) and see if your problem is gone.  Thanks for 
the report anyway!

--
assignee: tarek -> eric.araujo
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> distutils: set encoding to utf-8 for input and output files
type: crash -> behavior

___
Python tracker 

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



[issue13913] utf-8 or utf8 or utf-8 (codec display name inconsistency)

2012-02-15 Thread Éric Araujo

Éric Araujo  added the comment:

You need to update test_pep3120: 
http://www.python.org/dev/buildbot/all/builders/AMD64%20Gentoo%20Wide%203.2/builds/910/steps/test/logs/stdio/text

--
nosy: +eric.araujo

___
Python tracker 

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



[issue1326113] Letting "build_ext --libraries" take more than one lib

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 77ac369fbbf1 by Éric Araujo in branch '3.2':
Fix test failure for shared builds caused by #1326113 fix
http://hg.python.org/cpython/rev/77ac369fbbf1

--

___
Python tracker 

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



[issue14022] bug in pkgutil.py with suggested fix

2012-02-15 Thread Don Caldwell

New submission from Don Caldwell :

in iter_modules there is a loop for fn in os.listdir(path): that can
fail on an OSError exception. here is a patch

try:
for fn in os.listdir(path):
subname = inspect.getmodulename(fn)
if subname=='__init__':
ispkg = True
break
else:
continue# not a package
except OSError as (errno, strerror):
print "%s: %s\n" % (fn, strerror)

--
components: Library (Lib)
messages: 153421
nosy: dfwc
priority: normal
severity: normal
status: open
title: bug in pkgutil.py with suggested fix
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



[issue1326113] Letting "build_ext --libraries" take more than one lib

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 98fb1c0fc7a0 by Éric Araujo in branch 'default':
Fix for packaging test failure on shared builds (#1326113)
http://hg.python.org/cpython/rev/98fb1c0fc7a0

--

___
Python tracker 

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



[issue1326113] Letting "build_ext --libraries" take more than one lib

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset db1c52aa4d2a by Éric Araujo in branch '2.7':
Fix test failure for shared builds caused by #1326113 fix
http://hg.python.org/cpython/rev/db1c52aa4d2a

--

___
Python tracker 

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



[issue14023] bytes implied to be mutable

2012-02-15 Thread Роман Донченко

New submission from Роман Донченко :

The language reference in section 5.2.2 states:

~
With the exception of bytes literals, these all correspond to immutable data 
types, <...>
~

But bytes objects are immutable as well.

--
assignee: docs@python
components: Documentation
messages: 153422
nosy: SpecLad, docs@python
priority: normal
severity: normal
status: open
title: bytes implied to be mutable
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2012-02-15 Thread Francisco Martín Brugué

Changes by Francisco Martín Brugué :


--
nosy: +francismb

___
Python tracker 

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



[issue7644] bug in nntplib.body() method with possible fix

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f1401d20bc6d by Antoine Pitrou in branch '3.2':
Issue #7644: Add tests for the file argument of NNTP.head() and NNTP.body().
http://hg.python.org/cpython/rev/f1401d20bc6d

New changeset 096b31e0f8ea by Antoine Pitrou in branch 'default':
Issue #7644: Add tests for the file argument of NNTP.head() and NNTP.body().
http://hg.python.org/cpython/rev/096b31e0f8ea

--
nosy: +python-dev

___
Python tracker 

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



[issue7644] bug in nntplib.body() method with possible fix

2012-02-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thank you! Closing now.

--
resolution:  -> fixed
stage: test needed -> 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



[issue14024] logging.Formatter Cache Prevents Exception Format Overriding

2012-02-15 Thread James Lekas

New submission from James Lekas :

logging.Formatter.format() creates a cache called exc_text with a copy of the 
traceback text which it uses for all log handlers (I think).  When this cache 
is set, format() does not call formatException to format the 
exception/traceback data.

Unfortunately, this means that one cannot override 
logging.Formatter.formatException() for a specific log Handler.  For example, 
to create a stripped-down exception message for emailing to a non-technical 
audience, one might create the derived class NoStaceTraceFormatter, and attach 
an instance to the SMTPHandler using setFormatter():

class NoStackTraceFormatter(logging.Formatter):
def formatException(self, exc_info):  # Don't emit the stack trace
return '\n'.join(traceback.format_exception_only(exc_info[0], 
exc_info[1])) # type and value only

At least when other handlers exist for the logger, the new formatException call 
will probably never be invoked. (This might depend on the order in which the 
handlers are called when an exception log message arrives: the first handler 
would define the exception text.)

One partial workaround is to override the logging.Formatter.format() method to 
defeat the cache, causing the overriding formatException to be called.

def format(self, record):
record.exc_text = None # Defeat the common cache so formatException 
will be called.
return logging.Formatter.format(self, record)

Unfortunately, this will create a new cached copy of the special-purpose 
exception text, possibly causing downstream handlers to emit the wrong message.

A possible solution would be to move the caching from 
logging.Formatter.format() to logging.Formatter.formatException, which would at 
least allow an individual handler to ignore the cache.  (However, all handlers 
would share the cache, possibly leading to trouble.)

The cache should probably be eliminated, as the premise on which it is based, 
"it's constant anyway", isn't strictly true.

--
components: Library (Lib)
messages: 153425
nosy: jimlekas
priority: normal
severity: normal
status: open
title: logging.Formatter Cache Prevents Exception Format Overriding
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



[issue13579] string.Formatter doesn't understand the !a conversion specifier

2012-02-15 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

I have updated the patch with the documentation changes proposed and also added 
a news entry (does a new entry has to be added in some order?).

Thank for the review in advance.

--
Added file: http://bugs.python.org/file24526/issue13579_a99632426af5.patch

___
Python tracker 

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



[issue14022] bug in pkgutil.py with suggested fix

2012-02-15 Thread Ned Deily

Ned Deily  added the comment:

This issue was recently fixed by the changes for Issue7367 and will be released 
in Python 2.7.3 and 3.2.3.  Python 2.6 no longer receives bug fixes, only 
security fixes.

--
nosy: +ned.deily
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed
superseder:  -> pkgutil.walk_packages fails on write-only directory in sys.path

___
Python tracker 

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



[issue14004] Distutils filelist selects too many files on Windows

2012-02-15 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> At first glance, Nadeem’s proposed fix is not right: paths in MANIFEST.in use 
> '/', but then filelist produces paths using os.sep, so that the MANIFEST file 
> and other operations done by the sdist command use native paths.  So even 
> though the currently supported OSes all accept '/', I think the right thing 
> is to use os.sep.

Yes, that sounds like a better solution. So the solution then is to fix
the regexps to use os.sep instead of "/" (and ensure that FileList uses
native paths throughout).

As an aside, it seems that the failing test from issue 13193 was
actually correct, and that the library itself was broken. I suppose all
of the tests will need to be changed to use native paths when this issue
is fixed.

--

___
Python tracker 

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



[issue13579] string.Formatter doesn't understand the !a conversion specifier

2012-02-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I just noticed two more minor errors that were and remain in "It takes a format 
string, and an arbitrary set of positional and keyword argument." Remove the 
comma and make 'argument' plural.

As near as I can tell, the two change block beginning with 
+In less formal terms,
+keyword.  If it's a number,
are strictly re-wrapping and no text changes. Correct?

Francisco - News entries are usually entered at the top of the section, just 
under the heading. But they are a bit tricky for multi-version patches because 
the context following is often different for different version. I have not 
decided which is easier -- resolving a merge conflict with a 3-way merge tool 
or separately editing Misc/NEWS for each version.

Eric, I near as I can tell, and given Nick's last response, this will be ready 
to commit with the two minor text changes and movement of the NEWS entry. 
Francisco is already in Misc/ACKS.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue13579] string.Formatter doesn't understand the !a conversion specifier

2012-02-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

However, I have not actually applied and run test_string.py.

--

___
Python tracker 

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



[issue14001] CVE-2012-0845 Python v2.7.2 / v3.2.2 (SimpleXMLRPCServer): DoS (excessive CPU usage) by processing malformed XMLRPC / HTTP POST request

2012-02-15 Thread Charles-François Natali

Charles-François Natali  added the comment:

The test fails on 2.6 and 2.7, because of a EPIPE, which is normal in
this case (well, at least expected):
"""
test_partial_post (test.test_xmlrpc.SimpleServerTestCase) ...

Exception happened during processing of request from ('127.0.0.1', 47844)
Traceback (most recent call last):
  File "/home/cf/python/cpython/Lib/SocketServer.py", line 283, in
_handle_request_noblock
self.process_request(request, client_address)
  File "/home/cf/python/cpython/Lib/SocketServer.py", line 309, in
process_request
self.finish_request(request, client_address)
  File "/home/cf/python/cpython/Lib/SocketServer.py", line 322, in
finish_request
self.RequestHandlerClass(request, client_address, self)
  File "/home/cf/python/cpython/Lib/SocketServer.py", line 617, in __init__
self.handle()
  File "/home/cf/python/cpython/Lib/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
  File "/home/cf/python/cpython/Lib/BaseHTTPServer.py", line 323, in
handle_one_request
method()
  File "/home/cf/python/cpython/Lib/SimpleXMLRPCServer.py", line 490, in do_POST
self.send_response(200)
  File "/home/cf/python/cpython/Lib/BaseHTTPServer.py", line 384, in
send_response
self.send_header('Server', self.version_string())
  File "/home/cf/python/cpython/Lib/BaseHTTPServer.py", line 390, in send_header
self.wfile.write("%s: %s\r\n" % (keyword, value))
  File "/home/cf/python/cpython/Lib/socket.py", line 318, in write
self.flush()
  File "/home/cf/python/cpython/Lib/socket.py", line 297, in flush
self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe
"""

What should I do? Remove the test?

--

___
Python tracker 

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



[issue13491] Fixes for sqlite3 doc

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9eb77d455be1 by Petri Lehtinen in branch '3.2':
Issue #13491: Fix many errors in sqlite3 documentation
http://hg.python.org/cpython/rev/9eb77d455be1

New changeset ba5b337ecc27 by Petri Lehtinen in branch 'default':
Merge branch '3.2'
http://hg.python.org/cpython/rev/ba5b337ecc27

--
nosy: +python-dev

___
Python tracker 

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



[issue13491] Fixes for sqlite3 doc

2012-02-15 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Éric: You can make a patch for 2.7 if you want to, I left the issue open.

--

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2012-02-15 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue14025] unittest.TestCase.assertEqual does not show diff when comparing str with unicode

2012-02-15 Thread Jaap Karssenberg

New submission from Jaap Karssenberg :

When you compare two multiline strings with unittest.TestCase.assertEqual it is 
supposed to dispatch to assertMultiLineEqual and show a diff when the strings 
differ.

However this only works for two string of the same type (str or unicode). But 
mixing the two will just give the default message that they differ without the 
diff. THis is due to the way the dispatch checks types. Probably need to make 
an exception for comparing str with unicode.

Note that if the contents of both strings are the same, the assert will regard 
them equal, so it is not a strict check on the type perse.

--
components: Library (Lib)
messages: 153434
nosy: jaap.karssenberg
priority: normal
severity: normal
status: open
title: unittest.TestCase.assertEqual does not show diff when comparing str with 
unicode
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



[issue14025] unittest.TestCase.assertEqual does not show diff when comparing str with unicode

2012-02-15 Thread R. David Murray

R. David Murray  added the comment:

The latter is arguably a bug.  The former is working as designed, as far as I 
know.  In Python3 bytes and string do not compare equal.

--
nosy: +michael.foord, r.david.murray

___
Python tracker 

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



[issue14025] unittest.TestCase.assertEqual does not show diff when comparing str with unicode

2012-02-15 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue13849] Add tests for NUL checking in certain strs

2012-02-15 Thread STINNER Victor

STINNER Victor  added the comment:

See also issue #13617.

--
nosy: +haypo

___
Python tracker 

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



[issue13913] utf-8 or utf8 or utf-8 (codec display name inconsistency)

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 5b8f146103fa by Victor Stinner in branch '3.2':
Issue #13913: Fix test_pep3120 for the UTF-8 codec name
http://hg.python.org/cpython/rev/5b8f146103fa

New changeset 170a224ce01e by Victor Stinner in branch 'default':
(Merge 3.2) Issue #13913: Fix test_pep3120 for the UTF-8 codec name
http://hg.python.org/cpython/rev/170a224ce01e

--

___
Python tracker 

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



[issue13014] _ssl.c: refleak

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f3a4c2b34973 by Antoine Pitrou in branch '3.2':
Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
http://hg.python.org/cpython/rev/f3a4c2b34973

New changeset 9ab501b3e22d by Antoine Pitrou in branch 'default':
Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
http://hg.python.org/cpython/rev/9ab501b3e22d

New changeset 111dcae41ff7 by Antoine Pitrou in branch '2.7':
Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
http://hg.python.org/cpython/rev/111dcae41ff7

--
nosy: +python-dev

___
Python tracker 

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



[issue13014] _ssl.c: refleak

2012-02-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've fixed the actual leak. Thanks!

--
nosy: +pitrou
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
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



[issue14025] unittest.TestCase.assertEqual does not show diff when comparing str with unicode

2012-02-15 Thread R. David Murray

R. David Murray  added the comment:

In case it isn't clear, by "arguably a bug" I mean in a theoretical sense.  
Even if Michael agrees with me we can't change the fact that 2.7 unittest 
treats str and unicode with the same content as equal.

For the other it might have been a backport-from-3.x oversight, or it might 
have been intentional.

--

___
Python tracker 

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



[issue13817] deadlock in subprocess while running several threads using Popen

2012-02-15 Thread Doug Hellmann

Changes by Doug Hellmann :


--
nosy: +doughellmann

___
Python tracker 

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



[issue13090] test_multiprocessing: memory leaks

2012-02-15 Thread Stefan Krah

Stefan Krah  added the comment:

Yes, the leak does not seem to be in posix_read() itself. Sadly
enough, the number of leaks in test_multiprocessing has grown to
five in e9d01c5c92ed (the four additional ones were definitely not
present when I reported this).


==3047== 32 bytes in 1 blocks are definitely lost in loss record 340 of 6,704
==3047==at 0x4C27878: malloc (vg_replace_malloc.c:236)
==3047==by 0x4D5C35: PyThread_allocate_lock (thread_pthread.h:280)
==3047==by 0x4A817C: _PyImport_AcquireLock (import.c:292)
==3047==by 0x4ADE7A: PyImport_ImportModuleLevelObject (import.c:2903)
==3047==by 0x4ADF64: PyImport_ImportModuleLevel (import.c:2922)
==3047==by 0x4AF8BB: PyImport_Import (import.c:3510)
==3047==by 0x4AD8AF: PyImport_ImportModule (import.c:2728)
==3047==by 0x5567E9: _PyExc_Init (exceptions.c:2345)
==3047==by 0x4BBA8F: Py_InitializeEx (pythonrun.c:277)
==3047==by 0x4BBCA8: Py_Initialize (pythonrun.c:341)
==3047==by 0x4D875C: Py_Main (main.c:595)
==3047==by 0x41ABFF: main (python.c:63)
==3047== 


==3047== 37 bytes in 1 blocks are definitely lost in loss record 390 of 6,704
==3047==at 0x4C27878: malloc (vg_replace_malloc.c:236)
==3047==by 0x53F997: PyBytes_FromStringAndSize (bytesobject.c:98)
==3047==by 0x4E5AB8: posix_read (posixmodule.c:7010)
==3047==by 0x57B4AD: PyCFunction_Call (methodobject.c:81)
==3047==by 0x490397: call_function (ceval.c:4051)
==3047==by 0x48B826: PyEval_EvalFrameEx (ceval.c:2674)
==3047==by 0x48E509: PyEval_EvalCodeEx (ceval.c:3426)
==3047==by 0x4908D7: fast_function (ceval.c:4149)
==3047==by 0x4904EA: call_function (ceval.c:4072)
==3047==by 0x48B826: PyEval_EvalFrameEx (ceval.c:2674)
==3047==by 0x48E509: PyEval_EvalCodeEx (ceval.c:3426)
==3047==by 0x4908D7: fast_function (ceval.c:4149)
==3047== 


==3047== 72 bytes in 1 blocks are definitely lost in loss record 2,859 of 6,704
==3047==at 0x4C27878: malloc (vg_replace_malloc.c:236)
==3047==by 0x4DA93E: _PyObject_GC_Malloc (gcmodule.c:1455)
==3047==by 0x4DAA5A: _PyObject_GC_NewVar (gcmodule.c:1487)
==3047==by 0x427A77: PyTuple_New (tupleobject.c:91)
==3047==by 0x427F3A: PyTuple_Pack (tupleobject.c:195)
==3047==by 0x494607: compiler_add_o (compile.c:1024)
==3047==by 0x4947EA: compiler_addop_o (compile.c:1056)
==3047==by 0x49B1BB: compiler_visit_expr (compile.c:3341)
==3047==by 0x49AEBB: compiler_visit_expr (compile.c:3293)
==3047==by 0x498B3A: compiler_visit_stmt (compile.c:2411)
==3047==by 0x494B32: compiler_body (compile.c:1247)
==3047==by 0x494C33: compiler_mod (compile.c:1267)


==3047== 120 bytes in 3 blocks are definitely lost in loss record 3,649 of 6,704
==3047==at 0x4C27878: malloc (vg_replace_malloc.c:236)
==3047==by 0x4DC686: thread_PyThread_start_new_thread (_threadmodule.c:1052)
==3047==by 0x57B4AD: PyCFunction_Call (methodobject.c:81)
==3047==by 0x490397: call_function (ceval.c:4051)
==3047==by 0x48B826: PyEval_EvalFrameEx (ceval.c:2674)
==3047==by 0x4907CB: fast_function (ceval.c:4139)
==3047==by 0x4904EA: call_function (ceval.c:4072)
==3047==by 0x48B826: PyEval_EvalFrameEx (ceval.c:2674)
==3047==by 0x48E509: PyEval_EvalCodeEx (ceval.c:3426)
==3047==by 0x56263C: function_call (funcobject.c:669)
==3047==by 0x532B87: PyObject_Call (abstract.c:2150)
==3047==by 0x549EF6: method_call (classobject.c:320)


==3047== 120 bytes in 3 blocks are definitely lost in loss record 3,650 of 6,704
==3047==at 0x4C27878: malloc (vg_replace_malloc.c:236)
==3047==by 0x4DC686: thread_PyThread_start_new_thread (_threadmodule.c:1052)
==3047==by 0x57B4AD: PyCFunction_Call (methodobject.c:81)
==3047==by 0x490397: call_function (ceval.c:4051)
==3047==by 0x48B826: PyEval_EvalFrameEx (ceval.c:2674)
==3047==by 0x4907CB: fast_function (ceval.c:4139)
==3047==by 0x4904EA: call_function (ceval.c:4072)
==3047==by 0x48B826: PyEval_EvalFrameEx (ceval.c:2674)
==3047==by 0x48E509: PyEval_EvalCodeEx (ceval.c:3426)
==3047==by 0x4908D7: fast_function (ceval.c:4149)
==3047==by 0x4904EA: call_function (ceval.c:4072)
==3047==by 0x48B826: PyEval_EvalFrameEx (ceval.c:2674)

--
title: posix_read: memory leak -> test_multiprocessing: memory leaks

___
Python tracker 

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



[issue13090] test_multiprocessing: memory leaks

2012-02-15 Thread Stefan Krah

Stefan Krah  added the comment:

Stefan Krah  wrote:
> enough, the number of leaks in test_multiprocessing has grown to
> five in e9d01c5c92ed (the four additional ones were definitely not

To be sure, e9d01c5c92ed is completely innocent. I just tested
with that revision. :)

--

___
Python tracker 

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



[issue13090] test_multiprocessing: memory leaks

2012-02-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The first one seems to be the import lock. Two others seem to be the internal 
"bootstate" structure used to run thread objects (daemon threads?).

Perhaps you could try to find whether a single test is responsible.

--
nosy: +neologix

___
Python tracker 

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



[issue11836] multiprocessing.queues.SimpleQueue is undocumented

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3b127a415643 by Sandro Tosi in branch '2.7':
Issue #11836: document multiprocessing.queues.SimpleQueue
http://hg.python.org/cpython/rev/3b127a415643

New changeset fe5eb6d35025 by Sandro Tosi in branch '3.2':
Issue #11836: document multiprocessing.queues.SimpleQueue
http://hg.python.org/cpython/rev/fe5eb6d35025

New changeset bf536b46d7f2 by Sandro Tosi in branch 'default':
Issue #11836: document and expose multiprocessing.SimpleQueue
http://hg.python.org/cpython/rev/bf536b46d7f2

--
nosy: +python-dev

___
Python tracker 

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



[issue11836] multiprocessing.queues.SimpleQueue is undocumented

2012-02-15 Thread Sandro Tosi

Sandro Tosi  added the comment:

Thanks for all you inputs!

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

___
Python tracker 

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



[issue13913] utf-8 or utf8 or utf-8 (codec display name inconsistency)

2012-02-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 824ddf6a30f2 by Victor Stinner in branch '3.2':
Issue #13913: Another fix test_pep3120 for the UTF-8 codec name
http://hg.python.org/cpython/rev/824ddf6a30f2

New changeset 2cfba214c243 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #13913: Another fix test_pep3120 for the UTF-8 codec name
http://hg.python.org/cpython/rev/2cfba214c243

--

___
Python tracker 

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



[issue7652] Merge C version of decimal into py3k.

2012-02-15 Thread STINNER Victor

STINNER Victor  added the comment:

I tried my timestamp patch with _decimal: it fails because decimal and _decimal 
API is not exactly the same.

decimal.Decimal.__truediv__() has an optional context argument, whereas 
_decimal defines PyNumberMethods.

decimal.Decimal.quantize() second argument is optional and its default value is 
None, but if I pass None to _decimal.Decimal.quantize(), I get a TypeError 
because _decimal expects an integer.

--

___
Python tracker 

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



[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-15 Thread Nick Coghlan

New submission from Nick Coghlan :

Currently, test_cmd_line_script only checks sys.argv[0] is set correctly.

It should pass some extra values after the script name, then include an 
appropriate check in the output of the launched script.

--
components: Tests
keywords: easy
messages: 153448
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: test_cmd_line_script should include more sys.argv checks
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



[issue14025] unittest.TestCase.assertEqual does not show diff when comparing str with unicode

2012-02-15 Thread Michael Foord

Michael Foord  added the comment:

assertEqual uses Python equality semantics - so if a str instance and a unicode 
instance compare equal then assertEqual passes. This is by design.

The type check in assertEqual, that delegates to the different comparison 
methods, is strict because we can't know that using the error message 
algorithms is sane for arbitrary subclasses - all we can know is whether an 
equality comparison fails or succeeds.

Using a diff algorithm for creating an error message only makes sense for text, 
which is why it is only done for unicode. For binary strings a diff is more 
likely to be unintelligible nonsense.  

For comparing unicode to strings you can call asssertMultilineEqual directly.

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



[issue7897] Support parametrized tests in unittest

2012-02-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

I just remembered that many of the urllib.urlparse tests are guilty of only 
reporting the first case that fails, instead of testing everything and 
reporting all failures:

http://hg.python.org/cpython/file/default/Lib/test/test_urlparse.py

IMO, it would make a good guinea pig for any upgrade to the stdlib support for 
parameterised unit tests.

--

___
Python tracker 

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



[issue8604] Adding an atomic FS write API

2012-02-15 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I'm opposed to adding "atomic" files to the standard library. This has nothing 
to do with the original issue; anybody contributing to the issue is making up 
user needs that have not been sufficiently demonstrated.

It would be best to release such code on PyPI first, and wait a few years to 
see whether there really is an end-user demand for the feature.

--
nosy: +loewis

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2012-02-15 Thread Michael Foord

Michael Foord  added the comment:

FWIW I think nose2 is going to have "test load time" parameterized tests rather 
than "run time" parameterized tests, which is what I think we should do for 
unit test. The API should be as simple as possible for basic cases, but 
suitable for more complex cases too.

I quite liked Nicks idea of allowing a custom "case builder" but providing a 
sane default one.

--

___
Python tracker 

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



[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-15 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
stage:  -> test needed
type:  -> enhancement
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



[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-02-15 Thread Eli Bendersky

Eli Bendersky  added the comment:

Emitting a deprecation warning on importing cElementTree has been rejected in 
the pydev list. The other remaining tasks have new issues on them, so this 
issue is done now.

--

___
Python tracker 

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



[issue14009] Clearer documentation for cElementTree

2012-02-15 Thread Eli Bendersky

Eli Bendersky  added the comment:

Éric, indeed it clarifies the usage, but my concern is that it also moves the 
first mention of the module further down.

There's no real reason for someone using CPython 2.7 or 3.2 *not* to use cET. 
So, some mention should appear in the opening paragraph. I'm attaching a patch 
that shows one possibility (based on your patch). It was generated vs. branch 
2.7

--
Added file: http://bugs.python.org/file24527/issue14009.doc_cET.1.patch

___
Python tracker 

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



[issue14009] Clearer documentation for cElementTree

2012-02-15 Thread Eli Bendersky

Eli Bendersky  added the comment:

Also, I must add that I absolutely hate the opening paragraph of the 
documentation in this module. Once 14006 is implemented, parts of it should be 
backported to 2.7 and 3.2

That would be an orthogonal change to what we're discussion here, though

--

___
Python tracker 

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



[issue14023] bytes implied to be mutable

2012-02-15 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy: +eli.bendersky

___
Python tracker 

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



[issue14009] Clearer documentation for cElementTree

2012-02-15 Thread Éric Araujo

Éric Araujo  added the comment:

+1.  Barring other feedback, I will commit your patch.

> Also, I must add that I absolutely hate the opening paragraph of the
> documentation in this module.

This:

  The :class:`Element` type is a flexible container object, designed to store
  hierarchical data structures in memory.  The type can be described as a cross
  between a list and a dictionary.

?  Yeah, it’s not quite good.

--

___
Python tracker 

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



[issue14009] Clearer documentation for cElementTree

2012-02-15 Thread Eli Bendersky

Eli Bendersky  added the comment:

If you want to collect additional feedback, you may want to add some other 
people to the Nosy list :-) Alternatively, since it's a small doc change you 
can just commit it and it can be fixed later if someone strongly objects.

>>>
This:

  The :class:`Element` type is a flexible container object, designed to store
  hierarchical data structures in memory.  The type can be described as a cross
  between a list and a dictionary.

?  Yeah, it’s not quite good.
>>>

Yes. You read the first section of a module's doc and you have *no idea* what 
the module is and how to use it. I plant to work on this for 3.3 in the context 
of issue 14006.

--

___
Python tracker 

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



[issue13089] parsetok.c: memory leak

2012-02-15 Thread Meador Inge

Meador Inge  added the comment:

Stefan, how did you reproduce this?  I tried:

1. Uncommenting '#define Py_USING_MEMORY_DEBUGGER' in 
   'Objects/obmalloc.c'.
2. Configuring with './configure --without-pymalloc'.
3. Running 'valgrind --tool=memcheck --log-file=leaks.txt
   --leak-check=full --suppressions=Misc/valgrind-python.supp
   ./python -m test test_mailbox'.

When performing the above I only see leaks in import:

==2683== 256 bytes in 1 blocks are definitely lost in loss record 3,234 of 4,881
==2683==at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==2683==by 0xD0753A1: PyInit_atexit (atexitmodule.c:294)
==2683==by 0x49AE0B: _PyImport_LoadDynamicModule (importdl.c:85)
==2683==by 0x498740: import_submodule (import.c:3338)
==2683==by 0x4989CA: load_next (import.c:3149)
==2683==by 0x499005: import_module_level.isra.10 (import.c:2842)
==2683==by 0x499759: PyImport_ImportModuleLevelObject (import.c:2904)
==2683==by 0x4729EA: builtin___import__ (bltinmodule.c:195)
==2683==by 0x5064E9: PyObject_Call (abstract.c:2150)
==2683==by 0x473E3E: PyEval_CallObjectWithKeywords.constprop.8 
(ceval.c:3931)
==2683==by 0x477D83: PyEval_EvalFrameEx (ceval.c:2332)
==2683==by 0x4752FB: PyEval_EvalCodeEx (ceval.c:3426)

--

___
Python tracker 

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



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-02-15 Thread Meador Inge

Meador Inge  added the comment:

When I try to build with the attached patch on the 2.7 branch many (if not all) 
of the modules fail to build:

Failed to build these modules:
_bisect_bsddb _codecs_cn  
_codecs_hk _codecs_iso2022_codecs_jp  
_codecs_kr _codecs_tw _collections
_csv   _ctypes_ctypes_test
_curses_curses_panel  _elementtree
_functools _hashlib   _heapq  
_hotshot   _io_json   
_locale_lsprof_multibytecodec 
_multiprocessing   _random_socket 
_sqlite3   _ssl   _struct 
_testcapi  _tkinter   array   
audioopbinascii   bz2 
cmath  cPicklecrypt   
cStringIO  datetime   dbm 
fcntl  future_builtinsgdbm
grpitertools  linuxaudiodev   
math   mmap   nis 
operator   ossaudiodevparser  
pyexpatreadline   resource
select spwd   strop   
syslog termiostime
unicodedatazlib   

I see several warnings in the build output:

*** WARNING: renaming "_codecs_iso2022" since importing it failed: build/lib.lin
ux-x86_64-2.7/_codecs_iso2022.so: undefined symbol: PyExc_ValueError
..
*** WARNING: renaming "linuxaudiodev" since importing it failed: build/lib.linux
-x86_64-2.7/linuxaudiodev.so: undefined symbol: Py_Py3kWarningFlag
...
*** WARNING: renaming "_tkinter" since importing it failed: 
build/lib.linux-x86_64-2.7/_tkinter.so: undefined symbol: _Py_ZeroStruct

--
components: +Build -Library (Lib)
stage:  -> patch review

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-02-15 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue13977] importlib simplification

2012-02-15 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue13970] frameobject should not have f_yieldfrom attribute

2012-02-15 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2012-02-15 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue14027] distutils2 lack of pysetup.bat

2012-02-15 Thread 勇刚 罗

New submission from 勇刚 罗 :

Patch attaced.

--
assignee: tarek
components: Distutils2
files: pysetup.bat
messages: 153460
nosy: alexis, eric.araujo, tarek, 勇刚.罗
priority: normal
severity: normal
status: open
title: distutils2 lack of pysetup.bat
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24528/pysetup.bat

___
Python tracker 

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



[issue6210] Exception Chaining missing method for suppressing context

2012-02-15 Thread Ethan Furman

Ethan Furman  added the comment:

> Remaining problems:
> - default sys.excepthook implementation currently does the wrong thing

Unable to duplicate on my system (Win XP SP3)

> - needs a test for the pythonrun display logic (test_cmd_line_script
>   would be the appropriate place)

Not sure I understand this point, but I added a test in test_raise that starts 
a subprocess interpreter and checks its output.

> - testCauseSyntax test should probably be in test_raise, not
>   test_exceptions

Moved.

--
Added file: http://bugs.python.org/file24529/pep409.diff

___
Python tracker 

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



[issue13972] set and frozenset constructors don't accept multiple iterables

2012-02-15 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Ok, closing because of lack of support for the idea.

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



[issue13922] argparse handling multiple "--" in args improperly

2012-02-15 Thread Warren Turkal

Warren Turkal  added the comment:

Using argparse.REMAINDER will not help for my problem in my real program as the 
first arg needs to be handled by my program and mapped into the real binary 
name.

If I recall correctly from memory, the following is what happened when I tried 
using argparse.REMAINDER. If call my program like so:
$ hack run :target --help

The subcommand will be "run" in this case. Because :target is handled by 
argparse, the "--help" will not be seen as part of the remainder of the 
arguments, and I will get the help for the "hack run" subcommand instead of the 
target binary getting the --help argument. I have pushed most of the program to 
[1] if you want to take a look. Specifically, see cli/commands/run.py:do_run 
for that bit of code that handles the run subcommand.

[1]https://github.com/wt/repo-digg-dev-hackbuilder

--

___
Python tracker 

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



[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-15 Thread Gregory P. Smith

New submission from Gregory P. Smith :

Using a 32-bit Python 2.6.5 on a Linux system at work we observed the following:

  File "/.../lib/python2.6/tempfile.py", line 349, in mktemp
name = names.next()
  File "/.../lib/python2.6/tempfile.py", line 134, in next
letters = [choose(c) for dummy in "123456"]
  File "/.../lib/python2.6/random.py", line 261, in choice
return seq[int(self.random() * len(seq))]  # raises IndexError if seq is 
empty
ValueError: cannot convert float NaN to integer

This is rare and hard to reproduce.  The hardware appears to be healthy and 
this was on a server with ECC.


Some searching reveals that other people have hit this in random.choice in 
Python 2.7 as well:  
https://bugs.launchpad.net/ubuntu/+source/desktopcouch/+bug/886159

The ubuntu developer seems to think this is related to time.time() returning 
NaN at some point (I haven't looked into that myself).

--
messages: 153464
nosy: gregory.p.smith, tim_one
priority: normal
severity: normal
status: open
title: random.choice hits ValueError: cannot convert float NaN to integer
versions: Python 2.6, Python 2.7, Python 3.1, 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