[issue28837] 2to3 does not wrap zip correctly

2017-04-05 Thread Benjamin Peterson

Benjamin Peterson added the comment:


New changeset 93b4b47e3a720171d67f3b608de406aef462835c by Benjamin Peterson 
(Stuart Berg) in branch 'master':
bpo-28837: Fix lib2to3 handling of map/zip/filter calls when followed with a 
'trailer', e.g. zip()[x] (#24)
https://github.com/python/cpython/commit/93b4b47e3a720171d67f3b608de406aef462835c


--

___
Python tracker 

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



[issue30004] in regex-howto, improve example on grouping

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +akuchling

___
Python tracker 

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



[issue29990] Range checking in GB18030 decoder

2017-04-05 Thread Xiang Zhang

Xiang Zhang added the comment:

Yes, 0x80 doesn't matter here.

It's nice to make the backporting PRs. But let's wait some time for ezio and 
haypo's comments and reviews. Get the master PR merged first and then continue 
on backporting. :-)

--

___
Python tracker 

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



[issue30004] in regex-howto, improve example on grouping

2017-04-05 Thread Cristian Barbarosie

New submission from Cristian Barbarosie:

In the Regular Expression HOWTO
https://docs.python.org/3.6/howto/regex.html#regex-howto
the last example in the "Grouping" section has a bug. The code is supposed to 
find repeated words, but it catches false repetitions.

>>> p = re.compile(r'(\b\w+)\s+\1')
>>> p.search('Paris in the the spring').group()
'the the'
>>> p.search('k is the thermal coefficient').group()
'the the'

I propose adding a \b after \1, this solves the problem :

>>> p = re.compile(r'(\b\w+)\s+\1\b')
>>> p.search('Paris in the the spring').group()
'the the'
>>> print p.search('k is the thermal coefficient')
None

--
assignee: docs@python
components: Documentation
messages: 291209
nosy: Cristian Barbarosie, docs@python
priority: normal
severity: normal
status: open
title: in regex-howto, improve example on grouping
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29990] Range checking in GB18030 decoder

2017-04-05 Thread Ma Lin

Ma Lin added the comment:

> except 0x80 (€)

I suppose the English edition is not the final release of GB18030-2000.

At the end of official Chinese edition of GB18030-2005, listed the difference 
between GB18030-2000 and GB18030-2005 clearly, it doesn't mention 0x80 (€), so 
GB18030-2000 should not has 0x80 as well.

Why 0x80 (€) appear in English edition?
I searched on Google, this topic said 0x80 appears in *draft* of GB18030-2000.
http://www.pkucn.com/thread-304395-1-1.html
So maybe the English edition is a translation of GB18030-2000 draft, this logic 
seems ok.

Anyway, 0x80 is another story, not conflict with this issue.
Zhang, do I need to make PR for 3.6/3.5/2.7 respectively?

--

___
Python tracker 

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



[issue30003] Remove hz codec

2017-04-05 Thread Ma Lin

New submission from Ma Lin:

hz is a Simplified Chinese codec, available in Python since around 2004.

However, hz encoder has a serious bug, it forgets to escape ~
>>> 'hi~'.encode('hz')
b'hi~'# the correct output should be b'hi~~'

As a result, we can't finish a roundtrip:
>>> b'hi~'.decode('hz')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'hz' codec can't decode byte 0x7e in position 2: incomplete 
multibyte

In these years, no one has reported this bug, so I think it's pretty safe to 
remove hz codec.

FYI:
HZ codec is a 7-bit wrapper for GB2312, was formerly commonly used in email and 
USENET postings. It was designed in 1989 by Fung Fung Lee, and subsequently 
codified in 1995 into RFC 1843.

It was popular in USENET networks, which in the late 1980s and early 1990s, 
generally did not allow transmission of 8-bit characters or escape characters.

https://en.wikipedia.org/wiki/HZ_(character_encoding)

Does other languages have hz codec?
Java 8: no [1]
.NET: yes [2]
PHP: yes [3]
Perl: yes [4]

[1] http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html
[2] https://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx
[3] http://php.net/manual/en/mbstring.supported-encodings.php
[4] http://perldoc.perl.org/Encode/CN.html

--
components: Unicode
messages: 291207
nosy: Ma Lin, ezio.melotti, haypo, xiang.zhang
priority: normal
severity: normal
status: open
title: Remove hz codec
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue30001] CPython contribution docs reference missing /issuetracker page

2017-04-05 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks for the report, Alex.

The issue tracker for the devguide is at https://github.com/python/devguide

Do you mind filling the issue there?
I'm closing this since this tracks only issues for CPython.
Thanks :)

