[issue19667] Add the "htmlcharrefreplace" error handler

2013-11-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What should be done to make it more like you?

Paul Moore, Marc-Andre Lemburg, Ethan Furman and Terry Jan Reedy voted for it.

Steven D'Aprano proposed same idea on comp.python.general: 
http://comments.gmane.org/gmane.comp.python.general/742886 . And there are a 
number of implementations (partially buggy) in third-party code. One of them in 
CPython testsuite.

It would be good to have one standard implementation.

--
nosy: +ethan.furman, lemburg, pmoore, stevenjd, terry.reedy

___
Python tracker 

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



[issue19676] Add the "namereplace" error handler

2013-11-20 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #18234.

--

___
Python tracker 

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



[issue19676] Add the "namereplace" error handler

2013-11-20 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The proposed patch adds the "namereplace" error handler. This error handler is 
almost same as the "backslashreplace" error handler, but use \N{...} escape 
sequences if there is a character name in Unicode database. Result is a little 
more human-readable (but less portable) than with "backslashreplace".

>>> '∀ x∈ℜ'.encode('ascii', 'namereplace')
b'\\N{FOR ALL} x\\N{ELEMENT OF}\\N{BLACK-LETTER CAPITAL R}'

The proposition was discussed and bikeshedded on Python-Ideas: 
http://comments.gmane.org/gmane.comp.python.ideas/21296 .

--
components: Unicode
files: namereplace_errors.patch
keywords: patch
messages: 203579
nosy: ezio.melotti, haypo, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add the "namereplace" error handler
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32748/namereplace_errors.patch

___
Python tracker 

___
___
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-20 Thread Eric Snow

Eric Snow added the comment:

I've updated the TODO a little as well as cleaning up the XXX markers.  The 
relevant ones are mostly just open questions on implementation tweaks, so 
nothing major.  Otherwise my goal is to finish as much as possible of the 
non-critical items before the beta.

Brett: Any opinions on priority for the non-critical items?

Also, do you have a plan in mind for "Python can function w/ find_module(), 
find_loader(), and load_module() removed"?  Do you mean comment out the 
deprecated methods and see what happens?

--

___
Python tracker 

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



[issue19671] Option to select the optimization level on compileall

2013-11-20 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Hi. Since Python 3.2, compileall functions supports the optimization level 
through the `optimize` parameter. I guess you are using Python2.7 or so? Also, 
there's a note in compileall's documentation regarding the command line switch 
for the optimization level:

"
There is no command-line option to control the optimization level used by the 
compile() function, because the Python interpreter itself already provides the 
option: python -O -m compileall.
"
http://docs.python.org/3.2/library/compileall.html#command-line-use

--
nosy: +Claudiu.Popa

___
Python tracker 

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



[issue19674] Add introspection information for builtins

2013-11-20 Thread Larry Hastings

Larry Hastings added the comment:

I was deliberately trying to avoid something that a person might do by 
accident.  Also, "def (" is consistently only five bytes, whereas "pterodactyl 
(" or whatever will often be much longer, in case static data size is a concern.

But I could switch it to that if you think that's better.  Certainly it's a 
tiny amount more readable.

(I don't think this would make the docstrings compatible with sphinx autodoc 
though.)

--

___
Python tracker 

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



[issue19674] Add introspection information for builtins

2013-11-20 Thread Guido van Rossum

Guido van Rossum added the comment:

I think there's a similar but slightly different convention in Sphinx
autodoc -- the first line of the docstring can be "name(...)" . Isn't that
better than def?

--

___
Python tracker 

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



[issue19674] Add introspection information for builtins

2013-11-20 Thread Larry Hastings

Changes by Larry Hastings :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue19588] Silently skipped test in test_random

2013-11-20 Thread Julian Gindi

Julian Gindi added the comment:

That makes perfect sense :) Here is an updated patch. I also made the change to 
the other test of the same name in MersenneTwister_TestBasicOps

--
Added file: http://bugs.python.org/file32747/issue19588_v2.patch

___
Python tracker 

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



[issue19588] Silently skipped test in test_random

2013-11-20 Thread Tim Peters

Tim Peters added the comment:

Yup, the patch is semantically correct.  But I'd also swap the order of the 
`start =` and `stop =` lines - *everyone* expects `start` to be set first ;-)

--

___
Python tracker 

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



[issue19588] Silently skipped test in test_random

2013-11-20 Thread Zachary Ware

Zachary Ware added the comment:

Hmm, actually, I take it back...this is half of the needed patch :).  There's 
another test method of the same name in MersenneTwister_TestBasicOps, with the 
same issue.  But this half looks good!  I'll leave a comment on Rietveld (which 
will send you a 'review' email) pointing out the other test.

--

___
Python tracker 

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



[issue19588] Silently skipped test in test_random

2013-11-20 Thread Julian Gindi

Julian Gindi added the comment:

Awesome! I signed the contributor agreement today via "E-sign". I look forward 
to making more significant contributions soon :)

--

___
Python tracker 

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



[issue19588] Silently skipped test in test_random

2013-11-20 Thread Zachary Ware

Zachary Ware added the comment:

The patch looks good to me, Julian.  Have you signed a contributor agreement?  
If you haven't done so yet and are planning on contributing anything more than 
the most trivial of changes, you'll need to do so (see 
http://www.python.org/psf/contrib/).

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread Nick Coghlan

Nick Coghlan added the comment:

Yes, a PEP for 3.5 on this will be valuable, whether it's accepted or not
(although I personally favour moving these restrictions out of the compiler
and into the PEP 8 style guide).

