[issue18874] Add a new tracemalloc module to trace memory allocations

2013-11-19 Thread Charles-François Natali

Charles-François Natali added the comment:

Would it be possible to generate a clean patch?
The latest one contains many unrelated commits.

--
nosy: +neologix

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



[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0d9624f2ff43 by Serhiy Storchaka in branch 'default':
Issue #12892: The utf-16* and utf-32* codecs now reject (lone) surrogates.
http://hg.python.org/cpython/rev/0d9624f2ff43

--
nosy: +python-dev

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2013-11-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

No matter how it sounds, it certainly looks cleaner in code.
Look at all this code, designed to work around an unexpected GC collection with 
various pointy bits and edge cases and special corners.

Compare to explicitly just asking GC to relent, for a bit:
def getitems(self):
  with gc.disabled():
for each in self.data.items():
  yield each

That's it.

While a native implementation of such a context manager would be better 
(faster, and could be made overriding), a simple one can be constructed thus:
@contextlib.contextmanagerd
def gc_disabled():
  enabled = gc.isenabled()
  gs.disable()
  try:
yield
  finally:
if enabled:
  gc.enable()
  

Such global atomic context managers are well known to stackless programmers. 
It's a very common idiom when building higher level primitives (such as locks) 
from lower level ones.
with stackless.atomic():
   do()
   various()
   stuff_that_does_not_like_being_interrupted()
(stackless.atomic prevents involuntary tasklet switching _and_ involuntary 
thread switching)

--

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



[issue19650] test_multiprocessing_spawn.test_mymanager_context() crashed with STATUS_ACCESS_VIOLATION

2013-11-19 Thread STINNER Victor

New submission from STINNER Victor:

The following failure may be related to #19466. I failed to reproduce it on my 
Windows 7 VM (I compiled Python in 32-bit mode).

http://buildbot.python.org/all/builders/x86%20Windows%20Server%202008%20%5BSB%5D%203.x/builds/1697/steps/test/logs/stdio

==
FAIL: test_mymanager_context 
(test.test_multiprocessing_spawn.WithManagerTestMyManager)
--
Traceback (most recent call last):
  File 
E:\home\cpython\buildslave\x86\3.x.snakebite-win2k8r2sp1-x86\build\lib\test\_test_multiprocessing.py,
 line 1960, in test_mymanager_context
self.assertEqual(manager._process.exitcode, 0)
AssertionError: 3221225477 != 0


3221225477 is 0xC005 in hex, Windows error code:
#define STATUS_ACCESS_VIOLATION  ((NTSTATUS)0xC005L)

--
components: Windows
messages: 203346
nosy: haypo, sbt
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn.test_mymanager_context() crashed with 
STATUS_ACCESS_VIOLATION

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



[issue19651] Mac OSX 10.9 segmentation fault 11 with Python 3.3.3

2013-11-19 Thread John Dobson

New submission from John Dobson:

2 consecutive commands into interactive shell still results in segmentation 
fault 11, patch 18458 reports skipped as patch not needed for 3.3

--
assignee: ronaldoussoren
components: Macintosh
messages: 203347
nosy: johndobson, ronaldoussoren
priority: normal
severity: normal
status: open
title: Mac OSX 10.9 segmentation fault 11 with Python 3.3.3
type: crash
versions: Python 3.3

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



[issue19651] Mac OSX 10.9 segmentation fault 11 with Python 3.3.3

2013-11-19 Thread STINNER Victor

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


--
nosy: +hynek, ned.deily

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



[issue15819] Unable to build Python out-of-tree when source tree is readonly.

2013-11-19 Thread koobs

koobs added the comment:

I'm not sure how I missed this, but our FreeBSD ports that build out-of-tree 
required adding a local patchthat reverts the Makefile.pre.in change in 
ab6ab44921b2 when we updated each port to the latest releases of 2.7, 3.2 and 
3.3:

https://svnweb.freebsd.org/ports?view=revisionrevision=318353

Without it, builds fail with:

cc -c -fno-strict-aliasing -O2 -pipe  -fno-strict-aliasing -DNDEBUG  -I. 
-IInclude -I./../Include -I/usr/local/include -fPIC -DPy_BUILD_CORE -o 
Python/Python-ast.o Python/Python-ast.c
cc: Python/Python-ast.c: No such file or directory
cc: No input files specified
*** [Python/Python-ast.o] Error code 1

Stop in /freebsd/ports/lang/python27/work/Python-2.7.6/portbld.shared.

I also note Trents msg173160 in issue #15298, which may be related?, but seems 
only resolved for OSX.

What needs to be done to remove the need for this patch?

--
nosy: +koobs

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2013-11-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 No matter how it sounds, it certainly looks cleaner in code.

It's also unsafe and invasive, since it's a process-wide setting. An
iterator can be long-lived if it's being consumed slowly, so you've
disabled garbage collection for an unknown amount of time, without the
user knowing about it. Another thread could kick in and perhaps
re-enable it for whatever reason.

Oh if someone calls gc.collect() explicitly, the solution is suddenly
defeated.

--

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



[issue16596] Skip stack unwinding when next, until and return pdb commands executed in generator context

2013-11-19 Thread Xavier de Gaye

Xavier de Gaye added the comment:

This is a consequence of the problem mentioned in msg 177059 above.

New patch 'issue16596_nostate_3.diff' fixes both problems by having the 
interpreter
issue an exception debug event when processing a StopIteration in target 
FOR_ITER:
* The same debug events are issued now, wether the generator is run within a 
for loop or not.
* 'n' stops now at both the return and exception debug events on returning from 
the generator.

--
Added file: http://bugs.python.org/file32699/issue16596_nostate_3.diff

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



[issue16596] Skip stack unwinding when next, until and return pdb commands executed in generator context

2013-11-19 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Forgot to say that the only difference between this patch and the previous one 
is in Python/ceval.c.

--

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



[issue19645] decouple unittest assertions from the TestCase class

2013-11-19 Thread Gregory Salvan

Gregory Salvan added the comment:

issue18054 :

- adding assertCleanError in the ipaddress module, 
- suggesting assertCleanTraceback, assertRaisedFrom in unittest 

- usefull but TestCase has already a wide api.

A solution like Testtools assertThat with matcher protocol 
(https://testtools.readthedocs.org/en/latest/for-test-authors.html#matchers) 
would not expand too much TestCase api and permit to easily extend assertions.

--

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



[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ezio have approved the patch and I have committed it.

Thank you Victor and Kang-Hao for your patches. Thanks all for the reviews.

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

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2013-11-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Yes, the long iterator scenario is the reason it is not ideal for this 
scenario.
The other one (gc.collect()) is easily solved by implementing this construct 
natively.  It can be done rather simply by adding an overriding pause 
property to gc, with the following api:

def pause(increment):
  
  pause or unpause garbage collection.  A positive value
  increases the pause level, while a negative one reduces it.
  when paused, gc won't happen even when explicitly requested with
  gc.collect(), until the pause level drops to 0.
  

I'm sure there are other places in the code with local execution that would 
benefit from not having an accidental GC run happen.  I'm sure I've seen such 
places, with elaborate scaffolding to safeguard itself from such cases.

Anyway, my 2 aurar worth of lateral thinking applied to the problem at hand :)

What about the patch itself?

--

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2013-11-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Speaking of which, this is not only about GC runs, although it is the most 
annoying scenario (since you basically don't control when it happens). Regular 
resource reaping because of reference counting can also wreak havoc.

About the patch, I don't know. It introduces new complexity in 2.7 which should 
be fairly stable by now. The one thing I don't like is your replacement of 
iterator by iterable in the docs.

(you also have one line commented out in the tests)

--

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2013-11-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

The changes for the docs are just a port of the original patch.  And indeed, 
these functions don't return an iterator, but a generator object.

I admit I'm confused by the difference, since next() can be called directly on 
the generator.  Still, a lot of code in the test explicitly calls iter() on the 
iterators before doing next().  Not sure why.

The commented out line is an artifact, I'll remove it, the correct one is the 
test for 20 items.

Otherwise, I have no vested interest in getting this in.  My porting this is 
just me contributing to 2.7.  If it's vetoed, we'll just put it in 2.8.

--

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



[issue19513] Use PyUnicodeWriter instead of PyAccu in repr(tuple) and repr(list)

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 27461e6a7763 by Victor Stinner in branch 'default':
Issue #19513: Disable overallocation of the PyUnicodeWriter before the last 
write
http://hg.python.org/cpython/rev/27461e6a7763

--

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



[issue19334] test_asyncio hanging for 1 hour (non-AIX version)

2013-11-19 Thread STINNER Victor

STINNER Victor added the comment:

I created the issue #19652: test_asyncio: test_subprocess_send_signal() hangs 
on buildbot AMD64 Snow Leop 3.x.

--

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



[issue19652] test_asyncio: test_subprocess_send_signal() hangs on buildbot AMD64 Snow Leop 3.x

2013-11-19 Thread STINNER Victor

New submission from STINNER Victor:

I didn't understand the purpose of the issue #19334: it doesn't mention the OS 
nor the test. I prefer to create a more specific issue, so here you have one 
specific hang.

http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/517/steps/test/logs/stdio

[385/385] test_asyncio
Timeout (1:00:00)!
Thread 0x7fff71296cc0 (most recent call first):
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/selectors.py, line 
291 in select
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/asyncio/base_events.py,
 line 614 in _run_once
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/asyncio/base_events.py,
 line 153 in run_forever
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/asyncio/base_events.py,
 line 172 in run_until_complete
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_asyncio/test_events.py,
 line 1155 in test_subprocess_send_signal
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, 
line 571 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, 
line 610 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 117 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 79 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 117 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 79 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 117 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 79 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/runner.py,
 line 168 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py,
 line 1685 in _run_suite
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py,
 line 1719 in run_unittest
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_asyncio/__init__.py,
 line 31 in test_main
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 1276 in runtest_inner
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 965 in runtest
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 532 in main
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 1560 in main_in_temp_cwd
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 1585 in module
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, 
line 73 in _run_code
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, 
line 160 in _run_module_as_main
Traceback (most recent call last):
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, 
line 160, in _run_module_as_main
__main__, fname, loader, pkg_name)
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, 
line 73, in _run_code
exec(code, run_globals)
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/__main__.py, 
line 3, in module
regrtest.main_in_temp_cwd()
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 1560, in main_in_temp_cwd
main()
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 736, in main
raise Exception(Child error on {}: {}.format(test, result[1]))
Exception: Child error on test_asyncio: Exit code 1
make: *** [buildbottest] Error 1

--
messages: 203358
nosy: David.Edelsohn, db3l, gvanrossum, haypo, koobs, larry, ncoghlan, 
neologix, pitrou, python-dev, sbt, skrah
priority: normal
severity: normal
status: open
title: test_asyncio: test_subprocess_send_signal() hangs on buildbot AMD64 
Snow Leop 3.x
versions: Python 3.4

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



[issue19334] test_asyncio hanging for 1 hour (non-AIX version)

2013-11-19 Thread STINNER Victor

STINNER Victor added the comment:

 The original report and build logs were attached to the original issue 
 covering the import of asyncio: #19262
 Also attaching here.

Extract of the most important part:

[382/382] test_asyncio
Timeout (1:00:00)!
Thread 0x000805c18000:
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/threading.py, 
line 290 in wait
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/queue.py, line 
167 in get
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/concurrent/futures/thread.py,
 line 63 in _worker
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/threading.py, 
line 869 in run
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/threading.py, 
line 921 in _bootstrap_inner
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/threading.py, 
line 889 in _bootstrap

Thread 0x000801407400:
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/selectors.py, 
line 265 in select
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/asyncio/base_events.py,
 line 576 in _run_once
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/asyncio/base_events.py,
 line 153 in run_forever
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/test_asyncio/test_events.py,
 line 450 in test_signal_handling_while_selecting
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/case.py, line 
571 in run
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/case.py, line 
610 in __call__
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py, 
line 117 in run
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py, 
line 79 in __call__
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py, 
line 117 in run
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py, 
line 79 in __call__
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py, 
line 117 in run
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py, 
line 79 in __call__
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/runner.py, 
line 168 in run
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/support/__init__.py,
 line 1661 in _run_suite
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/support/__init__.py,
 line 1695 in run_unittest
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/test_asyncio/__init__.py,
 line 26 in test_main
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/regrtest.py, line 
1276 in runtest_inner
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/regrtest.py, line 
965 in runtest
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/regrtest.py, line 
532 in main
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/regrtest.py, line 
1560 in main_in_temp_cwd
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/regrtest.py, line 
1585 in module
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/runpy.py, line 
73 in _run_code
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/runpy.py, line 
160 in _run_module_as_main
Traceback (most recent call last):
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/runpy.py, line 
160, in _run_module_as_main
__main__, fname, loader, pkg_name)
  File /usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/runpy.py, line 
73, in _run_code
exec(code, run_globals)
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/__main__.py, line 
3, in module
regrtest.main_in_temp_cwd()
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/regrtest.py, line 
1560, in main_in_temp_cwd
main()
  File 
/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/regrtest.py, line 
736, in main
raise Exception(Child error on {}: {}.format(test, result[1]))
Exception: Child error on test_asyncio: Exit code 1
*** [buildbottest] Error code 1

--

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



[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2013-11-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Given the time frame, how about we just go with Serhiy's suggestion of a known 
non-Unicode codec internal blacklist for both 3.3 and 3.4?

I still like the idea of exposing codec type maps for introspection, but 
designing a decent API for that which also handles type preserving codecs is 
going to take some work, and can't realistically be included in 3.4.

By my count, if we delay the blacklisting until after we do the codec lookup, 
there's only seven names we need to block:

 from codecs import lookup
 blacklist = base64 uu quopri hex bz2 zlib rot13.split()
 for name in blacklist:
... print(lookup(name).name)
... 
base64
uu
quopri
hex
bz2
zlib
rot-13

--
versions: +Python 3.3

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



[issue19647] unittest.TestSuite consumes tests

2013-11-19 Thread Michael Foord

Michael Foord added the comment:

The new behaviour is intentional, glad you've managed to work around it.

--
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2013-11-19 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 19.11.2013 12:38, Nick Coghlan wrote:
 
 Given the time frame, how about we just go with Serhiy's suggestion of a 
 known non-Unicode codec internal blacklist for both 3.3 and 3.4?

+1

--

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



[issue19647] unittest.TestSuite consumes tests

2013-11-19 Thread Stefan Holek

Stefan Holek added the comment:

I have some complex test fixtures that I have written tests for, and one of 
them started to fail because it assumed that the suite would still be valid 
after having run.

That said, I was able to work around the issue and if you don't care neither do 
I. ;-)

--

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



[issue19513] Use PyUnicodeWriter instead of PyAccu in repr(tuple) and repr(list)

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 99141ab08e21 by Victor Stinner in branch 'default':
Issue #19513: repr(tuple) now uses _PyUnicodeWriter for better performances
http://hg.python.org/cpython/rev/99141ab08e21

--

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



[issue19513] Use PyUnicodeWriter instead of PyAccu in repr(tuple) and repr(list)

2013-11-19 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Serhiy for your review.

I added a new _PyUnicodeWriter_WriteASCIIString() function to write the 
separator (, ) and the suffix (,)).