--
nosy: +Mariatta
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29990] Range checking in GB18030 decoder

2017-04-05 Thread Xiang Zhang

Changes by Xiang Zhang :


--
stage:  -> patch review
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue29990] Range checking in GB18030 decoder

2017-04-05 Thread Xiang Zhang

Xiang Zhang added the comment:

The table in wikipedia is somewhat complex. I find 
ftp://ftp.software.ibm.com/software/globalization/documents/gb18030m.pdf and 
the table in it is same as 
https://pan.baidu.com/share/link?shareid=2606985291=3341026630 (except 0x80) 
but in English. I agree with Ma Lin bytes sequences like b'\x81\x30\xFF\x30' 
are invalid.

For current implementation, you could see:

>>> invalid = b'\x81\x30\xff\x30'
>>> invalid.decode('gb18030').encode('gb18030') == invalid
False

--

___
Python tracker 

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



[issue30002] Minor change to https://docs.python.org/3.6/extending/building.html

2017-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm not really sure that is a standard or even a best practice.  I think some 
people do it and some don't.

--
nosy: +rhettinger

___
Python tracker 

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



[issue30002] Minor change to https://docs.python.org/3.6/extending/building.html

2017-04-05 Thread Arthur Goldberg

New submission from Arthur Goldberg:

The core example on this page starts:

from distutils.core import setup, Extension

module1 = Extension('demo',
sources = ['demo.c'])

...

I suggest that 'sources = ['demo.c']' be changed to 'sources = 
['demomodule.c']', because this would make the example consistent with 
https://docs.python.org/3.6/extending/extending.html which says: "Begin by 
creating a file spammodule.c. (Historically, if a module is called spam, the C 
file containing its implementation is called spammodule.c; ... )"
This minor change may help encourage this standard practice.

Arthur

--
assignee: docs@python
components: Documentation
messages: 291203
nosy: ArthurGoldberg, docs@python
priority: normal
severity: normal
status: open
title: Minor change to https://docs.python.org/3.6/extending/building.html
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue30001] CPython contribution docs reference missing /issuetracker page

2017-04-05 Thread AJ Jordan

New submission from AJ Jordan:

https://cpython-devguide.readthedocs.io/pullrequest.html#licensing (and 
presumably other pages in this project) references 
https://cpython-devguide.readthedocs.io/issuetracker, but this page returns 404 
Not Found.

--
assignee: docs@python
components: Documentation
messages: 291202
nosy: docs@python, strugee
priority: normal
severity: normal
status: open
title: CPython contribution docs reference missing /issuetracker page

___
Python tracker 

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



[issue30000] Inconsistency in the zlib module

2017-04-05 Thread Ellison Marks

New submission from Ellison Marks:

In the zlib module, three of the methods support the wbits parameter, those 
being zlib.compressobj, zlib.decompress and zlib.decompressobj. zlib.compress 
does not support the wbits parameter. Looking at the source for these 
functions, those that support the wbits parameter use the "advanced" version of 
the zlib functions, deflateInit2 and inflateInit2, whereas zlib.compress uses 
the "basic" function deflateInit.

The effect of this is that while you can decode from zlib data with non-default 
wbits values in one call with zlib.decompress, you cannot encode to zlib data 
with non-default wbits in one call with zlib.compress.  You need to take to 
extra step of creating a compression object with the appropriate values, then 
use that to compress the data. eg:

zlib.compress(data) # can't use wbits here

vs.

compressor = zlib.compressobj(wbits=16+zlib.MAX_WBITS)
compressor.compress(data) + compressor.flush()

Some quick benchmarking shows little speed difference between the two 
implementations:

$ python -m timeit -s 'import zlib' -s 'import random' -s 'import string' -s 
's="".join(random.choice(string.printable) for _ in xrange(1000))' 
'zlib.compress(s)'
10 loops, best of 3: 356 msec per loop

$ python -m timeit -s 'import zlib' -s 'import random' -s 'import string' -s 
's="".join(random.choice(string.printable) for _ in xrange(1000))' 
'compressor=zlib.compressobj()' 'compressor.compress(s)+compressor.flush()'
10 loops, best of 3: 364 msec per loop

so I can't see any downside of switching zlib.compress to the "advanced" 
implementation and exposing the extra parameters to python.

--
components: Library (Lib)
messages: 291201
nosy: Ellison Marks
priority: normal
severity: normal
status: open
title: Inconsistency in the zlib module
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29999] repr() of ImportError misses keyword arguments name and path

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1179

___
Python tracker 

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



[issue29999] repr() of ImportError misses keyword arguments name and path

2017-04-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The repr of standard exceptions usually looks as exception constructor used for 
creating that exception. But the repr of ImportError misses keyword arguments 
name and path.