If I recall the past python-ideas threads correctly, the main objections to
the current syntax restrictions were:

- you can't look up decorators through a registry by default, since
"@registry[name]" is disallowed
- it's not really a limitation anyway, since a pass through function still
lets you write whatever you want:

def deco(x): return x

@deco(registry[name])
def f(): ...

Now that the precedent of keeping decorator expressions simple has been
well and truly established, simplification of the grammar is the main
reason removing the special casing of decorator syntax from the compilation
toolchain appeals to me.

--

___
Python tracker 

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



[issue19661] AIX: Python: RuntimeError "invalid slot offset when importing a module" in _ssl module

2013-11-20 Thread David Edelsohn

David Edelsohn added the comment:

Can you try compiling the module using xlc_r without -O ? One possible guess is 
XLC optimizations can speculate through NULL pointers because AIX maps address 
0 as valid in processes. I don't know why Python is finding an invalid value in 
the structure.

--

___
Python tracker 

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



[issue18379] SSLSocket.getpeercert(): OCSP and CRL DP URIs

2013-11-20 Thread Christian Heimes

Christian Heimes added the comment:

memo to me: update whatsnew

--
assignee:  -> christian.heimes
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue18379] SSLSocket.getpeercert(): OCSP and CRL DP URIs

2013-11-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 468d18bffdea by Christian Heimes in branch 'default':
Issue #18379: SSLSocket.getpeercert() returns CA issuer AIA fields, OCSP
http://hg.python.org/cpython/rev/468d18bffdea

--
nosy: +python-dev

___
Python tracker 

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



[issue18138] ctx.load_verify_locations(cadata)

2013-11-20 Thread Christian Heimes

Christian Heimes added the comment:

Memo to me: update whatsnew

--
assignee:  -> christian.heimes
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue18138] ctx.load_verify_locations(cadata)

2013-11-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 234e3c8dc52f by Christian Heimes in branch 'default':
Issue #18138: Implement cadata argument of SSLContext.load_verify_location()
http://hg.python.org/cpython/rev/234e3c8dc52f

--
nosy: +python-dev

___
Python tracker 

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



[issue19599] Failure of test_async_timeout() of test_multiprocessing_spawn: TimeoutError not raised

2013-11-20 Thread koobs

koobs added the comment:

koobs-freebsd10 (2.7) is also seeing identical test failures since the change 
(slightly more intermittent than freebsd9)

Is the increased sleep period now bumping against a test timing threshold (0.2) 
? 

==
FAIL: test_terminate (test.test_multiprocessing.WithThreadsTestPool)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/koobs-freebsd10/2.7.koobs-freebsd10/build/Lib/test/test_multiprocessing.py",
 line 1194, in test_terminate
self.assertTrue(join.elapsed < 0.2)
AssertionError: False is not true

--

Full build log of #236 attached

Adding 3.3 and 2.7 to versions since changes were backported

--
versions: +Python 2.7, Python 3.3
Added file: http://bugs.python.org/file32746/koobs-freebsd10-py27-build236.log

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread James Powell

Changes by James Powell :


Added file: http://bugs.python.org/file32745/decorator-syntax.patch

___
Python tracker 

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



[issue8813] SSLContext doesn't support loading a CRL

2013-11-20 Thread Christian Heimes

Christian Heimes added the comment:

The patch implements SSLContext.verify_flags in order to enable CRL checks. It 
comes with documentation, a unit test and a new CRL file.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file32744/verify_flags_crl.patch

___
Python tracker 

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



[issue19661] Python: RuntimeError: invalid slot offset when importing a module

2013-11-20 Thread STINNER Victor

STINNER Victor added the comment:

This warning is interesting:

 "/aix/Modules/_ssl.c", line 262.17: 1506-196 (W) Initialization between types 
"void*" and "struct _object*(*)(struct {...}*)" is not allowed.

It looks like the following line:

static PyType_Slot sslerror_type_slots[] = {
{Py_tp_base, NULL},  /* Filled out in module init as it's not a constant */ 
<= HERE =
{Py_tp_doc, SSLError_doc},
{Py_tp_str, SSLError_str},
{0, 0},
};

NULL is replaced in PyInit__ssl():

sslerror_type_slots[0].pfunc = PyExc_OSError;

--
nosy: +haypo

___
Python tracker 

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



[issue19661] AIX: Python: RuntimeError "invalid slot offset when importing a module" in _ssl module

2013-11-20 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Python: RuntimeError: invalid slot offset when importing a module -> 
AIX: Python: RuntimeError "invalid slot offset when importing a module" in _ssl 
module

___
Python tracker 

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



[issue19661] Python: RuntimeError: invalid slot offset when importing a module

2013-11-20 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue19599] Failure of test_async_timeout() of test_multiprocessing_spawn: TimeoutError not raised

2013-11-20 Thread koobs

koobs added the comment:

2.7 builds are failing on koobs-freebsd9 buildbot since ba7d53b5f3de


test_multiprocessing
[74777 refs]
test test_multiprocessing failed -- Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd9/build/Lib/test/test_multiprocessing.py",
 line 1194, in test_terminate
self.assertTrue(join.elapsed < 0.2)
AssertionError: False is not true

1 test failed:
test_multiprocessing


Full log of build #116 attached.

--
nosy: +koobs
Added file: http://bugs.python.org/file32743/koobs-freebsd9-py27-build116.log

___
Python tracker 

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



[issue19666] Format string for ASCII unicode or bytes-like object as readonly buffer