changeset:   87263:d1ca05428c38
user:Victor Stinner victor.stin...@gmail.com
date:Tue Nov 19 12:54:53 2013 +0100
files:   Include/unicodeobject.h Objects/listobject.c 
Objects/unicodeobject.c Python/formatter_unicode.c
description:
Add _PyUnicodeWriter_WriteASCIIString() function

--
resolution:  - fixed
status: open - closed

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



[issue19646] Use PyUnicodeWriter in repr(dict)

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3a354b879d1f by Victor Stinner in branch 'default':
Issue #19646: repr(dict) now uses _PyUnicodeWriter API for better performances
http://hg.python.org/cpython/rev/3a354b879d1f

--
nosy: +python-dev

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



[issue19646] Use PyUnicodeWriter in repr(dict)

2013-11-19 Thread STINNER Victor

STINNER Victor added the comment:

I added a new _PyUnicodeWriter_WriteASCIIString() function to reply to Serhiy's 
comment on Rietveld:
Perhaps it will be worth to add a helper function or macros  
_PyUnicodeWriter_WriteTwoAsciiChars()?

changeset:   87263:d1ca05428c38
user:Victor Stinner victor.stin...@gmail.com
date:Tue Nov 19 12:54:53 2013 +0100
files:   Include/unicodeobject.h Objects/listobject.c 
Objects/unicodeobject.c Python/formatter_unicode.c
description:
Add _PyUnicodeWriter_WriteASCIIString() function