>>> ImportError('test', name='somename', path='somepath')
ImportError('test',)

Proposed patch make the repr of ImportError containing keyword arguments.

>>> ImportError('test', name='somename', path='somepath')
ImportError('test', name='somename', path='somepath')

I don't know how to classify this issue and whether the patch should be 
backported.

--
components: Interpreter Core
messages: 291200
nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: repr() of ImportError misses keyword arguments name and path
versions: Python 3.7

___
Python tracker 

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



[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'

2017-04-05 Thread François Bissey

François Bissey added the comment:

I am seeing this with clang on linux. It breaks the building pyzmq. I'll concur 
with Calvin that using just "-R" is wrong in the first place. Some compiler may 
pass it directly to the linker. But even in the linker, interpreting "-R" as a 
rpath if the argument is a directory, is a legacy behavior. "-R" is supposed to 
be used to add remarks (see ld's man page).
On linux it should just be "-Wl,-rpath" and it should work with all compilers.

--
nosy: +fbissey

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2017-04-05 Thread Eryk Sun

Eryk Sun added the comment:

> Though I don't have any idea if it works on Windows, but it seems 
> properly factored.

Generally it should. However, os.get_terminal_size is unnecessarily limited to 
the standard handles with a hard-coded mapping 0 => StandardInput, 1 => 
StandardOutput, and 2 => StandardError, and otherwise raises ValueError. 
Example failure:

>>> fd = os.open('conout$', os.O_RDWR)
>>> os.isatty(fd)
True
>>> os.get_terminal_size(fd)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: bad file descriptor

There is no need to involve the standard handles. It should call 
_get_osfhandle(fd).

--
nosy: +eryksun

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

* In IDLE sys.stdout.isatty() returns True, but sys.stdout.fileno() raises an 
exception. Terminal width can't be determined and the default 80 is used.

* You always can pass explicit width to pprint. This may be needed even with 
default width 80. Now on wide a terminal wider 80 columns you have unused space 
than can cause unneeded wrapping. On a terminal narrower 80 columns the 
pprint() output is formatted incorrectly and is wrapped twice: by pprint() and 
by terminal.

* The output in doctests is not connected to a terminal.

--

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2017-04-05 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr. added the comment:

This is not a problem for doctests, since the output stream is not a terminal; 
the check for terminal-ness seems reasonable.  (Though I don't have any idea if 
it works on Windows, but it seems properly factored.)

--

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2017-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Some thoughts:

* I'm not sure the terminal width will always be knowable, for example when 
using IDLE.

* I often need smaller widths when printing short dicts and lists.  The smaller 
widths better show the parallel structure.  I think having it fill the width of 
my screen is rarely what I would want.

* ISTM, this will cause reproducibility issues, esp for doctests.

--

___
Python tracker 

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



[issue29998] Pickling and copying ImportError doesn't preserve name and path

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1178

___
Python tracker 

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



[issue29998] Pickling and copying ImportError doesn't preserve name and path

2017-04-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Pickling and copying ImportError doesn't preserve name and path attributes.

>>> import copy, pickle
>>> e = ImportError('test', name='n', path='p')
>>> e.name
'n'
>>> e.path
'p'
>>> e2 = pickle.loads(pickle.dumps(e, 4))
>>> e2.name
>>> e2.path
>>> e2 = copy.copy(e)
>>> e2.name
>>> e2.path

Proposed patch fixes this.

--
components: Interpreter Core
messages: 291194
nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Pickling and copying ImportError doesn't preserve name and path
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29997] Suggested changes for https://docs.python.org/3.6/extending/extending.html

2017-04-05 Thread Fred L. Drake, Jr.

Changes by Fred L. Drake, Jr. :


--
nosy: +fdrake

___
Python tracker 

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



[issue29997] Suggested changes for https://docs.python.org/3.6/extending/extending.html

2017-04-05 Thread Arthur Goldberg

Arthur Goldberg added the comment:

Also, 

Incorrect number agreement:
s/strategy that minimizes this kind of errors/strategy that minimizes this kind 
of error/

--

___
Python tracker 

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



[issue29997] Suggested changes for https://docs.python.org/3.6/extending/extending.html

2017-04-05 Thread Arthur Goldberg

New submission from Arthur Goldberg:

I've just taught myself how to write C extensions to Python with 
https://docs.python.org/3.6/extending/extending.html. I think it's quite good.

Nevertheless, I've some suggested improvements. These all use the vi s/// 
replacement syntax.

Ambiguous 'it':
s/If the latter header file does not exist on your system, it declares the 
functions malloc(), free() and realloc() directly./If the latter header file 
does not exist on your system, Python.h declares the functions malloc(), free() 
and realloc() directly./

Unclear, as 'The C function' refers to the specific example, whereas 'always 
has' implies that this applies to all calls from Python to C:
s/The C function always has two arguments, conventionally/A C function called 
by Python always has two arguments, conventionally/

In 
PyMODINIT_FUNC
PyInit_spam(void)
{
PyObject *m;

m = PyModule_Create();
if (m == NULL)
return NULL;

SpamError = PyErr_NewException("spam.error", NULL, NULL);
Py_INCREF(SpamError);
PyModule_AddObject(m, "error", SpamError);
return m;
}

remove
m = PyModule_Create();
if (m == NULL)
return NULL;
and replace it with

...

because it won't compile because spammodule has not been described yet on the 
page.

Self-contradictory: 'normally always' is an oxymoron. 
s/It should normally always be METH_VARARGS or METH_VARARGS | METH_KEYWORDS; a 
value of 0 means that an obsolete variant of PyArg_ParseTuple() is used./It 
should always be METH_VARARGS or METH_VARARGS | METH_KEYWORDS; however, legacy 
code may use 0, which indicates that an obsolete variant of PyArg_ParseTuple() 
is being used./

Incomplete: this comment doesn't contain a complete thought
s/module documentation, may be NULL/pointer to a string containing the module's 
documentation, or NULL if none is provided/

Provide hyperlink: for user convenience, add a hyperlink to 'Modules/xxmodule.c'
s/included in the Python source distribution as Modules/xxmodule.c/included in 
the Python source distribution as Modules/xxmodule.c/

Incomplete: It would be good to lead programmers towards the easiest approach. 
s/ If you use dynamic loading,/ If you can use dynamic loading, 
the the easiest approach is to use Python's distutils module to build your 
module. If you use dynamic loading,/

--
assignee: docs@python
components: Documentation
messages: 291192
nosy: ArthurGoldberg, docs@python
priority: normal
severity: normal
status: open
title: Suggested changes for 
https://docs.python.org/3.6/extending/extending.html
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch makes some operations slightly faster.

$ ./python -m perf timeit -s 'import re; m = 
re.match(r"(?P\d+)(?:\.(?P\d*))?", "12.34")' -- --duplicate 100 
'm.lastgroup'
Unpatched:  Median +- std dev: 204 ns +- 1 ns
Patched:Median +- std dev: 167 ns +- 2 ns

$ ./python -m perf timeit -s 'import re; m = 
re.match(r"(?P\d+)(?:\.(?P\d*))?", "12.34")' -- --duplicate 100 
'm.groupdict()'
Unpatched:  Median +- std dev: 2.78 us +- 0.05 us
Patched:Median +- std dev: 1.98 us +- 0.04 us

$ ./python -m perf timeit -s 'import re; m = 
re.match(r"(?P\d+)(?:\.(?P\d*))?", "12.34")' -- --duplicate 100 
'm.start("frac")'
Unpatched:  Median +- std dev: 638 ns +- 22 ns
Patched:Median +- std dev: 576 ns +- 16 ns

$ ./python -m perf timeit -s 'import re; m = 
re.match(r"(?P\d+)(?:\.(?P\d*))?", "12.34")' -- --duplicate 100 
'm.group("frac")'
Unpatched:  Median +- std dev: 1.15 us +- 0.03 us
Patched:Median +- std dev: 1.07 us +- 0.03 us

--

___
Python tracker 

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



[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1177

___
Python tracker 

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



[issue29993] error of parsing encoded words in email of standard library

2017-04-05 Thread R. David Murray

R. David Murray added the comment:

Actually, looking at the issue related to the patch, we conferred at the time, 
Barry, and decided on no backports.  It was applied only to default.  Sijian: 
the reason we put the issue number in the commit message is because the issue 
often contains relevant discussion that can supplement the commit message.

--
resolution: rejected -> not a bug

___
Python tracker 

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



[issue29962] Add math.remainder operation

2017-04-05 Thread Mark Dickinson

Changes by Mark Dickinson :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue29993] error of parsing encoded words in email of standard library

2017-04-05 Thread R. David Murray

R. David Murray added the comment:

I consciously decided not to backport this to 2.7 at the time, though I'm not 
sure I said that out loud.  I think it is too much of a behavior change for 2.7.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29962] Add math.remainder operation