2013-11-20 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo, skrah

___
Python tracker 

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



[issue19668] Add support of the cp1125 encoding

2013-11-20 Thread STINNER Victor

STINNER Victor added the comment:

> The proposed patch adds support of the CP1125 encoding.

Nowadays, a good motivation for supporting a new codec is to be able to start 
Python 3. For example, I added cp65001 because some using try Python 3 with 
this Windows code page.

It looks like at least one user is unable to start Python 3 because he/she uses 
GEORGIAN-PS as the locale encoding (issue #19459).

For cp1125: is it used as the ANSI code page on Windows? Otherwise, how do you 
use this encoding.

Supporting all encodings in the world is meaningless because they are too many 
encodings.

--
nosy: +loewis

___
Python tracker 

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



[issue19675] Pool dies with excessive workers, but does not cleanup

2013-11-20 Thread Ned Deily

Changes by Ned Deily :


--
keywords: +patch
nosy: +sbt

___
Python tracker 

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



[issue19668] Add support of the cp1125 encoding

2013-11-20 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #19459.

--

___
Python tracker 

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



[issue6490] os.popen documentation is probably wrong

2013-11-20 Thread Martin Panter

Martin Panter added the comment:

Also it would be good to document that it returns a text stream, not a binary 
stream.

--

___
Python tracker 

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



[issue19675] Pool dies with excessive workers, but does not cleanup

2013-11-20 Thread Dustin Oprea

New submission from Dustin Oprea:

If you provide a number of processes to a Pool that the OS can't fulfill, Pool 
will raise an OSError and die, but does not cleanup any of the processes that 
it has forked.

This is a session in Python where I can allocate a large, but fulfillable, 
number of processes (just to exhibit what's possible in my current system):

>>> from multiprocessing import Pool
>>> p = Pool(500)
>>> p.close()
>>> p.join()

Now, this is a request that will fail. However, even after this fails, I can't 
allocate even a single worker:

>>> p = Pool(700)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py",
 line 232, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py",
 line 159, in __init__
self._repopulate_pool()
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py",
 line 222, in _repopulate_pool
w.start()
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py",
 line 130, in start
self._popen = Popen(self)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/forking.py",
 line 121, in __init__
self.pid = os.fork()
OSError: [Errno 35] Resource temporarily unavailable

>>> p = Pool(1)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py",
 line 232, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py",
 line 159, in __init__
self._repopulate_pool()
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py",
 line 222, in _repopulate_pool
w.start()
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py",
 line 130, in start
self._popen = Popen(self)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/forking.py",
 line 121, in __init__
self.pid = os.fork()
OSError: [Errno 35] Resource temporarily unavailable

The only way to clean this up is to close the parent (the interpreter).

I'm submitting a patch for 2.7.6 that intercepts exceptions and cleans-up the 
workers before bubbling. The affected method is _repopulate_pool(), and appears 
to be the same in 2.7.6, 3.3.3, and probably every other recent version of 
Python.

This is the old version:

for i in range(self._processes - len(self._pool)):
w = self.Process(target=worker,
 args=(self._inqueue, self._outqueue,
   self._initializer,
   self._initargs, self._maxtasksperchild)
)
self._pool.append(w)
w.name = w.name.replace('Process', 'PoolWorker')
w.daemon = True
w.start()
debug('added worker')

This is the new version:

try:
for i in range(self._processes - len(self._pool)):
w = self.Process(target=worker,
 args=(self._inqueue, self._outqueue,
   self._initializer,
   self._initargs, self._maxtasksperchild)
)
self._pool.append(w)
w.name = w.name.replace('Process', 'PoolWorker')
w.daemon = True
w.start()
debug('added worker')
except:
debug("Process creation error. Cleaning-up (%d) workers." % 
(len(self._pool)))

for process in self._pool:
if process.is_alive() is False:
continue

process.terminate()
process.join()

debug("Processing cleaning-up. Bubbling error.")
raise

This is what happens, now: I can go from requesting a number that's too high to 
immediately requesting one that's also high but within limits, and there's now 
no problem as all resources have been freed:

>>> from multiprocessing import Pool
>>> p = Pool(700)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py",
 line 232, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py",
 line 159, in __init__
self._repopulate_pool()
  File 
"/System/Library/Frameworks/Python.framework

[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread James Powell

James Powell added the comment:

I see this as removing a restriction and a special-case from the
decorator syntax (noting, of course, that these were introduced
deliberately.)

In terms of whether the new forms are improvements, my preference is to
leave this up to the judgement of the programmer, moderated of course by
their prevailing coding guide.

I would argue that this change does not force any additional complexity
on the programmer (who is free to take or leave it) or on the
interpreter (- the straightforwardness of the patch corroborates this.)

I would also argue that there are certainly cases where, in the midst of
some large codebase, the dotted_name restriction may seem a bit arbitrary.

This is likely true for:

class Foo:
def bar(self, func):
return func

@staticmethod
def baz(func):
return func

@staticmethod
def quux():
def dec(func):
return func
return dec

# invalid
@Foo().bar
def f(): pass

# valid
@Foo.baz
def f(): pass

# valid
@Foo.quux()
def f(): pass

For completeness' sake, I have attached a patch with an additional unit
test and amended documentation.

Should we proceed with writing a PEP for Python 3.5?

--
Added file: http://bugs.python.org/file32741/decorator-syntax.patch

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread Eric Snow

Eric Snow added the comment:

> they make the decorator harder to read.

I agree.

--
nosy: +eric.snow

___
Python tracker 

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



[issue19673] PEP 428 implementation

2013-11-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

New patch with a whatsnew entry.

--
Added file: http://bugs.python.org/file32740/pathlib2.patch

___
Python tracker 

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



[issue17951] TypeError during gdb backtracing

2013-11-20 Thread Julian Gindi

Julian Gindi added the comment:

Could you provide some more details on how to reproduce this issue? If I am 
able to reproduce the issue, I'll write a few unit tests and get this patch 
rolling again.

--
nosy: +Julian.Gindi

___
Python tracker 

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



[issue19674] Add introspection information for builtins

2013-11-20 Thread Larry Hastings

Larry Hastings added the comment:

(Well, except for Object/methodobject.c.)

--

___
Python tracker 

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



[issue19674] Add introspection information for builtins

2013-11-20 Thread Larry Hastings

Larry Hastings added the comment:

If you review, you can ignore the changes to the .c files, those only got 
touched because of the new autogenerated "def (" lines in the docstrings.  No 
other changes there.

--

___
Python tracker 

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



[issue19674] Add introspection information for builtins

2013-11-20 Thread Larry Hastings

New submission from Larry Hastings:

Let's see if we can get introspection information for builtins using the Clinic 
for 3.4.

Georg suggested part of the approach while we were hanging out in Tokyo.  I'd 
considered it previously before but dispensed with the idea because it seemed 
too loopy.  Actually it seems to work great.  

The approach:

* Clinic generates an extra first line for the docstring, that looks like "def 
(...)\n".  (Note: no function name!)

* The PyCFunctionObject __doc__ getter detects this line and skips it if 
present.

* Add a new getter to PyCFunctionObject, which I've called "__textsig__", that 
returns this first line if present in the docstring.  (It skips the "def " at 
the front, and clips it at the newline.)

* inspect now notices if it's passed in a PyCFunctionObject.  If it gets one, 
it checks to see if it has a valid __textsig__.  If it does, it parses it 
(using ast.parse) and produces a valid signature.

Advantages of this approach:
* It was easy to do and took very few lines of code.

* For signatures that are impossible to convert to Clinic, we can
  write the metadata by hand.

Disadvantages of this approach:
* Uh, nothing, really!

The next step is probably to convert pydoc to use inspect.signature instead of 
the manky old methods it currently uses.  After that, clean up the patch, and 
add a unit test or two.

What do you think?

--
assignee: larry
components: Interpreter Core
files: larry.introspection.for.builtins.patch.1.txt
messages: 203549
nosy: brett.cannon, georg.brandl, gvanrossum, larry
priority: normal
severity: normal
stage: patch review
status: open
title: Add introspection information for builtins
type: behavior
versions: Python 3.4
Added file: 
http://bugs.python.org/file32739/larry.introspection.for.builtins.patch.1.txt

___
Python tracker 

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



[issue1065986] Fix pydoc crashing on unicode strings

2013-11-20 Thread Akira Kitada

Akira Kitada added the comment:

Good catch. Fixed.

--
Added file: http://bugs.python.org/file32738/issue1065986-5.patch

___
Python tracker 

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



[issue19672] Listing of all exceptions for every function

2013-11-20 Thread Sworddragon

Sworddragon added the comment:

Correct, but the second part of my last message was just my opinion that I 
would prefer error codes over exceptions because it implies already a completed 
documentation for this part due to return codes/error arguments/other potential 
ways.

--

___
Python tracker 

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



[issue19672] Listing of all exceptions for every function

2013-11-20 Thread R. David Murray

R. David Murray added the comment:

If switching to error codes would solve your problem, then catching Exception 
at appropriate places should also solve your problem.

--

___
Python tracker 

___
___
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-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +larry
priority: high -> release blocker

___
Python tracker 

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



[issue19672] Listing of all exceptions for every function

2013-11-20 Thread Sworddragon

Sworddragon added the comment:

I'm fine with this decision as it will be really much work. But this also means 
programming with Python isn't considered for high stability applications - due 
to the lack of important informations in the documentation.

An alternate way would be to rely on error codes and abandon exceptions. But 
this would be a case for a PEP and I'm assuming that it is absolutely 
unrealistic that this will be changed.

--

___
Python tracker 

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



[issue19672] Listing of all exceptions for every function

2013-11-20 Thread R. David Murray

R. David Murray added the comment:

This is not something we are going to do.  We don't know what every exception 
is that every function can raise.

Adding mentions of unusual special cases that aren't currently documented would 
be OK, though.  You should open specific issues for things you think should be 
clarified.

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

___
Python tracker 

___
___
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-20 Thread Guido van Rossum

Guido van Rossum added the comment:

This version works beautifully in that scenario!

Does anyone else reading this bug report object to this being committed?

--

___
Python tracker 

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



[issue19667] Add the "htmlcharrefreplace" error handler

2013-11-20 Thread Ezio Melotti

Ezio Melotti added the comment:

As I wrote in the thread, I don't like this too much.

--

___
Python tracker 

___
___
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-20 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue18138] ctx.load_verify_locations(cadata)

2013-11-20 Thread Christian Heimes

Christian Heimes added the comment:

Final patch

--
title: ssl.SSLContext.add_cert() -> ctx.load_verify_locations(cadata)
Added file: http://bugs.python.org/file32737/ssl_cadata2.patch

___
Python tracker 

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



[issue19673] PEP 428 implementation

2013-11-20 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Here is a patch integrating pathlib and its docs.
Note that this was already briefly reviewed by Guido.

--
components: Library (Lib)
files: pathlib.patch
keywords: patch
messages: 203540
nosy: larry, pitrou
priority: release blocker
severity: normal
stage: patch review
status: open
title: PEP 428 implementation
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32736/pathlib.patch

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't feel very strongly, but I do think that most of the things the new 
syntax allows are not improvements -- they make the decorator harder to read. 
It was intentional to force you to compute a variable before you can use it as 
a decorator, e.g.

spamify = (spam if p else eggs)

@spamify
def f():
pass

--
nosy: +gvanrossum

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread Nick Coghlan

Nick Coghlan added the comment:

Nice! As a syntax change (albeit a minor one), I believe this will require a 
PEP for Python 3.5.

I know Guido indicated he was OK with relaxing the current restrictions, but I 
don't remember exactly where he said it, or how far he was willing to relax 
them.

--
nosy: +Guido.van.Rossum
versions:  -Python 3.4

___
Python tracker 

___
___
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-20 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

___
___
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-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Hopefully issue16596_nostate_4.diff should fix this.
The patch issues a StopIteration debug event in ceval.c (similar to the change 
made in the previous
patch for the for loop), when the subgenerator is exhausted. This debug event 
is printed as
'Internal StopIteration' by pdb to indicate that it is not a real user 
exception. Two tests have
been added: test 'next' when returning from a generator in a for loop and 
'test' next when returning
from a subgenerator.

--
Added file: http://bugs.python.org/file32735/issue16596_nostate_4.diff

___
Python tracker 

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



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

2013-11-20 Thread STINNER Victor

STINNER Victor added the comment:

pack.patch: Patch to pack frame_t structure.

I tested tracemalloc with packed structure on Linux/AMD64, FreeBSD/AMD64, 
OpenBSD/AMD64, OpenIndiana/AMD64, Windows/x86 (Windows 7 64-bit with Python 
compiled in 32-bit). I don't have access to SPARC.

--
Added file: http://bugs.python.org/file32734/pack.patch

___
Python tracker 

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



[issue19672] Listing of all exceptions for every function

2013-11-20 Thread Sworddragon

New submission from Sworddragon:

Currently the documentation does sometimes say about specific exceptions but 
most times not. As I'm often catching exceptions to ensure a high stability 
this gets a little difficult. For example print() can trigger a BrokenPipeError 
and the most file functions like flush() can trigger other related IOError's.

So I would like to see something like a listing on every function which 
contains all exceptions that may appear. Also there are some special cases like 
close(). For example it can trigger an IOError too if there are pending write 
operations due to an implicit call of flush(). But if the file object is opened 
in read-only mode or there are no write operations this can't happen. Maybe 
such additional information can be added too.

--
assignee: docs@python
components: Documentation
messages: 203535
nosy: Sworddragon, docs@python
priority: normal
severity: normal
status: open
title: Listing of all exceptions for every function
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker 

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



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

2013-11-20 Thread STINNER Victor

STINNER Victor added the comment:

Charles-François doesn't like packed structure (frame_t) because he fears crash 
on architectures not supporting non-aligned memory access or bad performances. 
Antoine and me want them to reduce the memory footprint of the tracemalloc 
module (tracemalloc.get_tracemalloc_memory()).

I think that the memory footprint has an higher price than the performances for 
tracemalloc: I can wait longer for a result, whereas I may not be able to use 
tracemalloc if it uses too much memory.

I propose to pack frame_t structure, and only disable it explicitly on 
architectures where tracemalloc does crash. What do you think?

--

___
Python tracker 

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



[issue13633] Automatically convert character references in HTMLParser

2013-11-20 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue19671] Option to select the optimization level on compileall

2013-11-20 Thread Sworddragon

New submission from Sworddragon:

Currently on calling one of the compileall functions it is not possible to pass 
the optimization level as argument. The bytecode will be created depending of 
the optimization level of the current script instance. But if a script wants to 
compile .pyc files for one destination and .pyo files for another destination 
this will be a little tricky.

--
components: Library (Lib)
messages: 203533
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: Option to select the optimization level on compileall
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +ncoghlan -nick

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread Éric Araujo

Éric Araujo added the comment:

On second thought, as this patch allows one form that Guido doesn’t want 
(bar().foo()), maybe there should be a discussion on python-ideas.

--
nosy: +nick

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread Éric Araujo

Éric Araujo added the comment:

Thanks for this!  Tests should exercise the now-valid syntaxes, which also need 
documentation.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue1065986] Fix pydoc crashing on unicode strings