Using this function, there is no need to create temporary colon (: ) or sep 
(, ) strings, performances are a little better with the final commit.

Common platform:
Timer info: namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, 
resolution=1e-09)
CFLAGS: -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes
Timer: time.perf_counter
Platform: Linux-3.9.4-200.fc18.x86_64-x86_64-with-fedora-18-Spherical_Cow
Python unicode implementation: PEP 393
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Bits: int=32, long=64, long long=64, size_t=64, void*=64

Platform of campaign pyaccu:
Python version: 3.4.0a4+ (default:99141ab08e21, Nov 19 2013, 13:10:27) [GCC 
4.7.2 20121109 (Red Hat 4.7.2-8)]
Timer precision: 39 ns
Date: 2013-11-19 13:10:28
SCM: hg revision=99141ab08e21 branch=default date=2013-11-19 12:59 +0100

Platform of campaign writer:
Python version: 3.4.0a4+ (default:3a354b879d1f, Nov 19 2013, 13:08:42) [GCC 
4.7.2 20121109 (Red Hat 4.7.2-8)]
Timer precision: 46 ns
Date: 2013-11-19 13:09:20
SCM: hg revision=3a354b879d1f tag=tip branch=default date=2013-11-19 13:07 
+0100

--+-+--
Tests |  pyaccu |    writer
--+-+--
{a: 1}  |  613 ns (*) | 338 ns (-45%)
dict(zip(abc, range(3)))    | 1.05 us (*) | 640 ns (-39%)
{%03d:abc for k in range(10)} |  635 ns (*) | 447 ns (-30%)
{%100d:abc for k in range(10)}    |  651 ns (*) | 424 ns (-35%)
{k:a for k in range(10**3)} |  233 us (*) | 132 us (-44%)
{k:abc for k in range(10**3)}   |  251 us (*) | 154 us (-39%)
{%100d:abc for k in range(10**3)} |  668 ns (*) | 412 ns (-38%)
{k:a for k in range(10**6)} |  268 ms (*) | 158 ms (-41%)
{k:abc for k in range(10**6)}   |  276 ms (*) | 163 ms (-41%)
{%100d:abc for k in range(10**6)} |  658 ns (*) | 422 ns (-36%)
--+-+--
Total |  544 ms (*) | 321 ms (-41%)
--+-+--

--

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



[issue19646] Use PyUnicodeWriter in repr(dict)

2013-11-19 Thread STINNER Victor

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


--
resolution:  - fixed
status: open - closed

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



[issue2927] expose html.parser.unescape

2013-11-19 Thread Ezio Melotti

Ezio Melotti added the comment:

Here's an updated patch that addresses comments on rietveld and adds a few more 
tests and docs.
I should also update the what's new, but I have other upcoming changes in the 
html package so I'll probably do it at the end.

Regarding your concern:
* if people are only using html.escape, then they will get a couple of extra 
imports, including all the html5 entities, and a re.compile;
* if people are using html.parser, they already have plenty of re.compiles 
there, and soon html.parser will use unescape too;
* if people are using html.entities they only get an extra re.compile;

Overall I don't think it's a big problem.

As a side node, the if '' in s: in the unescape function could be removed -- 
I'm not sure it brings any real advantage.  This could/should be proved by 
benchmarks.

--
Added file: http://bugs.python.org/file32700/issue2927-2.diff

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



[issue18861] Problems with recursive automatic exception chaining

2013-11-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Actually, this won't the subTest example because that actually *suppresses* the 
errors, and reports them later. Annotations only help when the exception is 
allowed to escape.

--

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



[issue19653] Generalize usage of _PyUnicodeWriter for repr(obj): add _PyObject_ReprWriter()

2013-11-19 Thread STINNER Victor

New submission from STINNER Victor:

The _PyUnicodeWriter API avoids creation of temporary Unicode strings and has 
very good performances to build Unicode strings with the PEP 393 (compact 
unicode string).

Attached patch adds a _PyObject_ReprWriter() function to avoid creation of 
tempory Unicode string while calling repr(obj) on containers like tuple, list 
or dict.

I did something similar for str%args and str.format(args).

To avoid the following code, we might add something to PyTypeObject, maybe a 
new tp_repr_writer field.

+if (PyLong_CheckExact(v)) {
+return _PyLong_FormatWriter(writer, v, 10, 0);
+}
+if (PyUnicode_CheckExact(v)) {
+return _PyUnicode_ReprWriter(writer, v);
+}
+if (PyList_CheckExact(v)) {
+return _PyList_ReprWriter(writer, v);
+}
+if (PyTuple_CheckExact(v)) {
+return _PyTuple_ReprWriter(writer, v);
+}
+if (PyList_CheckExact(v)) {
+return _PyList_ReprWriter(writer, v);
+}
+if (PyDict_CheckExact(v)) {
+return _PyDict_ReprWriter(writer, v);
+}

For example, repr(list(range(10))) ('[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]')  should 
only allocate one buffer of 37 bytes and then shink it to 30 bytes.