2017-04-05 Thread Mark Dickinson

Mark Dickinson added the comment:


New changeset a0ce375e10b50f7606cb86b072fed7d8cd574fe7 by Mark Dickinson in 
branch 'master':
bpo-29962: add math.remainder (#950)
https://github.com/python/cpython/commit/a0ce375e10b50f7606cb86b072fed7d8cd574fe7


--

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1176

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2017-04-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

pprint() uses width=80 by default. But default output stream is sys.stdout 
which often is connected to a terminal, and terminals now usually have larger 
width than 80 columns.

Proposed patch change the default value of the width parameter in pprint(). If 
the width is specified and the output is a terminal, then the width of the 
terminal is used.

--
components: Library (Lib)
messages: 291187
nosy: fdrake, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Use terminal width by default in pprint
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2017-04-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +neologix

___
Python tracker 

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



[issue29992] Expose parse_string in JSONDecoder

2017-04-05 Thread Bob Ippolito

Bob Ippolito added the comment:

I agree with that sentiment. If we were to want to support this use case I 
would rather put together a coherent way to augment the parsing/encoding of 
anything than bolt it on to what we have.

--

___
Python tracker 

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



[issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Then the exception for the __exit__ method should be documented in PEP 8.

--

___
Python tracker 

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



[issue29993] error of parsing encoded words in email of standard library

2017-04-05 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Apr 05, 2017, at 03:26 PM, Raymond Hettinger wrote:

>Barry, is this something that should go back to 2.7 or is that pretty much
>settled business at this point?

I think we should not backport this.  It's a behavior change and my concern
would be that anybody who's bitten by this in Python 2.7 is either already
dealing with it or has already worked around it.  I wouldn't want to change
that in a 2.7 point release.

@r.david.murray might have a different opinion.

--

___
Python tracker 

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



[issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError

2017-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

PEP 8's rule makes sense elsewhere, but for context managers I think an 
implicit return None is the norm and that making it explicit wouldn't improve 
readability.

--
nosy: +rhettinger

___
Python tracker 

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



[issue29569] threading.Timer class: Continue periodical execution till action returns True

2017-04-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29993] error of parsing encoded words in email of standard library

2017-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Barry, is this something that should go back to 2.7 or is that pretty much 
settled business at this point?

--
nosy: +rhettinger

___
Python tracker 

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



[issue29992] Expose parse_string in JSONDecoder

2017-04-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
components: +Library (Lib)
versions: +Python 3.7

___
Python tracker 

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



[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-05 Thread Dominic Mayers

Changes by Dominic Mayers :


Removed file: 
http://bugs.python.org/file46775/Issue29947_for_discussion_03.patch

___
Python tracker 

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



[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-05 Thread Dominic Mayers

Dominic Mayers added the comment:

An improved version of the patch, I hope. I will remove the old patch, because 
it's really does not help to see the old versions.

--
Added file: http://bugs.python.org/file46781/Issue29947_for_discussion_04.patch

___
Python tracker 

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



[issue29992] Expose parse_string in JSONDecoder

2017-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I agree with Serhiy that the JSON module is already complex enough that adding 
more features will have a negative net effect on usability.

Bob, what do you think?

--
assignee:  -> bob.ippolito
nosy: +bob.ippolito

___
Python tracker 

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



[issue13290] get vars for object with __slots__

2017-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> On any case, feel free to mark this as "rejected" or "wont fix"

Okay, will do.

And though I think the idea had some significant downsides, it is was creative 
and we appreciate the suggestion.

--
resolution:  -> rejected
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-04-05 Thread Charles Bouchard-Légaré

Changes by Charles Bouchard-Légaré :


--
nosy: +Charles Bouchard-Légaré

___
Python tracker 

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



[issue29995] re.escape() escapes too much

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1175

___
Python tracker 

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



[issue13290] get vars for object with __slots__

2017-04-05 Thread João Bernardo

João Bernardo added the comment:

Being the OP, at that time I felt it was important to have a vars() function 
that worked on __slots__ to ease something I was developing. The truth for me 
is: __slots__ is not really relevant anymore. The benefits it brings are not 
enough to make the feature usable because of these incompatibilities with 
normal classes. Also, it does not bring real benefits even for most people who 
think they need this.

If you believe having vars() working on __slots__ is bad because people may 
want to update it, why would locals() exist at all?

Also, your argument that having vars() working on __slots__ classes may mask 
the wrong use of the attribute, why would someone use vars() on __slots__ if it 
doesn't work right now? If it is not useful for identifying this problem now, 
then I am ok with it not being useful in the future as well.

On any case, feel free to mark this as "rejected" or "wont fix" because if in 6 
years no one cared enough to have it working means that either it is not 
important and/or __slots__ classes are also not relevant for others as well.

--

___
Python tracker 

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



[issue29995] re.escape() escapes too much

2017-04-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

re.escape() escapes all the characters except ASCII letters, numbers and '_'. 
This is too excessive, makes escaping and compiling slower and makes the 
pattern less human-readable. Characters "!\"%&\',/:;<=>@_`~" as well as 
non-ASCII characters are always literal in a regular expression and don't need 
escaping.

Proposed patch makes re.escape() escaping only minimal set of characters that 
can have special meaning in regular expressions. This includes special 
characters ".\\[]{}()*+?^$|", "-" (a range in a character set), "#" (starts a 
comment in verbose mode) and ASCII whitespaces (ignored in verbose mode).

The null character no longer need a special escaping.

The patch also increases the speed of re.escape() (even if it produces the same 
result).

$ ./python -m perf timeit -s 'from re import escape; s = "()[]{}?*+-|^$\\.# 
\t\n\r\v\f"' -- --duplicate 100 'escape(s)'
Unpatched:  Median +- std dev: 42.2 us +- 0.8 us
Patched:Median +- std dev: 11.4 us +- 0.1 us

$ ./python -m perf timeit -s 'from re import escape; s = b"()[]{}?*+-|^$\\.# 
\t\n\r\v\f"' -- --duplicate 100 'escape(s)'
Unpatched:  Median +- std dev: 38.7 us +- 0.7 us
Patched:Median +- std dev: 18.4 us +- 0.2 us

$ ./python -m perf timeit -s 'from re import escape; s = 
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"' -- 
--duplicate 100 'escape(s)'
Unpatched:  Median +- std dev: 40.3 us +- 0.5 us
Patched:Median +- std dev: 33.1 us +- 0.6 us

$ ./python -m perf timeit -s 'from re import escape; s = 
b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"' -- 
--duplicate 100 'escape(s)'
Unpatched:  Median +- std dev: 54.4 us +- 0.7 us
Patched:Median +- std dev: 40.6 us +- 0.5 us

$ ./python -m perf timeit -s 'from re import escape; s = 
"абвгґдеєжзиіїйклмнопрстуфхцчшщьюяАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯ"' -- 
--duplicate 100 'escape(s)'
Unpatched:  Median +- std dev: 156 us +- 3 us
Patched:Median +- std dev: 43.5 us +- 0.5 us

$ ./python -m perf timeit -s 'from re import escape; s = 
"абвгґдеєжзиіїйклмнопрстуфхцчшщьюяАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯ".encode()' 
-- --duplicate 100 'escape(s)'
Unpatched:  Median +- std dev: 200 us +- 4 us
Patched:Median +- std dev: 77.0 us +- 0.6 us

And the speed of compilation of escaped string.

$ ./python -m perf timeit -s 'from re import escape; from sre_compile import 
compile; s = 
"абвгґдеєжзиіїйклмнопрстуфхцчшщьюяАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯ"; p = 
escape(s)' -- --duplicate 100 'compile(p)'
Unpatched:  Median +- std dev: 1.96 ms +- 0.02 ms
Patched:Median +- std dev: 1.16 ms +- 0.02 ms

$ ./python -m perf timeit -s 'from re import escape; from sre_compile import 
compile; s = 
"абвгґдеєжзиіїйклмнопрстуфхцчшщьюяАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯ".encode(); 
p = escape(s)' -- --duplicate 100 'compile(p)'
Unpatched:  Median +- std dev: 3.69 ms +- 0.04 ms
Patched:Median +- std dev: 2.13 ms +- 0.03 ms

--
components: Library (Lib), Regular Expressions
messages: 291177
nosy: ezio.melotti, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: re.escape() escapes too much
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29353] Incorrect handling of HTTP response with "Content-Type: message/rfc822" header

2017-04-05 Thread R. David Murray

R. David Murray added the comment:

I'm not surprised that trying to render a message parsed with 'headersonly' 
fails.  headersonly treats the entire message body as a single string payload.  
I'm not sure what the correct behavior should be for the email package, but the 
fact that this doesn't work currently shouldn't matter to the http package.  
Given the error involves policy, it is quite possible as_string used to work in 
this context and I broke it when introducing policy because there is no test 
that covers this case.  I'm guessing there is no test because turning a message 
parsed with headersonly back into a string wasn't considered to be useful.

As for the multipart thing, that is actually consistent with the docs.  
get_content_type gives you the value of the header, is_multipart effectively 
reports whether or not the payload is a list, and when parsed with headersonly, 
the body is a string not a list, which is documented.  Granted, you have to 
connect those dots yourself, so a sentence about that *could* be added to the 
headersonly docs.

All of which should be in a separate issue from this one.

--

___
Python tracker 

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



[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2017-04-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

(Response to what I believe is latest patch.)  In msg278666, my two suggestions 
were 'either...or', not both.  The list came from Antti's msg278528, but the 
correct list for Python appears to be different, and different for bytes and 
unicode.  When I made the suggestion, I did not realize that 'exactly' was 
repeated for each conversion type in a table.  As a note, I think the following 
might work. "For  conversion types, the 0-conversion flag has effect 
even when a precision is given."

I also think that 'exactly could be dropped when it is not exactly true.

--

___
Python tracker 

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



[issue29994] site.USER_SITE is None for Windows embeddable Python 3.6

2017-04-05 Thread Brecht Machiels

New submission from Brecht Machiels:

Previous versions of the embeddable Python:

Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>> site.USER_SITE
'C:\\Users\\Brecht\\AppData\\Roaming\\Python\\Python35\\site-packages'
>>>

Version 3.6.0 and 3.6.1, both win32 and amd64:

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit 
(Intel)] on win32
>>> import site
>>> site.USER_SITE
>>>

 This causes problems when importing pip for example.

--
components: Windows
messages: 291174
nosy: brechtm, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: site.USER_SITE is None for Windows embeddable Python 3.6
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue29992] Expose parse_string in JSONDecoder

2017-04-05 Thread Tobias Oberstein

Tobias Oberstein added the comment:

I agree, my use case is probably exotic: transparent roundtripping of binaries 
over JSON using a beginning \0 byte marker to distinguish plain string and 
base64 encoded binaries.

FWIW, I do think however that adding "parse_string" kw param to the ctor of 
JSONDecoder would at least fit the current approach: there are parse_xxx 
parameters for all the other things already.

If overriding string parsing would be via subclassing, while all the others 
stay with the kw parameter approach, that could be slightly confusing too, 
because it looses on consistency.

Switching everything to subclassing/overriding for _all_ parse_XXX is I guess a 
no go, because it breaks existing stuff?

> For me in my situation, it'll be messy anyways, because I need to support Py2 
> and 3, and CPy and PyPy .. I just filed the issue for "completeness".

--

___
Python tracker 

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



[issue29992] Expose parse_string in JSONDecoder

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

JSONDecoder constructor already has too much parameters. Adding new parameters 
will decrease usability. For such uncommon case I think overriding a method in 
a subclass is the best solution.

--
nosy: +ezio.melotti, rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue29993] error of parsing encoded words in email of standard library

2017-04-05 Thread sijian liang

New submission from sijian liang:

This issue is fixed in python3
see 
https://github.com/python/cpython/commit/07ea53cb218812404cdbde820647ce6e4b2d0f8e

--
components: email
messages: 291171
nosy: barry, r.david.murray, sijian liang
priority: normal
severity: normal
status: open
title: error of parsing encoded words in email of standard library
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



[issue29878] Add global instances of int 0 and 1

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset bae6881b4215b2613ad08ef0dc7bed7743c2b8cc by Serhiy Storchaka in 
branch 'master':
Update Argument Clinic generated code for bpo-29878. (#1001)
https://github.com/python/cpython/commit/bae6881b4215b2613ad08ef0dc7bed7743c2b8cc


--

___
Python tracker 

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



[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-05 Thread Martin Panter

Martin Panter added the comment:

Not in general. I think you would have to make special cases for partial 
functions, __wrapped__, and whatever else there is, and combinations of these. 
It would be very hard to determine the correct result for test2 in

test2 = lambda: test(a=10)  # test2() returns a generator

def test(a):
'''Redefined as a non-generator!'''
# Now test2() returns None

Maybe there is an argument for supporting partial as a new feature, but I don’t 
think it is a bug. I think there is precedent with the inspect.getargspec etc.

--

___
Python tracker 

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



[issue29878] Add global instances of int 0 and 1

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1174

___
Python tracker 

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



[issue29992] Expose parse_string in JSONDecoder

2017-04-05 Thread Tobias Oberstein

New submission from Tobias Oberstein:

Though the JSONDecoder already has all the hooks internally to allow for a 
custom parse_string 
(https://github.com/python/cpython/blob/master/Lib/json/decoder.py#L330), this 
currently is not exposed in the constructor JSONDecoder.__init__.

It would be nice to expose it. Currently, I need to do hack it: 
https://gist.github.com/oberstet/fa8b8e04b8d532912bd616d9db65101a

--
messages: 291167
nosy: oberstet
priority: normal
severity: normal
status: open
title: Expose parse_string in JSONDecoder
type: enhancement

___
Python tracker 

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



[issue29991] http client marks valid multipart headers with defects.

2017-04-05 Thread Martin Panter

Martin Panter added the comment:

Looks like a duplicate of Issue 29353, which has a more complete patch 
proposed. However, see my comment about a problem with using heartersonly=True.

My policy-flag.v2.patch for Issue 24363 may help (the details have faded from 
my mind, but I suspect it will either fix the problem as-is, or could be 
adapted).

--
nosy: +martin.panter
resolution:  -> duplicate
superseder:  -> Incorrect handling of HTTP response with "Content-Type: 
message/rfc822" header

___
Python tracker 

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



[issue10076] Regex objects became uncopyable in 2.5

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1173

___
Python tracker 

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



[issue10076] Regex objects became uncopyable in 2.5

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since the pattern and the match objects can be considered as immutable, it is 
worth to implement __copy__ and __deepcopy__ returning the object itself. 
Proposed PR does this. It also fixes signatures of __deepcopy__ methods.

Since copying didn't work in all maintained version for long time, this is 
rather a new feature than a bug fix.

--
nosy: +serhiy.storchaka
type: behavior -> enhancement
versions: +Python 3.7 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue29991] http client marks valid multipart headers with defects.

2017-04-05 Thread Paresh Verma

New submission from Paresh Verma:

When http client parses a multipart response, it always taints the headers with 
defects. e.g.
Use the attached file to start a simple http server, using current python exec, 
with commands:
```python .\example_bug.py server```
and run client with:
```python .\example_bug.py client```
which outputs:
"""[StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()]"""

even though the multipart response is correct.
This appears to be happening because http.client, when parsing headers of 
response doesn't specifies the headersonly option, which leads to 
email.feedparser to parse response body (but http.client only passes header 
lines for parsing in parse_headers method, and the request body isn't available 
to email.feedparser).

The issue has been mentioned at:
https://github.com/shazow/urllib3/issues/800
https://github.com/Azure/azure-storage-python/issues/167

The submitted PR partially fixes the problem:
```..\python.bat .\example_bug.py client```
which outputs
"""[MultipartInvariantViolationDefect()]"""

--
components: Library (Lib)
files: example_bug.py
messages: 291165
nosy: pareshverma91
priority: normal
pull_requests: 1172
severity: normal
status: open
title: http client marks valid multipart headers with defects.
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file46780/example_bug.py

___
Python tracker 

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



[issue29955] logging decimal point should come from locale

2017-04-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Since the date format itself isn't localized (fortunately), there is no reason 
to localize the decimal point either.  People wanting a localized logging 
format can easily override the default configuration.  And this proposal would 
break compatibility with existing log parsing tools.

We could probably bikeshed the default logging configuration for a long time, 
but there is value in not changing the defaults from one release to another.

--
nosy: +pitrou

___
Python tracker 

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



[issue29569] threading.Timer class: Continue periodical execution till action returns True

2017-04-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This will obviously break some existing code which passes a function returning 
true to Timer.  I concur with Raymond: I don't think this is a good idea.  
Also, the Timer class itself is a rather simplistic answer to the problem of 
scheduling callbacks in the future (it uses a dedicated thread per callback, 
which is extremely wasteful).  You'll find better solutions in more modern 
toolkits, such as asyncio; or you can easily write your own logic yourself.

--
nosy: +tim.peters

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2017-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Wouldn't it be easily to let the OP apply AC to some other module.  Right now, 
it isn't a very good fit and was this a tough one to start with.

--

___
Python tracker 

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



[issue29762] Use "raise from None"

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue29762] Use "raise from None"

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 5affd23e6f42125998724787025080a24839266e by Serhiy Storchaka in 
branch 'master':
bpo-29762: More use "raise from None". (#569)
https://github.com/python/cpython/commit/5affd23e6f42125998724787025080a24839266e


--

___
Python tracker 

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



[issue29944] Argumentless super() fails in classes constructed with type()

2017-04-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Now `Py_ssize_t(accept={int, NoneType})` can be used instead of a local 
converter.

--

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Lisa.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue29990] Range checking in GB18030 decoder

2017-04-05 Thread Ma Lin

Changes by Ma Lin :


--
pull_requests: +1171

___
Python tracker 

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



[issue29960] _random.Random state corrupted on exception

2017-04-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29960] _random.Random state corrupted on exception

2017-04-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue29984] Improve test coverage for 'heapq' module

2017-04-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue29959] re.match failed to match left square brackets as the first char

2017-04-05 Thread bo qu

bo qu added the comment:

hi Serhiy Storchaka
thank you for your explanation, it helps a lot

2017-04-01 15:44 GMT+08:00 Serhiy Storchaka :

>
> Serhiy Storchaka added the comment:
>
> re.match() checks if the beginning of the string matches the regular
> expression pattern. Use re.search() if you want to find the match not at
> the beginning of the string.
>
> https://docs.python.org/3/library/re.html#re.match
> https://docs.python.org/3/library/re.html#re.search
>
> --
> nosy: +serhiy.storchaka
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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