2013-11-20 Thread Éric Araujo

Éric Araujo added the comment:

LGTM.

One thing: did you mean assertEqual in Lib/test/test_pydoc.py:466: 
self.assertTrue(open('pipe').read(), pydoc._encode(doc))
?

--

___
Python tracker 

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



[issue19669] remove mention of the old LaTeX docs

2013-11-20 Thread Ezio Melotti

Ezio Melotti added the comment:

SGTM.

--
keywords: +easy
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue19670] SimpleCookie Generates Non-RFC6265-Compliant Cookies

2013-11-20 Thread Patrick Bogen

New submission from Patrick Bogen:

SimpleCookie uses _quote to quote cookie values, which converts special 
characters to \OCTAL notation. This is not RFC6265 compliance, which requires- 
in part- that cookie values do not contain backslashes:

 cookie-value  = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
 cookie-octet  = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
   ; US-ASCII characters excluding CTLs,
   ; whitespace DQUOTE, comma, semicolon,
   ; and backslash

--
components: Library (Lib)
messages: 203529
nosy: pdbogen
priority: normal
severity: normal
status: open
title: SimpleCookie Generates Non-RFC6265-Compliant Cookies
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue19669] remove mention of the old LaTeX docs

2013-11-20 Thread Antoine Pitrou