I guess that benchmarks are required to justify such changes.

--
files: repr_writer.patch
keywords: patch
messages: 203371
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Generalize usage of _PyUnicodeWriter for repr(obj): add 
_PyObject_ReprWriter()
versions: Python 3.4
Added file: http://bugs.python.org/file32701/repr_writer.patch

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



[issue19646] Use PyUnicodeWriter in repr(dict)

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Using this function, there is no need to create temporary colon (: ) or sep 
 (, ) strings, performances are a little better with the final commit.

I'm surprised that this has given such large effect. ;) I hoped only on more 
clear code.

--

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



[issue19646] Use PyUnicodeWriter in repr(dict)

2013-11-19 Thread STINNER Victor

STINNER Victor added the comment:

 I'm surprised that this has given such large effect. ;) I hoped only on more 
 clear code.

To be honest, I expected shorter code but worse performances using 
_PyUnicodeWriter_WriteASCIIString().

dict_repr() was not really super fast: it did call PyUnicode_FromString() at 
each call to decode :  and ,  from UTF-8. list_repr() and tuplerepr() kept 
,  separator cached in a static variable. This is probably why the code is 
now faster.

--

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



[issue19654] test_tkinter sporadic failures on x86 Tiger 3.x buildbot

2013-11-19 Thread STINNER Victor

New submission from STINNER Victor:

http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/7331/steps/test/logs/stdio

==
FAIL: test_debug (tkinter.test.test_tkinter.test_text.TextTest)
--
Traceback (most recent call last):
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/test_tkinter/test_text.py,
 line 22, in test_debug
self.assertEqual(text.debug(), 0)
AssertionError: '0' != 0

==
FAIL: test_insertborderwidth (tkinter.test.test_tkinter.test_widgets.EntryTest)
--
Traceback (most recent call last):
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/test_tkinter/test_widgets.py,
 line 329, in test_insertborderwidth
self.checkPixelsParam(widget, 'insertborderwidth', 0, 1.3, -2)
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/widget_tests.py, 
line 167, in checkPixelsParam
conv=conv1, **kwargs)
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/widget_tests.py, 
line 57, in checkParam
self.assertEqual2(widget[name], expected, eq=eq)
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/widget_tests.py, 
line 41, in assertEqual2
self.assertEqual(actual, expected, msg)
AssertionError: 0 != 1

==
FAIL: test_insertborderwidth 
(tkinter.test.test_tkinter.test_widgets.SpinboxTest)
--
Traceback (most recent call last):
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/test_tkinter/test_widgets.py,
 line 329, in test_insertborderwidth
self.checkPixelsParam(widget, 'insertborderwidth', 0, 1.3, -2)
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/widget_tests.py, 
line 167, in checkPixelsParam
conv=conv1, **kwargs)
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/widget_tests.py, 
line 57, in checkParam
self.assertEqual2(widget[name], expected, eq=eq)
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/tkinter/test/widget_tests.py, 
line 41, in assertEqual2
self.assertEqual(actual, expected, msg)
AssertionError: 0 != 1

--
assignee: ronaldoussoren
components: Macintosh, Tkinter
keywords: buildbot
messages: 203374
nosy: haypo, ronaldoussoren
priority: normal
severity: normal
status: open
title: test_tkinter sporadic failures on x86 Tiger 3.x buildbot
versions: Python 3.4

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



