[issue19427] enhancement: dictionary maths

2013-10-29 Thread R. David Murray

R. David Murray added the comment:

In the meantime the issue should be closed.  It can be reopened if consensus is 
reached.

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

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



[issue19427] enhancement: dictionary maths

2013-10-29 Thread Georg Brandl

Georg Brandl added the comment:

This specialized use case has no chance of being added to the very general dict 
object.

But have a look at the collections.Counter class which does exactly what you 
propose for positive values and the +/- operations.

--
nosy: +georg.brandl

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



[issue19428] marshal: error cases are not documented

2013-10-29 Thread Georg Brandl

Georg Brandl added the comment:

Is this backportable?

--
nosy: +georg.brandl

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



[issue19416] NNTP page has incorrect links

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b2352f1d365 by Georg Brandl in branch '2.7':
Closes #19416: fix references in the nntplib docs.
http://hg.python.org/cpython/rev/6b2352f1d365

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue19416] NNTP page has incorrect links

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 03fa1b0af343 by Georg Brandl in branch '3.3':
Closes #19416: fix references in the nntplib docs.
http://hg.python.org/cpython/rev/03fa1b0af343

--

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



[issue19426] Opening a file in IDLE causes a crash or hang

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7fde94ad5df4 by Serhiy Storchaka in branch '2.7':
Issue #19426: Fixed the opening of Python source file with specified encoding.
http://hg.python.org/cpython/rev/7fde94ad5df4

--
nosy: +python-dev

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



[issue19426] Opening a file in IDLE causes a crash or hang

2013-10-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Ned. Definitely IDLE needs more unit tests.

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

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



[issue17936] O(n**2) behaviour when adding/removing classes

2013-10-29 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Just updating for recent changes, right?
LGTM.  Shouldn't this just get committed?

--

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



[issue19430] argparse replaces \$ to is passed

2013-10-29 Thread telmich

New submission from telmich:

When using argparse and the string \$ occurs on the commandline, it is 
converted to $. This as definitely wrong and renders argparse useless, if the 
input needs to be trusted (i.e. defitinely the same as given into it)'

Example code:

import sys 
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('test', nargs='*')
result = parser.parse_args(sys.argv[1:])

print(args = %s %  .join(sys.argv))
print(result = %s % result)

Reproduce problem:

[10:41] bento:~% python3 argparse-test.py ps1  PS1='[\t] 
\[\033[1m\]\h\[\033[0m\]:\w\$ '
] \[\]\h\[\]:\w\$ 'args = argparse-test.py ps1 PS1='[\t] 
\[\033[1m\]\h\[\033[0m\]:\w$ '
result = Namespace(test=['ps1', PS1='[\\t] 
\\[\\033[1m\\]\\h\\[\\033[0m\\]:\\w$ '])

[10:40] bento:cdist% python --version
Python 3.3.2

--
components: Library (Lib)
messages: 201614
nosy: telmich
priority: normal
severity: normal
status: open
title: argparse replaces  \$ to is passed
type: behavior
versions: Python 3.3

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



[issue19430] argparse replaces \$ with $ (if in commandline)

2013-10-29 Thread telmich

Changes by telmich nico-bugs.python@schottelius.org:


--
title: argparse replaces  \$ to is passed - argparse replaces \$ with $ (if in 
commandline)

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



[issue17936] O(n**2) behaviour when adding/removing classes

2013-10-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I see I haven't addressed your previous comment about PyErr_Clear(), I should 
probably address it before anything gets committed.

--

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



[issue19430] argparse replaces \$ with $ (if in commandline)

2013-10-29 Thread telmich

telmich added the comment:

Background information:

cdist is written in python 3 and makes heavy use of argparse.
One common task is to run a cdist type with some arguments, which
in the end configure a remote system.

We triggered the bug by running

__line ps1 --file /etc/bash.bashrc --line PS1='[\t] 
\[\033[1m\]\h\[\033[0m\]:\w\$ '

which should have ensured that the line is found in /etc/bash.bashrc.

But in reality we found

PS1='[\t] \[\033[1m\]\h\[\033[0m\]:\w$ '

instead of

PS1='[\t] \[\033[1m\]\h\[\033[0m\]:\w\$ '

This is a rather nasty bug, as you would not suspect argparse doing that and 
dig through all your code looking for errors.

--

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



[issue19430] argparse replaces \$ with $ (if in commandline)

2013-10-29 Thread Ezio Melotti

Ezio Melotti added the comment:

I don't think this is related to argparse:
$ echo 'import sys; print(sys.argv)'  issue19430.py
$ python issue19430.py ps1 --file /etc/bash.bashrc --line PS1='[\t] 
\[\033[1m\]\h\[\033[0m\]:\w\$ '
['issue19430.py', 'ps1', '--file', '/etc/bash.bashrc', '--line', PS1='[\\t] 
\\[\\033[1m\\]\\h\\[\\033[0m\\]:\\w$ ']
$ python issue19430.py \$
['issue19430.py', '$']
$ python issue19430.py '\$'
['issue19430.py', '\\$']

--
nosy: +ezio.melotti

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



[issue19431] Document PyFrame_FastToLocals() and PyFrame_FastToLocalsWithError()

2013-10-29 Thread STINNER Victor

New submission from STINNER Victor:

(Copy of an email) Georg Brandl via python.org 

Am 29.10.2013 01:19, schrieb victor.stinner:
 http://hg.python.org/cpython/rev/4ef4578db38a
 changeset:   86715:4ef4578db38a
 user:Victor Stinner victor.stin...@gmail.com
 date:Tue Oct 29 01:19:37 2013 +0100
 summary:
   Issue #18408: Add a new PyFrame_FastToLocalsWithError() function to handle
 exceptions when merging fast locals into f_locals of a frame.
 PyEval_GetLocals() now raises an exception and return NULL on failure.

You'll have to either make this private or document it.

--
assignee: docs@python
components: Documentation
messages: 201618
nosy: docs@python, georg.brandl, haypo, pitrou
priority: normal
severity: normal
status: open
title: Document PyFrame_FastToLocals() and PyFrame_FastToLocalsWithError()
versions: Python 3.3, Python 3.4

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



[issue19413] Reload semantics changed unexpectedly in Python 3.3

2013-10-29 Thread Nick Coghlan

Nick Coghlan added the comment:

Patch mostly looks good to me, but there should be a second test ensuring that 
the loader attribute gets *replaced*, even if it is already set to something 
else.

A similar test structure to the existing one should work, but replacing the 
del types.__loader__ with:

expected_loader_type = type(types.__loader__)
types.__loader__ = this will be replaced by the reload

and then later:

assertIs(type(types.__loader__), expected_loader_type)

--

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



[issue18609] test_ctypes failure on AIX in PyEval_CallObjectWithKeywords

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 31f9c1481cfa by Victor Stinner in branch 'default':
Issue #18609: Add a fast-path for iso8859-1 encoding
http://hg.python.org/cpython/rev/31f9c1481cfa

--

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



[issue19430] argparse replaces \$ with $ (if in commandline)

2013-10-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed, this sounds very much like the shell doing the unescaping, rather than 
argparse.
(I wonder why argparse would special-case $, anyway)

--
nosy: +pitrou

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



[issue4331] Add functools.partialmethod

2013-10-29 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
assignee:  - ncoghlan

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



[issue19420] Leak in _hashopenssl.c

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6fdbb81b4020 by Christian Heimes in branch 'default':
Issue #19420: Fix reference leak in module initalization code of _hashopenssl.c
http://hg.python.org/cpython/rev/6fdbb81b4020

--
nosy: +python-dev

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



[issue19420] Leak in _hashopenssl.c

2013-10-29 Thread Christian Heimes

Christian Heimes added the comment:

Fixed in 3.4

Georg, 3.3 is currently in RC phase and this fix is not critical. Do you want 
me to commit it anyway or shall I wait until 3.3.3 has been released by you?

--

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



[issue19432] test_multiprocessing_fork failures

2013-10-29 Thread Stefan Krah

New submission from Stefan Krah:

I'm getting the following test_multiprocessing_fork failures on Debian
Wheezy.  Perhaps this is related to #19227:


test_default_timeout (test.test_multiprocessing_fork.WithThreadsTestBarrier) 
... Exception in thread Thread-344:
Traceback (most recent call last):
  File /home/stefan/hg/master3/Lib/threading.py, line 921, in _bootstrap_inner
self.run()
  File /home/stefan/hg/master3/Lib/threading.py, line 869, in run
self._target(*self._args, **self._kwargs)
  File /home/stefan/hg/master3/Lib/test/_test_multiprocessing.py, line 1152, 
in task
self.f(*self.args)
  File /home/stefan/hg/master3/Lib/test/_test_multiprocessing.py, line 1382, 
in _test_default_timeout_f
barrier.wait()
  File /home/stefan/hg/master3/Lib/threading.py, line 616, in wait
self._wait(timeout)
  File /home/stefan/hg/master3/Lib/threading.py, line 653, in _wait
self._break()
  File /home/stefan/hg/master3/Lib/threading.py, line 702, in _break
self._cond.notify_all()
  File /home/stefan/hg/master3/Lib/threading.py, line 359, in notify_all
self.notify(len(self._waiters))
  File /home/stefan/hg/master3/Lib/threading.py, line 342, in notify
waiters_to_notify = _deque(_islice(all_waiters, n))
RuntimeError: deque mutated during iteration

FAIL


==
FAIL: test_default_timeout 
(test.test_multiprocessing_fork.WithThreadsTestBarrier)
--
Traceback (most recent call last):
  File /home/stefan/hg/master3/Lib/test/_test_multiprocessing.py, line 1393, 
in test_default_timeout
self.assertEqual(len(results), barrier.parties)
AssertionError: 4 != 5

--

--
messages: 201624
nosy: skrah
priority: normal
severity: normal
status: open
title: test_multiprocessing_fork failures

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



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-10-29 Thread Nick Coghlan

Nick Coghlan added the comment:

Christian's general approach looks fine to me - consolidating the kind hashes 
(i.e. byte sequences, numbers and pointers) into one place independent of any 
particular type implementation makes sense to me, and the clear abstraction of 
What is a hash function? from Python's point of view is a good thing for 
embedding purposes.

If you get the PEP updated accordingly, we should be able to get that formally 
accepted in fairly short order. (I had some other suggestions in the review, 
but they aren't relevant to accepting the PEP).

Regarding the concerns about a potential performance impact for unaligned 
memory access, I think that can be better assessed *after* the simpler patch is 
merged and it's easier for people to get hold of the new hash implementation. 
However, the PEP should mention the concern, and note it as something we will 
be keeping a close eye on during the beta period.

--

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



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-10-29 Thread STINNER Victor

STINNER Victor added the comment:

+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.

You should copy the license into Doc/license.rst.

--
nosy: +haypo

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



[issue19430] argparse replaces \$ with $ (if in commandline)

2013-10-29 Thread R. David Murray

R. David Murray added the comment:

Indeed, you can see in the original posting that the \ is already gone from the 
dollar in sys.argv, so argparse has nothing to do with it.

And it is indeed the shell doing the unescaping:

rdmurray@session:~cat test.sh
#!/bin/bash
echo $@
rdmurray@session:~bash test.sh abc [\t] \$
abc [\t] $
rdmurray@session:~bash test.sh 'abc [\t] \$'
abc [\t] \$
rdmurray@session:~bash test.sh 'abc [\t] \$'
abc [\t] \$
rdmurray@session:~bash test.sh 'abc [\t] \$'
'abc [\t] $'
rdmurray@session:~bash test.sh 'abc [\t] \\$'
'abc [\t] \$'
rdmurray@session:~bash test.sh 'abc [\t] \\\$foo'
abc [\t] \\\$foo
rdmurray@session:~bash test.sh 'abc [\t] \$foo'  
abc [\t] \$foo

The shell treats $ specially because $ has a special meaning inside double 
quotes (variable substitution), so it presumably unescapes it as part of the 
double quote string processing.  You have to escape both the backslash and the 
$ if you want a literal '\$' to wind up in argv, when the outer level of 
quoting is double quotes.

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

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



[issue19430] argparse replaces \$ with $ (if in commandline)

2013-10-29 Thread R. David Murray

R. David Murray added the comment:

Indeed, you can see in the original posting that the \ is already gone from the 
dollar in sys.argv, so argparse has nothing to do with it.

And it is indeed the shell doing the unescaping:

rdmurray@session:~cat test.sh
#!/bin/bash
echo $@
rdmurray@session:~bash test.sh abc [\t] \$
abc [\t] $
rdmurray@session:~bash test.sh 'abc [\t] \$'
abc [\t] \$
rdmurray@session:~bash test.sh 'abc [\t] \$'
abc [\t] \$
rdmurray@session:~bash test.sh 'abc [\t] \$'
'abc [\t] $'
rdmurray@session:~bash test.sh 'abc [\t] \\$'
'abc [\t] \$'
rdmurray@session:~bash test.sh 'abc [\t] \\$foo'
'abc [\t] \'
rdmurray@session:~bash test.sh 'abc [\t] \\\$foo'
abc [\t] \\\$foo
rdmurray@session:~bash test.sh 'abc [\t] \$foo'  
abc [\t] \$foo

The shell treats $ specially because $ has a special meaning inside double 
quotes (variable substitution), so it presumably unescapes it as part of the 
double quote string processing.  You have to escape both the backslash and the 
$ if you want a literal '\$' to wind up in argv, when the outer level of 
quoting is double quotes.

--

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



[issue19430] argparse replaces \$ with $ (if in commandline)

2013-10-29 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
Removed message: http://bugs.python.org/msg201627

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



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-10-29 Thread STINNER Victor

STINNER Victor added the comment:

To support Windows 32 bit, the following code in PC/pyconfig.h can be modified 
to use __int64 or _W64: see ssize_t definition below in the same file.

#ifndef PY_UINT64_T
#if SIZEOF_LONG_LONG == 8
#define HAVE_UINT64_T 1
#define PY_UINT64_T unsigned PY_LONG_LONG
#endif
#endif

--

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



[issue19432] test_multiprocessing_fork failures

2013-10-29 Thread Stefan Krah

Stefan Krah added the comment:

The issue is probably different from #19227, since it already occurs
with 4e79c3ae8a12.

--
components: +Extension Modules
nosy: +sbt
stage:  - needs patch
type:  - behavior
versions: +Python 3.3, Python 3.4

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



[issue19430] argparse replaces \$ with $ (if in commandline)

2013-10-29 Thread telmich

telmich added the comment:

sorry for the noise, it was too early in the morning!

--

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



[issue19432] test_multiprocessing_fork failures

2013-10-29 Thread Richard Oudkerk

Richard Oudkerk added the comment:

This is a test of threading.Barrier rather than anything implemented directly 
by multiprocessing.

Tests which involve timeouts tend to be a bit flaky.  Increasing the length of 
timeouts usually helps, but makes the tests take even longer.

How often have you seen this failure?  Did it happen on a buildbot?  Was there 
a lot of other activity on the system at the time?

--

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



[issue4331] Add functools.partialmethod

2013-10-29 Thread alon horev

alon horev added the comment:

I've changed the test according to the code review. Thanks

--
Added file: http://bugs.python.org/file32409/4331.v2.patch

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



[issue19432] test_multiprocessing_fork failures

2013-10-29 Thread Stefan Krah

Stefan Krah added the comment:

I've seen the failure very often, without any particular load.

Now I noticed that during test_tools there were several ksoftirqd
processes consuming 20% CPU on 4 cores.  That seemed unusual to
me, so I followed the advice of a certain MIT koan and rebooted.

test_multiprocessing_fork no longer fails.

--
resolution:  - works for me
status: open - closed

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread Christian Heimes

New submission from Christian Heimes:

For PEP 456 it would be useful to have PY_UINT64_T on 32bit Windows. Does 
anybody see a problem with Victor's idea? I like it.

Victor wrote in http://bugs.python.org/issue19183#msg201629:

To support Windows 32 bit, the following code in PC/pyconfig.h can be modified 
to use __int64 or _W64: see ssize_t definition below in the same file.

#ifndef PY_UINT64_T
#if SIZEOF_LONG_LONG == 8
#define HAVE_UINT64_T 1
#define PY_UINT64_T unsigned PY_LONG_LONG
#endif
#endif

--
components: Interpreter Core, Windows
messages: 201635
nosy: brian.curtin, christian.heimes, haypo, loewis, ncoghlan, tim.golden
priority: normal
severity: normal
stage: needs patch
status: open
title: Define PY_UINT64_T on Windows 32bit
type: enhancement
versions: Python 3.4

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



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-10-29 Thread Christian Heimes

Christian Heimes added the comment:

Victor:
I have added the licence to Doc/licence.rst and created a new ticket for 
PY_UINT64_T on Windows #19433.

Nick:
The memory layout of the hash secret is now documented. I have renamed the 
members to reflect their purpose, too. 
http://hg.python.org/features/pep-456/file/f0a7e606c2d0/Include/pyhash.h#l32

I'll update my PEP shortly and address the memory layout of _Py_HashSecret_t, 
the small string hashing optimization and performance/memory alignment.

--

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



[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Why not:


try:
from _operator import *
except ImportError:
from _pyoperator import *

--
nosy: +pitrou

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread Martin v . Löwis

Martin v. Löwis added the comment:

LGTM

--

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



[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-29 Thread STINNER Victor

STINNER Victor added the comment:

 Why not:
 
 try:
 from _operator import *
 except ImportError:
 from _pyoperator import *

Let's try (I replaced operator.py with these 4 lines).

$ ./python -m timeit import sys; modname='operator' __import__(modname); del 
sys.modules[modname]; del sys.modules['_operator'] 
1 loops, best of 3: 165 usec per loop

$ ./python -m timeit import sys; modname='operator' __import__(modname); del 
sys.modules[modname] 
1 loops, best of 3: 136 usec per loop

import operator is only 2x faster (289 usec = 136 usec). It's less 
interesting. And what would be the purpose of a file of 4 line which containing 
import *? Do you think that PyPy, IronPython and Jython will reuse such 
trampoline/wrapper?

--
type:  - performance

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



[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 import operator is only 2x faster (289 usec = 136 usec). It's less
 interesting.

The real question for me is: why are you interested in speeding up the
import of the operator module? 200 µs won't make a visible difference.

 And what would be the purpose of a file of 4 line which
 containing import *?

To make it obvious that there are two implementations, one of which is
a fallback.

--
title: operator.py: move the Python implementation in the else block of 
try/except ImportError - operator.py: move the Python implementation in the 
else   block of try/except ImportError

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



[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-29 Thread Stefan Krah

Stefan Krah added the comment:

I understand the desire to speed things up, but either the four-line facade
module or else a single module is probably required by PEP-399.

--
title: operator.py: move the Python implementation in the else  block of 
try/except ImportError - operator.py: move the Python implementation in the 
else block of try/except ImportError

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread Tim Golden

Tim Golden added the comment:

Fine by me

--

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



[issue19434] Wrong documentation of MIMENonMultipart class

2013-10-29 Thread Vajrasky Kok

New submission from Vajrasky Kok:

 from email.mime.nonmultipart import MIMENonMultipart
 MIMENonMultipart.__doc__
'Base class for MIME multipart/* type messages.'


Attached the patch to fix the doc of MIMENonMultipart class.

--
assignee: docs@python
components: Documentation
files: fix_doc_for_mime_non_multipart.patch
keywords: patch
messages: 201643
nosy: docs@python, r.david.murray, vajrasky
priority: normal
severity: normal
status: open
title: Wrong documentation of MIMENonMultipart class
versions: Python 3.4
Added file: 
http://bugs.python.org/file32410/fix_doc_for_mime_non_multipart.patch

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread STINNER Victor

STINNER Victor added the comment:

This issue has no patch.

--

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



[issue19435] Directory traversal attack for CGIHTTPRequestHandler

2013-10-29 Thread Alexander Kruppa

New submission from Alexander Kruppa:

An error in separating the path and filename of the CGI script to run in 
http.server.CGIHTTPRequestHandler allows running arbitrary executables in the 
directory under which the server was started.

The problem is that in CGIHTTPRequestHandler we have:

  def run_cgi(self):
  Execute a CGI script.
  path = self.path
  dir, rest = self.cgi_info
  
  i = path.find('/', len(dir) + 1)

where path is the uncollapsed path in the URL, but cgi_info contains the first 
path segment and the rest from the *collapsed* path as filled in by is_cgi(), 
so indexing into path via len(dir) is incorrect.

An example exploit is giving the request path:

///badscript.sh/../cgi-bin/cgi.sh

Note that Firefox and wget at least simplify the path in the request; to make 
sure this exact path is used, do for example:

  (echo GET ///badscript.sh/../cgi-bin/cgi.sh HTTP/1.1; echo) | 
telnet localhost 4443

This causes the CGIHTTPRequestHandler to execute the badscript.sh file in the 
directory in which the server was started, so script execution is not 
restricted to the cgi-bin/ or htbin/ subdirectories.

--
components: Library (Lib)
messages: 201645
nosy: Alexander.Kruppa
priority: normal
severity: normal
status: open
title: Directory traversal attack for CGIHTTPRequestHandler
type: security
versions: Python 3.2

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



[issue19435] Directory traversal attack for CGIHTTPRequestHandler

2013-10-29 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +christian.heimes, haypo

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



[issue19436] Python 2.7 on MAC OSX Mavericks crashes on the help('modules') command

2013-10-29 Thread lagoon7

New submission from lagoon7:

/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: 
g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: 
g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  from gtk import _gtk

** (python:23199): CRITICAL **: pyg_register_boxed: assertion `boxed_type != 0' 
failed
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: cannot 
register existing type `GdkDevice'
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: 
g_type_get_qdata: assertion `node != NULL' failed
  from gtk import _gtk
Segmentation fault (core dumped)

--
assignee: ronaldoussoren
components: Macintosh
messages: 201646
nosy: lagoon7, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python 2.7 on MAC OSX Mavericks crashes on the help('modules') command
type: crash
versions: Python 2.7

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



[issue19435] Directory traversal attack for CGIHTTPRequestHandler

2013-10-29 Thread Christian Heimes

Christian Heimes added the comment:

I can confirm the issue:

$ mkdir www
$ cd www
$ cat  EOF  badscript.sh
#!/bin/sh
echo hacked
EOF
$ chmod +x badscript.sh
$ ../python -m http.server --cgi


$ echo GET ///badscript.sh/../cgi-bin/cgi.sh HTTP/1.1 | nc localhost 
8000
HTTP/1.0 200 Script output follows
Server: SimpleHTTP/0.6 Python/3.4.0a4+
Date: Tue, 29 Oct 2013 16:47:22 GMT
hacked

--
assignee:  - christian.heimes
nosy: +benjamin.peterson, georg.brandl, larry
priority: normal - release blocker
stage:  - test needed
versions: +Python 2.7, Python 3.3, Python 3.4

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



[issue19435] Directory traversal attack for CGIHTTPRequestHandler

2013-10-29 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

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



[issue19435] Directory traversal attack for CGIHTTPRequestHandler

2013-10-29 Thread Stéphane Glondu

Changes by Stéphane Glondu st...@glondu.net:


--
nosy: +glondu

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



[issue19436] Python 2.7 on Linux Ubuntu 12.04 LTS crashes on the help('modules') command

2013-10-29 Thread lagoon7

lagoon7 added the comment:

Sorry I meant Linux instead of Mac OSX.

--
title: Python 2.7 on MAC OSX Mavericks crashes on the help('modules') command 
- Python 2.7 on Linux Ubuntu 12.04 LTS crashes on the help('modules') command

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



[issue19436] Python 2.7 on Linux Ubuntu 12.04 LTS crashes on the help('modules') command

2013-10-29 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
assignee: ronaldoussoren - 
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - pydoc - stall when requesting a list of available modules in 
the online help utility

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



[issue19437] More failures found by pyfailmalloc

2013-10-29 Thread STINNER Victor

New submission from STINNER Victor:

Using pyfailamlloc, I found various bugs: see issue #18048. Because this issue 
has been closed, I'm opening a new issue for new bugs.

https://bitbucket.org/haypo/pyfailmalloc

--
messages: 201649
nosy: haypo
priority: normal
severity: normal
status: open
title: More failures found by pyfailmalloc
type: crash
versions: Python 3.4

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread Christian Heimes

Christian Heimes added the comment:

It seems no patch is needed to get PY_UINT64_T on 32bit Windows:

 import sys
 sys.version
'3.4.0a4+ (pep-456:f0a7e606c2d0, Oct 29 2013, 19:24:12) [MSC v.1600 32 bit 
(Intel)]'
 sys.maxsize
2147483647
 sys.hash_info
sys.hash_info(width=32, modulus=2147483647, inf=314159, nan=0, imag=103, 
algorithm='siphash24', hash_bits=64, seed_bits=128)

--

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread Tim Peters

Tim Peters added the comment:

Yes, it should be taken care of already, because of this in PC/pyconfig.h:

#ifdef MS_WIN32
...
#define SIZEOF_LONG_LONG 8

That defines the symbol triggering the PY_UINT64_T define shown in the original 
message in this issue.

--
nosy: +tim.peters

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset daa1ab27b5c2 by Victor Stinner in branch 'default':
Issue #19433: test_capi: add tests on the size of some C types
http://hg.python.org/cpython/rev/daa1ab27b5c2

--
nosy: +python-dev

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



[issue19437] More failures found by pyfailmalloc

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1e5bbaed79ca by Victor Stinner in branch 'default':
Issue #19437: Fix Array_subscript() of ctypes, handle Array_item() failure
http://hg.python.org/cpython/rev/1e5bbaed79ca

New changeset fc825259ee86 by Victor Stinner in branch 'default':
Issue #19437: Fix convert_op_cmp() of decimal.Decimal rich comparator, handle
http://hg.python.org/cpython/rev/fc825259ee86

New changeset 6d57be1f19cf by Victor Stinner in branch 'default':
Issue #19437: Fix PyObject_CallFunction(), handle Py_VaBuildValue() and
http://hg.python.org/cpython/rev/6d57be1f19cf

New changeset 22ce0b7b1eaf by Victor Stinner in branch 'default':
Issue #19437: Fix _PyUnicode_New() (constructor of legacy string), set all
http://hg.python.org/cpython/rev/22ce0b7b1eaf

--
nosy: +python-dev

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



[issue19435] Directory traversal attack for CGIHTTPRequestHandler

2013-10-29 Thread janzert

Changes by janzert janz...@janzert.com:


--
nosy: +janzert

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #17884: Try to reuse stdint.h types like int32_t.

--

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



[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't see a benefit from this patch. _PyUnicode_AsString() is very fast in 
most cases (because source lines are mostly ASCII only). On other hand, the 
patch replaces one-time _PyUnicode_AsString() by multiple less effective (even 
for ASCII strings) operations.

--
nosy: +serhiy.storchaka

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



[issue19433] Define PY_UINT64_T on Windows 32bit

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5bf96a96f31d by Victor Stinner in branch 'default':
Issue #19433: test_capi: check signness of some C types
http://hg.python.org/cpython/rev/5bf96a96f31d

--

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



[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread STINNER Victor

STINNER Victor added the comment:

 I don't see a benefit from this patch.

Oh, sorry, I forgot to explain the motivation. Performances of the warnings 
module are not critical module. The motivation here is to avoid to encoding 
string to UTF-8 for correctness. For example, _PyUnicode_AsString(filename) 
fails if the filename contains a surrogate character.

 warnings.warn_explicit(text, RuntimeError, filename, 5)
filename:5: RuntimeError: text
 warnings.warn_explicit(text, RuntimeError, filename\udc80, 5)
Traceback (most recent call last):
  File stdin, line 1, in module
UnicodeEncodeError: 'utf-8' codec can't encode character '\udc80' in position 
8: surrogates not allowed


Another example where a string to encoded to UTF-8 and decoded from UTF-8 a few 
instructions later:

PyObject *to_str = PyObject_Str(item);
err_str = _PyUnicode_AsString(to_str);
...
PyErr_Format(PyExc_RuntimeError,  ...%s, err_str);

Using %R avoids any encoding conversion.

--

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



[issue19426] Opening a file in IDLE causes a crash or hang

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e0475c44832f by Benjamin Peterson in branch '2.7':
backport #19426
http://hg.python.org/cpython/rev/e0475c44832f

--

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



[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux

2013-10-29 Thread Kent Frazier

Kent Frazier added the comment:

Serhiy, I signed the form. Let me know if you need anything else.

--

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



[issue19437] More failures found by pyfailmalloc

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5acbdcfc21c9 by Victor Stinner in branch 'default':
Issue #19437: Fix dec_format() of the _decimal module, handle dec_strdup()
http://hg.python.org/cpython/rev/5acbdcfc21c9

--

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



[issue17936] O(n**2) behaviour when adding/removing classes

2013-10-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Updated patch replacing PyErr_Clear() with PyErr_WriteUnraisable(), and 
PyDict_Check() with PyDict_CheckExact().

--
Added file: http://bugs.python.org/file32411/subclasses_dict3.patch

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



[issue19227] test_multiprocessing_xxx hangs under Gentoo buildbots

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5942eea8cf41 by Christian Heimes in branch '3.3':
Issue #19227 / Issue #18747: Remove pthread_atfork() handler to remove OpenSSL 
re-seeding
http://hg.python.org/cpython/rev/5942eea8cf41

New changeset 705f2addd0f0 by Christian Heimes in branch 'default':
Issue #19227 / Issue #18747: Remove pthread_atfork() handler to remove OpenSSL 
re-seeding
http://hg.python.org/cpython/rev/705f2addd0f0

New changeset 4d761ce0ac74 by Christian Heimes in branch '2.7':
Issue #19227 / Issue #18747: Remove pthread_atfork() handler to remove OpenSSL 
re-seeding
http://hg.python.org/cpython/rev/4d761ce0ac74

--

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



[issue18747] Re-seed OpenSSL's PRNG after fork

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5942eea8cf41 by Christian Heimes in branch '3.3':
Issue #19227 / Issue #18747: Remove pthread_atfork() handler to remove OpenSSL 
re-seeding
http://hg.python.org/cpython/rev/5942eea8cf41

New changeset cd4007fb9c7e by Christian Heimes in branch '3.3':
Issue #18747: document issue with OpenSSL's CPRNG state and fork
http://hg.python.org/cpython/rev/cd4007fb9c7e

New changeset 705f2addd0f0 by Christian Heimes in branch 'default':
Issue #19227 / Issue #18747: Remove pthread_atfork() handler to remove OpenSSL 
re-seeding
http://hg.python.org/cpython/rev/705f2addd0f0

New changeset 4d761ce0ac74 by Christian Heimes in branch '2.7':
Issue #19227 / Issue #18747: Remove pthread_atfork() handler to remove OpenSSL 
re-seeding
http://hg.python.org/cpython/rev/4d761ce0ac74

New changeset 22e166d5c4c7 by Christian Heimes in branch '2.7':
Issue #18747: document issue with OpenSSL's CPRNG state and fork
http://hg.python.org/cpython/rev/22e166d5c4c7

--

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



[issue19227] test_multiprocessing_xxx hangs under Gentoo buildbots

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ad779da9e351 by Christian Heimes in branch '2.7':
Issue #19227 / Issue #18747: Remove pthread_atfork() handler to remove OpenSSL 
re-seeding
http://hg.python.org/cpython/rev/ad779da9e351

--

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



[issue18747] Re-seed OpenSSL's PRNG after fork

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ad779da9e351 by Christian Heimes in branch '2.7':
Issue #19227 / Issue #18747: Remove pthread_atfork() handler to remove OpenSSL 
re-seeding
http://hg.python.org/cpython/rev/ad779da9e351

--

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



[issue17936] O(n**2) behaviour when adding/removing classes

2013-10-29 Thread Antoine Pitrou

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


--
status: pending - closed

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



[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread Christian Heimes

Christian Heimes added the comment:

How about:

type(v) in (bytes, type(None))

or:

   isinstance(v, (bytes, type(None))

or:

   v is None or type(v) is bytes

or:

  v is None or isinstance(v, bytes)

--
nosy: +christian.heimes

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



[issue17936] O(n**2) behaviour when adding/removing classes

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7f1ce6fe293 by Antoine Pitrou in branch 'default':
Issue #17936: Fix O(n**2) behaviour when adding or removing many subclasses of 
a given type.
http://hg.python.org/cpython/rev/a7f1ce6fe293

--
nosy: +python-dev

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



[issue17936] O(n**2) behaviour when adding/removing classes

2013-10-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Actually, PyErr_Clear() was necessary in some cases. Now committed.

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

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



[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread mpb

New submission from mpb:

types.NoneType seems to have disappeared in Python 3.  This is probably 
intentional, but I cannot figure out how to test if a variable is of type 
NoneType in Python 3.

Specifically, I want to write:
assert  type (v) in ( bytes, types.NoneType )

Yes, I could write:
assert  v is None or type (v) is bytes

But the first assert statement is easier to read (IMO).

Here are links to various Python 3 documentation about None:

[1] http://docs.python.org/3/library/stdtypes.html#index-2

[2] http://docs.python.org/3/library/constants.html#None

Link [2] says: None  The sole value of the type NoneType.  However, NoneType 
is not listed in the Python 3 documentation index.  (As compared with the 
Python 2 index, where NoneType is listed.)

[3] http://docs.python.org/3/library/types.html

If NoneType is gone in Python 3, mention of NoneType should probably be removed 
from link [2].  If NoneType is present in Python 3, the docs (presumably at 
least one of the above links, and hopefully also the index) should tell me how 
to use it.

Here is another link:

[4] http://docs.python.org/3/library/stdtypes.html#bltin-type-objects

The standard module types defines names for all standard built-in types.  
(Except class 'NoneType' ???)

None is a built-in constant.  It has a type.  If None's type is not considered 
to be a standard built-in type, then IMO this is surprising(!!) and should be 
documented somewhere (for example, at link [4], and possibly elsewhere as well.)

Thanks!

--
assignee: docs@python
components: Documentation
messages: 201666
nosy: docs@python, mpb
priority: normal
severity: normal
status: open
title: Where is NoneType in Python 3?
versions: Python 3.3

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



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

2013-10-29 Thread Tom Tromey

Changes by Tom Tromey tro...@redhat.com:


--
nosy: +tromey

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



[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread mpb

mpb added the comment:

Of your 4 suggestions, I mentioned #3 and #4 in my post.  They are less 
readable, IMO.

1 and 2 are nicer, but both have an extra set of nested parenthesis.

While I appreciate the suggestions, I submitted this as a documentation bug, 
because I think I should be able to find these suggestions somewhere in the 
Python 3 documentation, at one (or more) of the links I included in my bug 
report.  Also, the Python 3 documentation does mention NoneType, and if 
NoneType is not part of Python 3, I claim this is an error in the documentation.

And then, there is my personal favorite work-around:

NoneType = type (None)# only needed once
assert type (v) in ( bytes, NoneType )

Or (perhaps more confusingly, LOL!):

none = type (None)
assert type (v) in ( bytes, none )

isinstance is more confusing because it takes two arguments.  Whenever I use it 
I have to think, isinstance vs instanceof, which is Python, which is Java?  
(And I haven't used Java seriously in years!)  And then I have to think about 
the order of the arguments (v, cls) vs (cls, v).  type is just simpler than 
isinstance.

--

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



[issue19439] Build _testembed on Windows

2013-10-29 Thread Zachary Ware

New submission from Zachary Ware:

Here's a patch that builds _testembed on Windows and adjusts test_capi to not 
skip EmbeddingTests on Windows.  The .vcxproj is based on _freeze_importlib, 
with when to build settings lifted from _testimportmultiple.

The patch also adjusts test_capi.EmbeddingTests.test_forced_io_encoding such 
that it doesn't blow up completely on Windows (and should still pass anywhere 
it does currently, though I haven't been able to test anywhere but on Windows 
yet).  The test still fails, though; here's the relevant output I get:


==
FAIL: test_forced_io_encoding (test.test_capi.EmbeddingTests)
--
Traceback (most recent call last):
  File P:\Projects\OSS\Python\_cpython\lib\test\test_capi.py, line 298, in 
test_forced_io_encoding
self.assertEqual(out.strip(), expected_output)
AssertionError: '--- [106 chars]t: cp1252:strict\r\nstderr: 
cp1252:backslashre[575 chars]lace' != '--- [106 chars]t: cp437:strict\r\nstderr:
 cp437:backslashrepl[571 chars]lace'
  --- Use defaults ---
  Expected encoding: default
  Expected errors: default
  stdin: cp437:strict
- stdout: cp1252:strict
?   
+ stdout: cp437:strict
?   ^^^
- stderr: cp1252:backslashreplace
?   
+ stderr: cp437:backslashreplace
?   ^^^
  --- Set errors only ---
  Expected encoding: default
  Expected errors: surrogateescape
  stdin: cp437:surrogateescape
- stdout: cp1252:surrogateescape
?   
+ stdout: cp437:surrogateescape
?   ^^^
- stderr: cp1252:backslashreplace
?   
+ stderr: cp437:backslashreplace
?   ^^^
  --- Set encoding only ---
  Expected encoding: latin-1
  Expected errors: default
  stdin: latin-1:strict
  stdout: latin-1:strict
  stderr: latin-1:backslashreplace
  --- Set encoding and errors ---
  Expected encoding: latin-1
  Expected errors: surrogateescape
  stdin: latin-1:surrogateescape
  stdout: latin-1:surrogateescape
  stderr: latin-1:backslashreplace

--


I'm not sure whether this is a bug in the way _testembed is built or otherwise. 
 EmbeddingTests.test_subinterps passes, though.

Due to my ongoing inability to get a 64-bit build to work, this has only been 
tested on 32-bit Windows 7.

--
components: Tests, Windows
files: windows_testembed.diff
keywords: patch
messages: 201671
nosy: brian.curtin, loewis, ncoghlan, pitrou, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Build _testembed on Windows
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32412/windows_testembed.diff

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



[issue19435] Directory traversal attack for CGIHTTPRequestHandler

2013-10-29 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Patch

--
keywords: +patch
Added file: http://bugs.python.org/file32413/cgi.patch

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



[issue15792] Fix compiler options for x64 builds on Windows

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c49b8bdcb5cb by Tim Golden in branch '3.3':
Issue 15792 Correct build options on Win64. Patch by Jeremy Kloth.
http://hg.python.org/cpython/rev/c49b8bdcb5cb

--

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



[issue19439] Build _testembed on Windows

2013-10-29 Thread Nick Coghlan

Nick Coghlan added the comment:

Nice! I wonder if there might a difference between the default console
encoding and the default pipe encoding (that test assumes the default
standard stream encodings will be the same in the current process as they
are in the child).

--

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



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-10-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

About memcpy(). Here is sample file. Compile it to assembler:

 gcc -O2 -S -masm=intel fnv.c

With memcpy() main loop is compiled to:

.L8:
movzx   ecx, BYTE PTR [ebx+edx]
imuleax, eax, 103
add edx, 1
xor eax, ecx
cmp edx, edi
jne .L8

With per-byte copy it is compiled to:

.L3:
mov dl, BYTE PTR [ecx]
imuleax, eax, 103
sub ebp, 1
movzx   ebx, BYTE PTR [ecx+1]
movzx   edi, BYTE PTR [ecx+2]
movzx   esi, BYTE PTR [ecx+3]
add ecx, 4
mov dh, bl
sal edi, 16
movzx   edx, dx
sal esi, 24
or  edx, edi
or  edx, esi
xor eax, edx
cmp ebp, -1
jne .L3

--
Added file: http://bugs.python.org/file32414/fnv.c

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



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-10-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
Removed message: http://bugs.python.org/msg201675

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



[issue19440] Clean up test_capi

2013-10-29 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


Added file: http://bugs.python.org/file32416/test_capi_cleanup-3.3.diff

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



[issue19440] Clean up test_capi

2013-10-29 Thread Zachary Ware

New submission from Zachary Ware:

Here's a patch to clean up test_capi a little bit; it removes a __future__ 
import, converts from test_main to unittest.main, and makes use of subtests to 
run each _testcapi function.

I'll post a separate patch for 3.3; there's just enough difference between 
branches to make a single patch impossible and merging slightly hairy.

--
components: Tests
files: test_capi_cleanup.diff
keywords: patch
messages: 201676
nosy: ezio.melotti, zach.ware
priority: normal
severity: normal
status: open
title: Clean up test_capi
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32415/test_capi_cleanup.diff

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



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-10-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

About memcpy(). Here is sample file. Compile it to assembler:

 gcc -O2 -S -masm=intel fnv.c

With memcpy() main loop is compiled to:

.L3:
mov esi, DWORD PTR [ebx]
imuleax, eax, 103
add ebx, 4
xor eax, esi
sub ecx, 1
mov DWORD PTR [esp+24], esi
jne .L3

With per-byte copy it is compiled to:

.L3:
mov dl, BYTE PTR [ecx]
imuleax, eax, 103
sub ebp, 1
movzx   ebx, BYTE PTR [ecx+1]
movzx   edi, BYTE PTR [ecx+2]
movzx   esi, BYTE PTR [ecx+3]
add ecx, 4
mov dh, bl
sal edi, 16
movzx   edx, dx
sal esi, 24
or  edx, edi
or  edx, esi
xor eax, edx
cmp ebp, -1
jne .L3

--

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



[issue19386] selectors test_interrupted_retry is flaky

2013-10-29 Thread Charles-François Natali

Charles-François Natali added the comment:

Here's another failure:

==
FAIL: test_interpreter_shutdown
(test.test_concurrent_futures.ProcessPoolShutdownTest)
--
Traceback (most recent call last):
  File 
/var/lib/buildslave/3.x.murray-gentoo-wide/build/Lib/test/test_concurrent_futures.py,
line 77, in tearDown
self.assertLess(dt, 60, synchronization issue: test lasted too long)
AssertionError: 108.88635897636414 not less than 60 : synchronization
issue: test lasted too long


Many timeout-related tests are failing randomly on this buildbot, so I
assume that's really a buildbot issue (is it a VM?).

--

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



[issue19386] selectors test_interrupted_retry is flaky

2013-10-29 Thread R. David Murray

R. David Murray added the comment:

Yes, it is a linux vserver VM.  I would think we would want tests to not fail 
in VMs, though, in this day and age.

--

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



[issue19386] selectors test_interrupted_retry is flaky

2013-10-29 Thread R. David Murray

R. David Murray added the comment:

Also, unless people haven't been reporting other errors, these buildbots have 
been stable up until recently, with the exception of the multiprocessing hangs 
that plague all the buildbots as far as I know.  (My impression could be 
mistaken, though.)

--

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



[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Well, it looks reasonable. But an action should be ASCII only string. So 
perhaps we should first check PyUnicode_IS_ASCII() and then use 
PyUnicode_1BYTE_DATA() and strcpy().

--

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



[issue19386] selectors test_interrupted_retry is flaky

2013-10-29 Thread Charles-François Natali

Charles-François Natali added the comment:

 Also, unless people haven't been reporting other errors, these buildbots have 
 been stable up until recently

Well, the fact that several tests - which were working just fine -
started failing randomly recently (like test_concurrent_futures,
test_subprocess) is a strong hint that the culprit is the buildbot (I
mean, the test_selectors failure just calls epoll_wait(): there is a
known overflow for epoll_wait() timeout, but for large timeout values,
not 2s).

This wouldn't be the first time I see clock issues on a virtual machine...

--

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



[issue19373] Tkinter apps including IDLE may not display properly on OS X 10.9 Mavericks

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f5e0fd7db675 by Ned Deily in branch 'default':
Issue #19373: Add Misc/NEWS entry.
http://hg.python.org/cpython/rev/f5e0fd7db675

--

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



[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread R. David Murray

R. David Murray added the comment:

See http://www.python.org/dev/peps/pep-0294/ for some background on this.  The 
unexpected thing is actually that the types module still exists at all in 
Python3 :)

That said, its documentation could, indeed, use some improvement to address 
this kind of question.

Searching the python-dev email list for 'NoneType removal types module turns 
up some interesting posts, back in the 2.3 days...basically, type(None) is the 
One True Way to get NoneType :)

--
nosy: +r.david.murray

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



[issue19386] selectors test_interrupted_retry is flaky

2013-10-29 Thread R. David Murray

R. David Murray added the comment:

What could cause a VM clock problem on a machine that hasn't been modified, but 
the VMs have been rebooted recently (ie: it isn't stale state inside the VM 
itself).  Anything you can suggest I look at?

--

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



[issue19373] Tkinter apps including IDLE may not display properly on OS X 10.9 Mavericks

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bcbe4099206f by Ned Deily in branch '2.7':
Issue #19373: Apply upstream change to Tk 8.5.15 fixing OS X 10.9
http://hg.python.org/cpython/rev/bcbe4099206f

--

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



[issue19386] selectors test_interrupted_retry is flaky

2013-10-29 Thread R. David Murray

R. David Murray added the comment:

I'm going to reboot the host just to see if that makes any difference.  It's 
been up for 105 days.

--

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



[issue19413] Reload semantics changed unexpectedly in Python 3.3

2013-10-29 Thread Eric Snow

Eric Snow added the comment:

Brett: any opinions on fixing this?  3.3?

Nick: I'll add another test when I get a chance.

--

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



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-10-29 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


Added file: http://bugs.python.org/file32417/4756e9ed0328.diff

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



[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread STINNER Victor

STINNER Victor added the comment:

Well, it looks reasonable. But an action should be ASCII only string. So 
perhaps we should first check PyUnicode_IS_ASCII() and then use 
PyUnicode_1BYTE_DATA() and strcpy().

Such optimizations in warnings seem overkill, performances are not critical in 
this module.

I optimized PyUnicode_CompareWithASCIIString() instead.

--

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



[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 34e166d60f37 by Victor Stinner in branch 'default':
Issue #19424: Optimize PyUnicode_CompareWithASCIIString()
http://hg.python.org/cpython/rev/34e166d60f37

--
nosy: +python-dev

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



[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c7326aa0b69c by Victor Stinner in branch 'default':
Issue #19424: Fix the warnings module to accept filename containing surrogate
http://hg.python.org/cpython/rev/c7326aa0b69c

--

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



[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread STINNER Victor

STINNER Victor added the comment:

@Serhiy: Thanks for your review. I modified warnings.warn_explicit() to reject 
types different than str for the filename. I also removed the useless 
optimization for PyUnicode_Substring() when i=0.

--

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



  1   2   >