New submission from Antoine Pitrou:

The devguide mentions the old LaTeX doc format:
http://docs.python.org/devguide/documenting.html#differences-to-the-latex-markup

This doesn't really sound useful anymore, so many years later.

--
assignee: docs@python
components: Devguide, Documentation
messages: 203527
nosy: docs@python, ezio.melotti, fdrake, georg.brandl, pitrou
priority: low
severity: normal
status: open
title: remove mention of the old LaTeX docs

___
Python tracker 

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



[issue19572] Report more silently skipped tests as skipped

2013-11-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

skiptest_not_return_or_pass.v4-3.3.diff LGTM.

--

___
Python tracker 

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



[issue19664] UserDict test assumes ordered dict repr

2013-11-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I don't know for sure--I haven't stepped through it--but here's an
> informed guess.  It relies on key collision.

Ok, I see. The frequency of the errors then depends on the frequency of
collisions for two fixed keys and a varying hash seed...

--

___
Python tracker 

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



[issue19668] Add support of the cp1125 encoding

2013-11-20 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The proposed patch adds support of the CP1125 encoding.

The CP1125 encoding (also known as IBM866, CP866U (in Microsoft), 866nav (in 
TeX), RUSCII) is standard DOS encoding for Ukrainian language. It is only one 
DOS encoding (or at least most popular) suitable for Ukrainian. It is Ukrainian 
government standard for DOS. The CP1125 encoding differs from CP866 encoding 
only in 6 codes for Ukrainian letters.