[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 130597102dac by Serhiy Storchaka in branch 'default':
Remove dead code committed in issue #12892.
http://hg.python.org/cpython/rev/130597102dac

--

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Eli Bendersky

New submission from Eli Bendersky:

It was mentioned in one of the recent python-dev threads that making the Python 
code-base simpler to encourage involvement of contributors is a goal, so I 
figured this may be relevant.

I've recently written a new parser for the ASDL specification language from 
scratch and think it may be beneficial to replace the existing parser we use:

* The existing parser uses an external parser-generator (Spark) that we carry 
around in the Parser/ directory; the new parser is a very simple stand-alone 
recursive descent, which makes it easier to maintain and doesn't require a 
familiarity with Spark.
* The new code is significantly smaller. ~400 LOC for the whole stand-alone 
parser (asdl.py) as opposed to 1200 LOC for the existing parser+Spark.
* The existing asdl.py is old code and was only superficially ported to Python 
3.x - this shows, and isn't a good example of using modern Python techniques. 
My asdl.py uses Python 3.4 with modern idioms like dict comprehensions, 
generators and enums.

For a start, it may be easier to review the parser separately and not as a 
patch file. I split it to a stand-alone project here: 
https://github.com/eliben/asdl_parser

The asdl.py there is a drop-in replacement for Parser/asdl.py; asdl_c.py is for 
Parser/asdl_c.py - with tiny modifications to interface the new parser (mainly 
getting rid of some Spark-induced quirks). The AST .c and .h files produced are 
identical. The repo also has some tests for the parser, which we may find 
useful in adding to the test suite or the Parser directory.

--
assignee: eli.bendersky
components: Build
messages: 203376
nosy: brett.cannon, eli.bendersky, ncoghlan
priority: normal
severity: normal
stage: patch review
status: open
title: Replace the ASDL parser carried with CPython
type: enhancement
versions: Python 3.5

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
nosy: +eric.snow

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



[issue19654] test_tkinter sporadic failures on x86 Tiger 3.x buildbot

2013-11-19 Thread Zachary Ware

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


--
nosy: +serhiy.storchaka

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



[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2013-11-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Attached is a proof of concept for the blacklist approach (for 3.4, but without 
the fixes needed for the transform codec handling tests in test_codecs)

This does have the potential to add a reasonable amount of additional overhead 
to encoding and decoding for shortstrings. Since it isn't obvious where to 
store a set for faster checking against the blacklist, it may be worth 
benchmarking this naive approach before doing something more complicated.

Regardless, I don't plan to take this further myself any time soon - I just 
wanted to give it a firm nudge in the direction of the blacklist approach by 
providing a proof of concept.

--
keywords: +patch
Added file: 
http://bugs.python.org/file32702/issue19619_blacklist_proof_of_concept.diff

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



[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2013-11-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Victor is still -1, so to Python 3.5 it goes.

--
versions: +Python 3.5 -Python 3.4

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



[issue19651] Mac OSX 10.9 segmentation fault 11 with Python 3.3.3

2013-11-19 Thread Ned Deily

Ned Deily added the comment:

Works for me using the python.org 3.3.3 64-/32-bit installer.  Are you using 
that Python 3.3.3?  Please show the results of typing the following commamds 
and substituting for python3.3 whatever command name you are using that 
causes the segfault.

python3.3 -c 'import sys;print(sys.version)'
python3.3 -c 'import readline;print(readline.__file__)'
ls -l $(python3.3 -c 'import readline;print(readline.__file__)')
python3.3
1
2
3
quit()

You should see:
$ python3.3 -c 'import sys;print(sys.version)'
3.3.3 (v3.3.3:c3896275c0f6, Nov 16 2013, 23:39:35)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
$ python3.3 -c 'import readline;print(readline.__file__)'
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/lib-dynload/readline.so
$ ls -l $(python3.3 -c 'import readline;print(readline.__file__)')
-rwxrwxr-x  1 root  admin  66472 Nov 16 23:40 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/lib-dynload/readline.so
$ python3.3
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 16 2013, 23:39:35)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.
 1
1
 2
2
 3
3
 quit()
$

--

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



[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2013-11-19 Thread STINNER Victor

STINNER Victor added the comment:

+/* A set would be faster, but when to build it, where to store it? */
+if (_PyUnicode_CompareWithId(codec_name, PyId_base64) == 0 ||
+_PyUnicode_CompareWithId(codec_name, PyId_uu) == 0 ||
+_PyUnicode_CompareWithId(codec_name, PyId_quopri) == 0 ||
+_PyUnicode_CompareWithId(codec_name, PyId_hex) == 0 ||
+_PyUnicode_CompareWithId(codec_name, PyId_bz2) == 0 ||
+_PyUnicode_CompareWithId(codec_name, PyId_zlib) == 0 ||
+PyUnicode_CompareWithASCIIString(codec_name, rot-13) == 0
+   ) {
+is_text_codec = 0;
+}

This is slow and not future proof. It would be faster and simpler to have two 
registries: a register only for bytes.decode()/str.encode() and another for 
custom codecs for codecs.encode/decode (or 
(bytes|str).transform()/untransform()).

So abc.encode(rot13) would simply fail with a LookupError.

--

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Eli Bendersky

Eli Bendersky added the comment:

FWIW, asdl_c.py could use some modernization, but I'll defer this to a later 
cleanup in order to do things gradually.

The same can be said for the Makefile rules - they can be simpler and more 
efficient (no need to invoke asdl_c / parse the ASDL twice, for example).

Incidentally, where would be a good place to put the ASDL tests? Can/should we 
reach into the Parser/ directory when running the Python regression tests (will 
this even work in an installed Python)? Or should I just plop asdl_test.py 
alongside asdl.py and mention that it should be run when asdl.py changes?

--

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Larry Hastings

Larry Hastings added the comment:

A week before beta?  How confident are you in this new parser?

--
nosy: +larry

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



[issue19654] test_tkinter sporadic failures on x86 Tiger 3.x buildbot

2013-11-19 Thread Ned Deily

Ned Deily added the comment:

There's something odd going on with that buildbot.  The failures are from 
Serhly's new tests.  For 10.4 Tiger, the buildbot should be running Tk 8.4.  It 
does seem to have a third-party Tcl and Tk installed in /Library/Frameworks, 
which is good, but the logs don't show exactly what patch level it is.  David, 
can you identify what patch levels of Tcl and Tk are installed?  more 
/Library/Frameworks/Tcl.framework/tclConfig.sh 
/Library/Frameworks/Tk.framework/tkConfig.sh should work.

--
nosy: +ned.deily

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



[issue19654] test_tkinter sporadic failures on x86 Tiger 3.x buildbot

2013-11-19 Thread Ned Deily

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


--
nosy: +db3l

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Eli Bendersky

Eli Bendersky added the comment:

Larry, ease your worries: note that I only tagged this on version 3.5!

That said, this parser runs during the build and produces a .h file and .c file 
- these partake in the build; I verified that the generated code is *identical* 
to before, so there's not much to worry about. Still, I don't see a reason to 
land this before the beta branches. I'll do it onto the default branch after 
this weekend (assuming the reviews come through).

--

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Mark Lawrence

Mark Lawrence added the comment:

Are we at beta for 3.5 already? :)

--
nosy: +BreamoreBoy

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



[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2013-11-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Future proofing is irrelevant at this point - this is just about what
can realistically be implemented in 3.4, not what can be implemented
with the luxury of several months to rearchitect the codec system (and
if we were going to do that, we'd just fix the type mapping
introspection problem).

There is no codec registry - there is only the default codec search
function, the encodings import namespace, the normalisation algorithm
and the alias dictionary.

It sounds to me like you still believe it is possible to stick the
genie back in the bottle and limit the codec system to what *you*
think is a good idea. It doesn't work like that - the codecs module
already provides a fully general data transformation system backed by
lazy imports, and that isn't going to change due to backwards
compatibility constraints. The only option we have is whether or not
we file off the rough edges and try to ease the transition for users
migrating from Python 2, where all of the standard library codecs fit
within the limits of the text model, so the general purpose codec
infrastructure almost never came into play. Getting rid of it is no
longer a realistic option - documenting it, improving the failure
modes and potentially adding some features (in Python 3.5+) are the
only improvements that are genuinely feasible.

--

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



[issue19651] Mac OSX 10.9 segmentation fault 11 with Python 3.3.3

2013-11-19 Thread John Dobson

John Dobson added the comment:

mysite $ python -c 'import sys;print(sys.version)'
3.3.3 (v3.3.3:c3896275c0f6, Nov 16 2013, 23:39:35)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
mysite $ python -c 'import readline;print(readline.__file__)'
/System/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/lib-dynload/readline.so
mysite $ ls -l $(python -c 'import readline;print(readline.__file__)')
-rwxrwxr-x  1 root  wheel  66400 13 May  2013 
/System/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/lib-dynload/readline.so
mysite $ python
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 16 2013, 23:39:35)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.
  1
1
  2
Segmentation fault: 11
mysite $

I don't get to enter the final 3, the segmentation fault happens after 
the second input line.

*John Dobson,*

http://my-rellies.blogspot.com
On 19/11/2013 14:26, Ned Deily wrote:
 Ned Deily added the comment:

 Works for me using the python.org 3.3.3 64-/32-bit installer.  Are you using 
 that Python 3.3.3?  Please show the results of typing the following commamds 
 and substituting for python3.3 whatever command name you are using that 
 causes the segfault.

 python3.3 -c 'import sys;print(sys.version)'
 python3.3 -c 'import readline;print(readline.__file__)'
 ls -l $(python3.3 -c 'import readline;print(readline.__file__)')
 python3.3
 1
 2
 3
 quit()

 You should see:
 $ python3.3 -c 'import sys;print(sys.version)'
 3.3.3 (v3.3.3:c3896275c0f6, Nov 16 2013, 23:39:35)
 [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
 $ python3.3 -c 'import readline;print(readline.__file__)'
 /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/lib-dynload/readline.so
 $ ls -l $(python3.3 -c 'import readline;print(readline.__file__)')
 -rwxrwxr-x  1 root  admin  66472 Nov 16 23:40 
 /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/lib-dynload/readline.so
 $ python3.3
 Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 16 2013, 23:39:35)
 [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
 Type help, copyright, credits or license for more information.
 1
 1
 2
 2
 3
 3
 quit()
 $

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue19651
 ___

--

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



[issue19651] Mac OSX 10.9 segmentation fault 11 with Python 3.3.3

2013-11-19 Thread Christian Heimes

Christian Heimes added the comment:

Your Python installation picks up the wrong readline module.

--
nosy: +christian.heimes

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



[issue19651] Mac OSX 10.9 segmentation fault 11 with Python 3.3.3

2013-11-19 Thread Ned Deily

Ned Deily added the comment:

Christian is correct. /System/Library/Frameworks is the location of the Apple 
supplied system Pythons and further Apple does not ship any version of Python 
3. So you should figure out how your /System/Library got altered and restore it 
to release state.

--

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



[issue19651] Mac OSX 10.9 segmentation fault 11 with Python 3.3.3

2013-11-19 Thread John Dobson

John Dobson added the comment:

Many thanks for your prompt assistance

--
resolution:  - invalid
status: open - closed

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



[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Blacklisting by name is slow and it prevents a user from defining a codec with 
blacklisted name.

What if just add private attribute (_not_text?) to unsafe codecs? If a codec 
has this attribute, than it should not be used it text encoding/decoding. 
Checking an attribute is much faster than comparing with a couple of strings.

Another possibility is an inheriting all unsafe codecs from special class.

--

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



[issue19652] test_asyncio: test_subprocess_send_signal() hangs on buildbot AMD64 Snow Leop 3.x

2013-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

The traceback is pretty useless. So is the title of the other bug report hangs 
for 1 hour (which just means it hangs forever but the test runner kills it 
after one hour).

We would need to run the tests with -v so at least we can pinpoint which of the 
600 or so tests in test_asyncio is failing.

PS. Off-topic: raise Exception(...) is poor coding style:
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 736, in main
raise Exception(Child error on {}: {}.format(test, result[1]))

--

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



[issue19652] test_asyncio: test_subprocess_send_signal() hangs on buildbot AMD64 Snow Leop 3.x

2013-11-19 Thread STINNER Victor

STINNER Victor added the comment:

Ah, it looks like the test uses a child process. The following issue has a 
similar problem, we don't know that status of the child process:
http://bugs.python.org/issue19564

I proposed a patch in this issue for multiprocessing, to enable also 
faulthandler in the child process.

We can probably do something similar in asyncio with child process (enable 
faulthandler in unit tests with a short timeout).

--

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



[issue19550] PEP 453: Windows installer integration

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e0c4a5b2b739 by Martin v. Löwis in branch 'default':
Issue #19550: Implement Windows installer changes of PEP 453 (ensurepip).
http://hg.python.org/cpython/rev/e0c4a5b2b739

--
nosy: +python-dev

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



[issue1098749] Single-line option to pygettext.py

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4fe87b5df2d0 by Andrew Kuchling in branch '3.3':
#1098749: re-word gettext docs to not encourage using pygettext so much.
http://hg.python.org/cpython/rev/4fe87b5df2d0

--
nosy: +python-dev

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



[issue1098749] Single-line option to pygettext.py

2013-11-19 Thread A.M. Kuchling

A.M. Kuchling added the comment:

I've applied a patch from #8502 that doesn't encourage the use of pygettext.py 
so strongly.

I raised the issue of deprecating pygettext.py on python-dev on Nov 11 2013; 
the thread starts at 
https://mail.python.org/pipermail/python-dev/2013-November/130123.html.  
Barry Warsaw and Philip Jenvey suggested deprecating it; Martin von Loewis was 
OK with continuing to maintain pygettext.  So I'll leave this issue open, in 
case anyone wants to review the patch and commit it.

--

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



[issue8502] support plurals in pygettext

2013-11-19 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Applied my documentation patch.

New changeset 4fe87b5df2d0 by Andrew Kuchling in branch '3.3':
#1098749: re-word gettext docs to not encourage using pygettext so much.
http://hg.python.org/cpython/rev/4fe87b5df2d0

--

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



[issue12585] distutils dereferences symlinks for zip but not for bztar/gztar target

2013-11-19 Thread Erik Purins

Erik Purins added the comment:

Note that the zipfile module does not include a dereference option, but tarfile 
does.

The following links to python examples show that users are writing zipfiles 
with symlinks, so it is possible to preserve them in a zip archive.

https://gist.github.com/kgn/610907
http://doeidoei.wordpress.com/2010/11/23/compressing-files-with-python-symlink-trouble/

Maybe the right start is to add a dereference option to zipfile module?

--
nosy: +epu

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


--
nosy: +skrah

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



[issue19550] PEP 453: Windows installer integration

2013-11-19 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I have now committed the changes to the installer. A demo installer can be 
found at

http://prof.beuth-hochschule.de/fileadmin/user/mvon_loewis/python-3.4.16027.msi

I'm skeptical about the lack of proper deinstallation: per convention, 
uninstallation of software ought to be clean on windows, i.e. return the 
system to the state it had before the installation.

Uninstallation currently isn't clean when pip installation is selected. I know 
this is what the PEP says, but I'm still unhappy, and I know that users will 
dislike it. So as a compromise, I made the installation of pip non-default, 
meaning that users have to opt into installing something that doesn't properly 
uninstall.

--
resolution:  - fixed
status: open - closed

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



[issue19541] ast.dump(indent=True) prettyprinting

2013-11-19 Thread anatoly techtonik

anatoly techtonik added the comment:

Implemented more advanced interface with filtering and tests - here - 
https://bitbucket.org/techtonik/astdump/

Right now the output is not so detailed, but it may change if the need arises.

--

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



[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2013-11-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Yes, a private attribute on CodecInfo is probably better - the rest of the
patch would stay the same, it would just check for that attribute instead
of particular names.

--

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



[issue19550] PEP 453: Windows installer integration

2013-11-19 Thread Nick Coghlan

Nick Coghlan added the comment:

That sounds reasonable to me - thanks!

--

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



[issue2927] expose html.parser.unescape

2013-11-19 Thread Ezio Melotti

Ezio Melotti added the comment:

Here is the last iteration with a few minor tweaks and a couple more tests.

--
stage: patch review - commit review
Added file: http://bugs.python.org/file32703/issue2927-3.diff

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



[issue19652] test_asyncio: test_subprocess_send_signal() hangs on buildbot AMD64 Snow Leop 3.x

2013-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

I cannot help you unless you tell me which specific test is failing. But once 
you have a proposed fix I will review it. Thanks for advocating for the 
minority platforms!

--

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



[issue19595] Silently skipped test in test_winsound

2013-11-19 Thread Zachary Ware

Zachary Ware added the comment:

I don't know that it's expected, but it doesn't appear to be unexpected.  
regrtest doesn't appear to know anything about expected failures or unexpected 
successes, mostly because both concepts appear at the individual test level 
while regrtest deals at the test module level.  unittest docs don't actually 
say what happens when an expected failure fails to fail.

As for this issue, it looks like the skipping of the test predates 
_have_soundcard and has_sound.  If there are no objections, I'll try the 
attached patch on default; if it causes failures, I'll try a 
'skipUnless(has_sound('SystemDefault')...', and if that work's I'll backport it 
to the other two branches.

--
assignee:  - zach.ware
keywords: +patch
stage: test needed - patch review
Added file: http://bugs.python.org/file32704/issue19595.diff

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



[issue19656] Add Py3k warning for non-ascii bytes literals

2013-11-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

PEP 3112 had added bytes literals in 2.6. But bytes literals in 2.x are just 
synonyms to 8-bit string literals and allow non-ascii characters, while bytes 
literals in 3.x allows only ascii characters. For better forward compatibility 
with 3.x the proposed patch adds Py3k syntax warning for non-ascii bytes 
literals in 2.7.

--
components: Interpreter Core
files: py3kwarn_nonascii_bytes_literals.patch
keywords: patch
messages: 203406
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add Py3k warning for non-ascii bytes literals
type: enhancement
versions: Python 2.7
Added file: 
http://bugs.python.org/file32705/py3kwarn_nonascii_bytes_literals.patch

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



[issue19636] Fix usage of MAX_PATH in posixmodule.c

2013-11-19 Thread Tim Golden

Tim Golden added the comment:

Fine with your volumepathname patch. The core of the code was contributed and I 
didn't check it too carefully as it clearly worked. (For some definition of 
worked).

--

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



[issue19449] csv.DictWriter can't handle extra non-string fields

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6e5afeada7ca by R David Murray in branch '3.3':
#19449: Handle non-string keys when generating 'fieldnames' error.
http://hg.python.org/cpython/rev/6e5afeada7ca

New changeset ee2c80eeca2a by R David Murray in branch 'default':
Merge: #19449: Handle non-string keys when generating 'fieldnames' error.
http://hg.python.org/cpython/rev/ee2c80eeca2a

New changeset e52d7b173ab5 by R David Murray in branch '2.7':
#19449: Handle non-string keys when generating 'fieldnames' error.
http://hg.python.org/cpython/rev/e52d7b173ab5

--
nosy: +python-dev

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



[issue19657] List comprehension conditional evaluation order seems backwards

2013-11-19 Thread Garrett Cooper

New submission from Garrett Cooper:

I was a bit surprised when I ran into this issue when porting some nose tests 
from Windows to Linux:

#!/usr/bin/env python
with open('/etc/services') as fd:
lines = fd.readlines()
lines.append('')
SERVICES = [line.split()[0] for line in lines
if (line and not line.startswith('#'))]

$ python list_comprehension.py
Traceback (most recent call last):
  File list_comprehension.py, line 5, in module
if (line and not line.startswith('#'))]
IndexError: list index out of range
$ python3.2 list_comprehension.py
Traceback (most recent call last):
  File list_comprehension.py, line 4, in module
SERVICES = [line.split()[0] for line in lines
  File list_comprehension.py, line 5, in listcomp
if (line and not line.startswith('#'))]
IndexError: list index out of range
$ python -V
Python 2.7.5
$ python3.2 -V
Python 3.2.5

This is occurring of course because the .split() is being done on an empty line.

The docs don't note (at least in the list comprehension section [*]) that 
if-statements are evaluated after the value is generated for the current index 
in the loop. This seems very backwards because generating a value could in fact 
be very expensive, whereas determining whether or not a precondition has been 
met should be less expensive.

What could/should be done is one of two things: 1. evaluation order should be 
clearly spelled out in the docs, or 2. the list comprehension handling code 
should be changed to support evaluating the conditional statements before 
calculating a result. Otherwise discouraging use of [map+]filter (at least 
pylint does that) seems incredibly unwise as I can get the functionality I want 
in a single line as opposed to an unrolled loop.

[*] http://docs.python.org/2/tutorial/datastructures.html#list-comprehensions

--
messages: 203409
nosy: yaneurabeya
priority: normal
severity: normal
status: open
title: List comprehension conditional evaluation order seems backwards

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



[issue2927] expose html.parser.unescape

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--

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



[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2013-11-19 Thread Brett Cannon

Brett Cannon added the comment:

That's not the right fix for that test failure. If exec_module() is not meant 
to set import-related attributes like __cached__ because import itself (through 
_SpecMethods.init_module_attrs()) then test_frozen needs to be updated to not 
expect such attributes.

Honestly test_frozen should probably either be rolled into 
test_importlib.frozen or deleted instead of existing separately.

--

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



[issue19449] csv.DictWriter can't handle extra non-string fields

2013-11-19 Thread R. David Murray

R. David Murray added the comment:

Thanks, Tomas and Vajrasky.  I tweaked the patch slightly: Thomas's fix was 
better, since it doesn't incur the overhead of the repr unless an an error is 
detected (a micro-optimization, true, but an easy one).  I also chose to only 
check that 'fieldnames' is mentioned in the non-variable exception text; 
exactly how the rest of the message text is worded is not part of the API.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue2927] expose html.parser.unescape

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7b9235852b3b by Ezio Melotti in branch 'default':
#2927: Added the unescape() function to the html module.
http://hg.python.org/cpython/rev/7b9235852b3b

--
nosy: +python-dev

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



[issue19657] List comprehension conditional evaluation order seems backwards

2013-11-19 Thread Peter Otten

Peter Otten added the comment:

I believe you are misinterpreting what you are seeing. Empty lines read from a 
file do not produce an empty string, you get \n instead which is true in a 
boolean context.

Try

[line.split()[0] for line in lines if line.strip() and not line.startswith(#)]

or add an extra check for all-whitespace line

[... if line and not line.isspace() and not line.startswith(#)]

--
nosy: +peter.otten

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



[issue2927] expose html.parser.unescape

2013-11-19 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the reviews!

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

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



[issue19657] List comprehension conditional evaluation order seems backwards

2013-11-19 Thread R. David Murray

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


--
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type:  - behavior

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



[issue18032] set methods should specify whether they consume iterators lazily

2013-11-19 Thread Dustin Haffner

Dustin Haffner added the comment:

I've made an attempt at patching set_issubset() to match the Python from 
Raymond's message. I've rearranged the set_issubset function so that it checks 
for a set/frozenset, dict, or iterable in that order. In the iterable case it 
will create a temporary set and add elements to it as it consumes them from the 
iterable, returning early when possible.

This is my first patch, please let me know how I may improve it!

--
keywords: +patch
nosy: +dhaffner
Added file: http://bugs.python.org/file32706/issubset_improvement.patch

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



[issue19654] test_tkinter sporadic failures on x86 Tiger 3.x buildbot

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We can add a print for a patchlevel.

--
keywords: +patch
Added file: http://bugs.python.org/file32707/test_tcl_patchlevel.patch

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



[issue14455] plistlib unable to read json and binary plist files

2013-11-19 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I for the most part agree with the comments and will provide an updated patch 
on thursday. Would you mind if I committed that without further review (due to 
cutting it awfully close to the deadline for beta 1)?

Some comments I want to reply to specifically:

* Can the code be simpler, with only one pass?

   Maybe, but not right now. 

* This is inconsistent with _flatten().

  I'll add a comment that explains why this is: _flatten (and this code) 
  can deal with arbitrary keys, but that is not supported by Apple's code.

  The type check in _write_object ensures that it is not possible to write
  archives that cannot be read back by Apple's Cocoa frameworks.

* unusual indentation (several times)

  I'll have to look at other stdlib code to find suitable indentation, this
  is indentation I've used in my code for a long time (I've also used 
  camelCase instead of pep8_style names for methods for a long time, which 
  is probably why I never noticed that I forgot to convert some method 
  name when cleaning up the naming conventions used in this module).

--

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



[issue14455] plistlib unable to read json and binary plist files

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It's too large and complicated patch. I would like to have a chance to quick 
review it before committing. You will have time to commit.

--

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I propose to include frame size in previous frame. This will twice decrease the 
number of file reads.

--

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +benjamin.peterson

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



[issue15204] Deprecate the 'U' open mode

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could anyone please review the patch?

--

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



[issue18615] sndhdr.whathdr could return a namedtuple

2013-11-19 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Ping, please review. I guess it is minimal enough to get into 3.4.

--

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



[issue16596] Skip stack unwinding when next, until and return pdb commands executed in generator context

2013-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

It's not fixed.  Let me paste in a session.  This uses the latest Tulip repo 
(simple_tcp_server.py was just added).  I've added import pdb; 
pdb.set_trace() to the top of the client() coroutine, to set a breakpoint (I'm 
a very unsophisticated pdb user :-).  I step over a yield-from, great.  Then I 
step into recv().  Note the final 'n' command.  This is at the return statement 
in recv().  At this point I expect to go back into the client() coroutine, but 
somehow the debugger loses control and the program finishes execution without 
giving control back.

bash-3.2$ ~/cpython/python.exe -m examples.simple_tcp_server
~/cpython/python.exe -m examples.simple_tcp_server
 /Users/guido/tulip/examples/simple_tcp_server.py(119)client()
- reader, writer = yield from asyncio.streams.open_connection(
(Pdb) n
n
 /Users/guido/tulip/examples/simple_tcp_server.py(120)client()
- '127.0.0.1', 12345, loop=loop)
(Pdb) 

 /Users/guido/tulip/examples/simple_tcp_server.py(122)client()
- def send(msg):
(Pdb) 

 /Users/guido/tulip/examples/simple_tcp_server.py(126)client()
- def recv():
(Pdb) 

 /Users/guido/tulip/examples/simple_tcp_server.py(132)client()
- send(add 1 2)
(Pdb) 

 add 1 2
 /Users/guido/tulip/examples/simple_tcp_server.py(133)client()
- msg = yield from recv()
(Pdb) s
s
--Call--
 /Users/guido/tulip/examples/simple_tcp_server.py(126)recv()
- def recv():
(Pdb) n
n
 /Users/guido/tulip/examples/simple_tcp_server.py(127)recv()
- msgback = (yield from reader.readline()).decode(utf-8).rstrip()
(Pdb) n
n
 /Users/guido/tulip/examples/simple_tcp_server.py(128)recv()
- print(  + msgback)
(Pdb) n
n
 3.0
 /Users/guido/tulip/examples/simple_tcp_server.py(129)recv()
- return msgback
(Pdb) n
n
 repeat 5 hello
 begin
 1. hello
 2. hello
 3. hello
 4. hello
 5. hello
 end
client task done: Task(_handle_client)result=None
bash-3.2$

--

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



[issue15204] Deprecate the 'U' open mode

2013-11-19 Thread Guido van Rossum

Changes by Guido van Rossum gu...@python.org:


--
nosy:  -gvanrossum, jackjansen

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



[issue9566] Compilation warnings under x64 Windows

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68fd86a83ece by Victor Stinner in branch 'default':
Issue #9566: compile.c uses Py_ssize_t instead of int to store sizes to fix
http://hg.python.org/cpython/rev/68fd86a83ece

--

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



[issue19617] Fix usage of Py_ssize_t type in Python/compile.c

2013-11-19 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I forgot to mention this issue number in the commit:
---
changeset:   87277:68fd86a83ece
tag: tip
user:Victor Stinner victor.stin...@gmail.com
date:Tue Nov 19 22:23:20 2013 +0100
files:   Python/compile.c
description:
Issue #9566: compile.c uses Py_ssize_t instead of int to store sizes to fix
compiler warnings on Windows 64-bit. Use Py_SAFE_DOWNCAST() where the final
downcast is needed.

The bytecode doesn't support integer parameters larger than 32-bit yet.
---

I added some more Py_SAFE_DOWNCAST() in the final commit.

--
resolution:  - fixed
status: open - closed

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



[issue19578] del list[a:b:c] doesn't handle correctly list_resize() failure

2013-11-19 Thread STINNER Victor

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


--
nosy: +skrah

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



[issue19658] inspect.getsource weird case

2013-11-19 Thread Ronny Pfannschmidt

New submission from Ronny Pfannschmidt:

got:
 l = {}
 import inspect
 exec(compile('def fun(): pass', '', 'exec'), l, l)
 inspect.getsource(l['fun'])
Traceback (most recent call last):
  File input, line 1, in module
  File /home/private/.local/lib/python3.3/inspect.py, line 726, in getsource
lines, lnum = getsourcelines(object)
  File /home/private/.local/lib/python3.3/inspect.py, line 715, in 
getsourcelines
lines, lnum = findsource(object)
  File /home/private/.local/lib/python3.3/inspect.py, line 553, in findsource
if not sourcefile and file[0] + file[-1] != '':
IndexError: string index out of range


expected:
 l = {}
 import inspect
 exec(compile('def fun(): pass', '', 'exec'), l, l)
 inspect.getsource(l['fun'])
Traceback (most recent call last):
  File input, line 1, in module
  File /home/private/.local/lib/python3.3/inspect.py, line 726, in getsource
lines, lnum = getsourcelines(object)
  File /home/private/.local/lib/python3.3/inspect.py, line 715, in 
getsourcelines
lines, lnum = findsource(object)
  File /home/private/.local/lib/python3.3/inspect.py, line 563, in findsource
raise IOError('could not get source code')
OSError: could not get source code

this is a extraction, it appears that python in certein circumstances creates 
code objects with that setup on its own,
im still further investigating

--
messages: 203426
nosy: Ronny.Pfannschmidt
priority: normal
severity: normal
status: open
title: inspect.getsource weird case
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue19617] Fix usage of Py_ssize_t type in Python/compile.c

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d3e85dfa46f by Victor Stinner in branch 'default':
Issue #9566, #19617: Fix compilation on Windows
http://hg.python.org/cpython/rev/8d3e85dfa46f

--
nosy: +python-dev

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



[issue9566] Compilation warnings under x64 Windows

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d3e85dfa46f by Victor Stinner in branch 'default':
Issue #9566, #19617: Fix compilation on Windows
http://hg.python.org/cpython/rev/8d3e85dfa46f

--

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



[issue19655] Replace the ASDL parser carried with CPython

2013-11-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

We could take the opportunity to ast scripts to a Tools/ subdir. Then you could 
use whatever it is test_tools.py uses.

--

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



[issue19626] test_email and Lib/email/_policybase.py failures with -OO

2013-11-19 Thread Francisco Martín Brugué

Francisco Martín Brugué added the comment:

Actual tip:
changeset: 87276:2012e85638d9
date: Tue Nov 19 11:43:38 2013 -0800

It's a fresh clone, then:
make clean
./configure --with-pydebug
make -j4
./python -OO -m test -v test_email

== CPython 3.4.0a4+ (default:2012e85638d9, Nov 19 2013, 22:40:39) [GCC 4.7.2]
==   Linux-3.2.0-4-amd64-x86_64-with-debian-7.2 little-endian
==   /home/ci/Prog/cpython_test/cpython/build/test_python_30828
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=2, 
dont_write_bytecode=0, no_user_site=0, no_site=0, igno
re_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, 
isolated=0)
[1/1] test_email
test_b_case_ignored (test__encoded_words.TestDecode) ... ok

and so on


Ran 1516 tests in 8.313s

OK (skipped=1)
1 test OK.

--
nosy: +francismb
status: pending - open

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



[issue3158] Doctest fails to find doctests in extension modules

2013-11-19 Thread Zachary Ware

Zachary Ware added the comment:

Does this qualify as a new feature that needs to be in before beta 1?

--

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



[issue15204] Deprecate the 'U' open mode

2013-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Victor's comments.

--
Added file: http://bugs.python.org/file32708/deprecate-U-mode_2.patch

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



  1   2   >