http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp01125z.pdf
http://cp866u.codeplex.com/
ftp://tug.org/texlive/Contents/live/texmf-dist/tex/latex/cyrillic/cp866nav.def
http://segfault.kiev.ua/cyrillic-encodings/#ruscii

--
components: Unicode
files: encoding_cp1125.patch
keywords: patch
messages: 203523
nosy: doerwalter, ezio.melotti, haypo, lemburg, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add support of the cp1125 encoding
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32733/encoding_cp1125.patch

___
Python tracker 

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



[issue19664] UserDict test assumes ordered dict repr

2013-11-20 Thread Larry Hastings

Larry Hastings added the comment:

I don't know for sure--I haven't stepped through it--but here's an informed 
guess.  It relies on key collision.

The first dict is created the normal way.  It contains two values, "one" (set 
to 1) and "two" (set to 2), inserted in that order.

The second dict is created by calling dict.update(), passing in the first dict. 
 update() iterates over the keys of the dict's hash table with a simple for(;;) 
loop, copying the key and value each time.  The order is effectively random.

The repr() then iterates over the keys using the same simple for(;;) loop, 
spitting out key=value strings.

Let's assume that the keys collide.  "one" is inserted first, so it gets its 
first choice.  "two" is inserted second so it must probe.  Let's assume that 
its second choice is a key slot *lower* (nearer to [0]) than "one".

Now when we use update(), the for(;;) loop sees "two" first.  So "two" gets its 
first choice, which means "one" must now probe.  If "one"'s second choice is a 
key slot *higher* (further from [0]) than "two", we'll see the behavior.

(Why does this only happen sometimes?  Because we're using "hash 
randomization".)

--

___
Python tracker 

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



[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-11-20 Thread R. David Murray

Changes by R. David Murray :


Added file: http://bugs.python.org/file32732/support_8bit_charset_cte.patch

___
Python tracker 

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



[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-11-20 Thread R. David Murray

Changes by R. David Murray :


Removed file: http://bugs.python.org/file32730/support_8bit_charset_cte.patch

___
Python tracker 

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



[issue18138] ssl.SSLContext.add_cert()

2013-11-20 Thread Christian Heimes

Christian Heimes added the comment:

I think the patch in #16487 does too many things at once. The new patch is a 
draft for a new patch that adds SSLContext.load_verify_locations(cadata) to the 
SSL module. cadata can be a bunch of PEM encoded certs (ASCII) or DER encoded 
certs (bytes-like). The patch may contain bugs as I haven't verified all error 
paths yet.

--
Added file: http://bugs.python.org/file32731/ssl_cadata.patch

___
Python tracker 

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



[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-11-20 Thread R. David Murray

R. David Murray added the comment:

Vajrasky: thanks for taking a crack at this, but, well, there are a lot of 
subtleties involved here, due to the way the organic growth of the email 
package over many years has led to some really bad design issues.

It took me a lot of time to boot back up my understanding of how all this stuff 
hangs together (answer: badly).  After wandering down many blind alleys, the 
problem turns out to be yet one more disconnect in the model.  We previously 
fixed the issue where if set_payload was passed binary data bad things would 
happen.  That made the model more consistent, in that _payload was now a 
surrogateescaped string when the payload was specified as binary data.

But what the model *really* needs is that _payload *always* be an 
ascii+surrogateescape string, and never a full unicode string.  (Yeah, this is 
a sucky model...it ought to always be binary instead, but we are dealing with 
legacy code here.)

Currently it can be a unicode string.  If it is, set_charset turns it into an 
ascii only string by encoding it with the qp or base64 CTE.  This is pretty 
much just by luck, though.

If you set body_encode to None what happens is that the encode_7or8bit encoder 
thinks the string is 7bit because it does get_payload(decode=True) which, 
because the model invariant was broken, turns into a raw-unicode-escape string, 
which is a 7bit representation.  That doesn't affect the payload, but it does 
result in wrong CTE being used.

The fix is to fix the model invariant by turning a unicode string passed in to 
set_payload into an ascii+surrogateescape string with the escaped bytes being 
the unicode encoded to the output charset.

Unfortunately it is also possible to call set_payload without a charset, and 
*then* call set_charset.  To keep from breaking the code of anyone currently 
doing that, I had to allow a full unicode _payload, and detect it in 
set_charset.

My plan is to fix that in 3.4, causing a backward compatibility break because 
it will no longer be possible to call set_payload with a unicode string 
containing non-ascii if you don't also provide a character set.  I believe this 
is an acceptable break, since otherwise you *must* leave the model in an 
ambiguous state, and you have the possibility "leaking" unicode characters out 
into your wire-format message, which would ultimately result in either an 
exception at serialization time or, worse, mojibake.

Patch attached.

--
stage:  -> patch review
type:  -> behavior
versions:  -Python 3.2
Added file: http://bugs.python.org/file32730/support_8bit_charset_cte.patch

___
Python tracker 

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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2013-11-20 Thread Peyton Sherwood

Changes by Peyton Sherwood :


--
nosy: +peyton

___
Python tracker 

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



[issue13633] Automatically convert character references in HTMLParser

2013-11-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
title: Handling of hex character references in HTMLParser.handle_charref -> 
Automatically convert character references in HTMLParser

___
Python tracker 

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



[issue13633] Handling of hex character references in HTMLParser.handle_charref

2013-11-20 Thread Ezio Melotti

Ezio Melotti added the comment:

Here is a patch.
It might be also be a good idea to add warning when the option is not 
explicitly set to False, and change the default to True in 3.5/3.6.

--
keywords: +patch
nosy: +serhiy.storchaka
stage: test needed -> patch review
Added file: http://bugs.python.org/file32729/issue13633.diff

___
Python tracker 

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



[issue19572] Report more silently skipped tests as skipped

2013-11-20 Thread Zachary Ware

Changes by Zachary Ware :


Added file: 
http://bugs.python.org/file32728/skiptest_not_return_or_pass.v4-3.3.diff

___
Python tracker 

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



[issue19664] UserDict test assumes ordered dict repr

2013-11-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I realize this code is ancient--but it seems to rely on repr of a dict 
> producing consistent output, which is silly

Well, it sounds a bit weird to me... If you're building the dict always in the 
same way, intuitively it should always produce the same repr() during the same 
interpreter session. Do you know why it doesn't?

--
nosy: +pitrou

___
Python tracker 

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



[issue19666] Format string for ASCII unicode or bytes-like object as readonly buffer

2013-11-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It seems this would add a dependency to the unicode implementation (other 
unicode representations may not allow you to take a Py_buffer to the ASCII 
data).

--
nosy: +pitrou

___
Python tracker 

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



[issue19667] Add the "htmlcharrefreplace" error handler

2013-11-20 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The proposed patch adds the htmlcharrefreplace_errors() function which 
implements the "htmlcharrefreplace" error handler in the html module. This 
error handler is almost same as the "xmlcharrefreplace" error handler, but 
first try to replace an unencodable character to HTML named character 
reference. Result is a little more human-readable than with "xmlcharrefreplace".

See also a discussion on Python-Ideas: 
http://comments.gmane.org/gmane.comp.python.ideas/21307 .

--
components: Library (Lib)
files: htmlcharrefreplace.patch
keywords: patch
messages: 203517
nosy: ezio.melotti, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add the "htmlcharrefreplace" error handler
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32727/htmlcharrefreplace.patch

___
Python tracker 

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



[issue19666] Format string for ASCII unicode or bytes-like object as readonly buffer

2013-11-20 Thread Christian Heimes

New submission from Christian Heimes:

I could use a format string for either ASCII unicode or bytes buffer in a few 
places, e.g. 

a* (bytes, bytearray, bytes-like object or ASCII unicode) [Py_buffer]

Like y* it should handle PyBUF_SIMPLE with 'C' contiguous but it should only 
accept one dimensional buffers. In case the object is an ASCII PyUnicode_Object 
it should return its ASCII data as Py_buffer.

--
components: Interpreter Core
messages: 203516
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: Format string for ASCII unicode or bytes-like object as readonly buffer
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue19665] test_logging fails with SMTPHandler timeout

2013-11-20 Thread Mark Wolf

New submission from Mark Wolf:

Similar to http://bugs.python.org/issue14644 but with Arch Linux instead of OS 
X. I built python according the dev guide then ran the test suite with 
`./python -m test -vj3 test_logging` and failed in the SMTPHandlerTest. 
`self.handled.is_set()` returns false after a 5 second timeout. In one of the 
comments in the OS X bug linked above, it suggests changing the timeout to 15 
seconds. This causes the test to pass (actually anything slightly over 5 sec 
seems to be okay). Not sure if this is a fragile test or a bug in Lib.logging. 
The patch ups the timeout by a second, which passes on my machine but might 
still fail on others if it actually is a fragile test issue. The failing test 
runner output for test_logging can be found here: 
https://gist.github.com/m3wolf/7563541

I'm just jumping into python dev for the first time; any constructive comments 
are appreciated.

--
components: Tests
files: test_logging.patch
keywords: patch
messages: 203515
nosy: canisdirus
priority: normal
severity: normal
status: open
title: test_logging fails with SMTPHandler timeout
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file32726/test_logging.patch

___
Python tracker 

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



[issue19664] UserDict test assumes ordered dict repr

2013-11-20 Thread STINNER Victor

STINNER Victor added the comment:

In test_set, I fixed the issue by parsing repr() output, sorting items and then 
compare sorted items :-)

--
nosy: +haypo

___
Python tracker 

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



[issue19474] Argument Clinic causing compiler warnings about uninitialized variables

2013-11-20 Thread Larry Hastings

Larry Hastings added the comment:

Sigh.  If dataflow analysis could inline the static _impl function, it would 
notice that there are no code paths where the variable is uninitialized and 
gets used.  But I'm not surprised compilers aren't that sophisticated.

So I beat the problem to death with a shoe: now, variables that are in option 
groups that don't otherwise have a default value always get one.

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

___
Python tracker 

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



[issue19462] Add remove_argument() method to argparse.ArgumentParser

2013-11-20 Thread paul j3

paul j3 added the comment:

f.nargs = '?'
f.default = argparse.SUPPRESS
f.help = argparse.SUPPRESS

may be best set of tweaks to a positional Action `f`.  In quick tests it 
removes `f` from the help, suppresses any complaints about a missing string, 
and does not put anything in the namespace.

But if there is a string in the input that could match this positional, it will 
be use.

f.nargs = 0

is another option.  This puts a `[]` (empty list) in the namespace, since 
'nothing' matches `f`.  If there is an input string that might have matched it 
before, you will not get an 'unrecognized argument' error.  `parse_known_args` 
can be used to get around that issue.

I should stress, though, that fiddling with `nargs` like this is not part of 
the API.  Tweak this at your own risk.

--

___
Python tracker 

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



[issue19474] Argument Clinic causing compiler warnings about uninitialized variables

2013-11-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f0f496e482e by Larry Hastings in branch 'default':
Issue #19474: Argument Clinic now always specifies a default value for
http://hg.python.org/cpython/rev/4f0f496e482e

--
nosy: +python-dev

___
Python tracker 

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



[issue13477] tarfile module should have a command line

2013-11-20 Thread Berker Peksag

Berker Peksag added the comment:

Attached an updated patch that addresses Serhiy's comments. Thanks!

--
Added file: http://bugs.python.org/file32725/issue13477_v6.diff

___
Python tracker 

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



[issue19664] UserDict test assumes ordered dict repr

2013-11-20 Thread Larry Hastings

New submission from Larry Hastings:

If you run Lib/test/test_userdict.py enough times, sooner or later it'll 
produce a spurious error.  I wrote a shell script that ran "./python -m test 
test_userdict" a zillion times; here's a snippet of output from running that 
script:

[...]
1 test OK.
[1/1] test_userdict
1 test OK.
[1/1] test_userdict
1 test OK.
[1/1] test_userdict
test test_userdict failed -- Traceback (most recent call last):
  File "/home/larry/src/python/clinic/Lib/test/test_userdict.py", line 48, in 
test_all
self.assertEqual(repr(u2), repr(d2))
AssertionError: "{'one': 1, 'two': 2}" != "{'two': 2, 'one': 1}"
- {'one': 1, 'two': 2}
+ {'two': 2, 'one': 1}


1 test failed:
test_userdict
[1/1] test_userdict
1 test OK.
[1/1] test_userdict
1 test OK.
[...]

Line 48 reads as follows:
self.assertEqual(repr(u2), repr(d2))

I realize this code is ancient--but it seems to rely on repr of a dict 
producing consistent output, which is silly and has always been wrong.

Raymond, you want to take this?

--
components: Library (Lib)
messages: 203509
nosy: larry, rhettinger
priority: normal
severity: normal
stage: needs patch
status: open
title: UserDict test assumes ordered dict repr
type: behavior
versions: Python 3.4

___
Python tracker 

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



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

2013-11-20 Thread STINNER Victor

STINNER Victor added the comment:

Patch updated for Charles François's comments.

--
Added file: http://bugs.python.org/file32724/4430e893d89f.patch

___
Python tracker 

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



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

2013-11-20 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file32547/69fd2d766005.patch

___
Python tracker 

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



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

2013-11-20 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file32549/3bf73dcd0b42.diff

___
Python tracker 

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



[issue14621] Hash function is not randomized properly

2013-11-20 Thread Christian Heimes

Christian Heimes added the comment:

The issue has been solved for Python 3.4 with the integration of PEP 456.

--
stage:  -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue1208730] expat binding for XML_ParserReset

2013-11-20 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee: christian.heimes -> 
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates

2013-11-20 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee:  -> christian.heimes

___
Python tracker 

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



[issue18233] SSLSocket.getpeercertchain()

2013-11-20 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee:  -> christian.heimes

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-11-20 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee:  -> christian.heimes

___
Python tracker 

___
___
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-11-20 Thread Christian Heimes

Christian Heimes added the comment:

The problems have been resolved.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue16595] Add resource.prlimit

2013-11-20 Thread Christian Heimes

Christian Heimes added the comment:

Tests are passing on all buildbots for quite some time now.

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

___
Python tracker 

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



[issue17791] PC/pyconfig.h defines PREFIX macro

2013-11-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fbd856e817a1 by Christian Heimes in branch 'default':
Issue #17791: Drop PREFIX and EXEC_PREFIX definitions from PC/pyconfig.h
http://hg.python.org/cpython/rev/fbd856e817a1

--
nosy: +python-dev

___
Python tracker 

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



  1   2   >