[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Xiang Zhang

Xiang Zhang added the comment:

hg bisect tells me changeset 95830:661cdbd617b8 introduces this behaviour.

--
nosy: +xiang.zhang
type: crash -> 

___
Python tracker 

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



[issue26813] Wrong Japanese translation of "Adverb" on Documentation

2016-04-20 Thread Ken Miura

New submission from Ken Miura:

In Japanese Python document, English word "Adverb" is translated to "形容動詞", but 
it's "副詞" actually.

http://docs.python.jp/2/library/re.html#finding-all-adverbs
http://docs.python.jp/2/library/re.html#finding-all-adverbs-and-their-positions

--
assignee: docs@python
components: Documentation
messages: 263881
nosy: Ken Miura, docs@python
priority: normal
severity: normal
status: open
title: Wrong Japanese translation of "Adverb" on Documentation

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2016-04-20 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2016-04-20 Thread Lars Gustäbel

Lars Gustäbel added the comment:

Closed after years of inactivity.

--
resolution:  -> works for me
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



[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
type:  -> crash

___
Python tracker 

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



[issue16679] Add advice about non-ASCII wsgiref PATH_INFO

2016-04-20 Thread Graham Dumpleton

Graham Dumpleton added the comment:

What I get in Apache for:

http://127.0.0.1:8000/a=тест

in Safari browser is:

'REQUEST_URI': '/a=%D1%82%D0%B5%D1%81%D1%82',
'PATH_INFO': '/a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',

Where as for curl see:

'REQUEST_URI': '/a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',
'PATH_INFO': '/a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',

For:

http://127.0.0.1:8000/?a=тест

in Safari get:

'REQUEST_URI': '/?a=%D1%82%D0%B5%D1%81%D1%82',
'PATH_INFO': '/'
'QUERY_STRING': 'a=%D1%82%D0%B5%D1%81%D1%82',

and curl:

'REQUEST_URI': '/?a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',
'PATH_INFO': '/',
'QUERY_STRING': 'a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',

So yes curl sends as bytes rather than encoded, expected that.

Gunicorn on:

http://127.0.0.1:8000/a=тест

sees for Safari:

 'PATH_INFO': '/a=Ñ\x82еÑ\x81Ñ\x82',
 'QUERY_STRING': '',
 'RAW_URI': '/a=%D1%82%D0%B5%D1%81%D1%82',

and curl:

 'PATH_INFO': '/a=Ã\x91Â\x82Ã\x90µÃ\x91Â\x81Ã\x91Â\x82',
 'QUERY_STRING': '',
 'RAW_URI': '/a=Ñ\x82еÑ\x81Ñ\x82',

Gunicorn on:

http://127.0.0.1:8000/?a=тест

sees for Safari:

 'PATH_INFO': '/',
 'QUERY_STRING': 'a=%D1%82%D0%B5%D1%81%D1%82',
 'RAW_URI': '/?a=%D1%82%D0%B5%D1%81%D1%82',

and curl:

 'PATH_INFO': '/',
 'QUERY_STRING': 'a=Ñ\x82еÑ\x81Ñ\x82',
 'RAW_URI': '/?a=Ñ\x82еÑ\x81Ñ\x82',

So in Apache I get through UTF-8 byte string as Latin-1. So can see multi byte 
characters. Gunicorn is doing something different when gets raw bytes from 
curl. As does wsgiref. Showed Gunicorn as it has RAW_URI which is supposed to 
be the same as REQUEST_URI in Apache, but actually isn't showing the same there 
either.

Whatever is happening, mod_wsgi still gives a good outcome.

--

___
Python tracker 

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



[issue16679] Add advice about non-ASCII wsgiref PATH_INFO

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

PEP  defers to a draft CGI specification for PATH_INFO and QUERY_STRING: 
. (Dunno why it didn’t 
reference the final RFC 3875 instead, published 2004.) Anyway, both draft and 
final RFCs say “PATH_INFO is not URL-encoded”, but “the QUERY_STRING variable 
contains a URL-encoded search or parameter string”.

Graham, maybe you are seeing Latin-1 code points in PATH_INFO that have been 
translated from the %XX URL syntax, and QUERY_STRING retaining the original %XX 
syntax.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

Graham: On my Linux computer, Curl seems to treat the test “URL” as a string of 
bytes and doesn’t percent encode it. Therefore you may be affected by Issue 
26717 which I fixed the other day. But in real life, URLs are meant to only 
have literal ASCII characters (even if they encode other characters), so this 
shouldn’t be a big problem. Compare IRI vs URI. Browsers tend to percent-encode 
using UTF-8.

--

___
Python tracker 

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



[issue26812] ExtendedInterpolation drops user-defined 'vars' during _interpolate_some() recursion

2016-04-20 Thread Yih-En Andrew Ban

New submission from Yih-En Andrew Ban:

In Python 3.5.1, configparser.ExtendedInterpolation will drop the user-defined 
'vars' passed in via ConfigParser.get(vars=...) due to a bug when recursing 
beyond depth 1 in ExtendedInterpolation._interpolate_some(). Line 509 of 
configparser.py currently reads: 'dict(parser.items(sect, raw=True))' This 
appears to be a mistake and should instead be: 'map', which includes the 
user-defined vars.

The following code will trigger an InterpolationMissingOptionError without the 
fix, and runs as expected with the fix:

from configparser import *
parser = ConfigParser( interpolation=ExtendedInterpolation() )
parser.add_section( 'Section' )
parser.set( 'Section', 'first', '${userdef}' )
parser.set( 'Section', 'second', '${first}' )
parser[ 'Section' ].get( 'second', vars={'userdef': 'userval'} )

--
components: Library (Lib)
messages: 263876
nosy: lukasz.langa, yab-arz
priority: normal
severity: normal
status: open
title: ExtendedInterpolation drops user-defined 'vars' during 
_interpolate_some() recursion
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue22359] Remove incorrect uses of recursive make

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

Looks pretty good. One more question: Why do you make the linking of 
_freeze_importlib conditional, but always build $(PGEN)?

--

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

No strong opinion on changing the name to _ChainMap, as long as it only goes 
into 3.6.

--
stage:  -> patch review

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Graham Dumpleton

Graham Dumpleton added the comment:

This gets even weirder.

Gunicorn behaves same as wsgiref.

However, it turns out they both only show the unexpected result if using curl. 
If you use safari they are both fine.

Waitress blows up altogether on it with an exception when you use curl as 
client, but is okay with Safari and gives what I expect.

My mod_wsgi package gives what I expect whether you use curl or Safari. So 
Apache may be doing some magic in there to allow it to always work. No idea. 
But obviously mod_wsgi rules as it works regardless. :-)

uWSGI doesn't want to compile on MacOS X for me at the moment.

That Apache works properly whether use curl or Safari and other WSGI servers 
don't suggests something is amiss.

--

___
Python tracker 

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



[issue16679] Add advice about non-ASCII wsgiref PATH_INFO

2016-04-20 Thread Graham Dumpleton

Graham Dumpleton added the comment:

As I commented on Issue 26808, it actually looks to me like the QUERY_STRING is 
processed fine and it is actually PATH_INFO that is not. I am confused at this 
point. I hate dealing with these WSGI level details now. :-(

--

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Graham Dumpleton

Graham Dumpleton added the comment:

There does appear to be something wrong with wsgiref, because with that 
rewritten code you should for:

curl http://127.0.0.1:8000/тест

get:

pi:
/тест
qs:
{}

and for:

curl http://127.0.0.1:8000/?a=тест

get:

pi:
/
qs:
{'a': ['тест']}

The PATH_INFO case appears to fail though and outputs:

pi:
/тест
qs:
{}

Don't think I have missed anything.

--

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Graham Dumpleton

Graham Dumpleton added the comment:

Your code should be written as:

res = """\
e:
{}
pi:
{}
qs:
{}
""".format(
pprint.pformat(e),
urllib.parse.unquote(e['PATH_INFO'].encode('Latin-1').decode('UTF-8')),

urllib.parse.parse_qs(urllib.parse.unquote(e['QUERY_STRING'].encode('Latin-1').decode('UTF-8')))
)

--
nosy: +grahamd

___
Python tracker 

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



[issue16577] Suspect test.test_codeccallbacks.test_mutatingdecodehandler

2016-04-20 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> needs patch
type:  -> enhancement
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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2016-04-20 Thread Luiz Poleto

Luiz Poleto added the comment:

The Doc/library/os.rst bit in the current patch fails to apply in all versions 
specified in this bug report (it seems that it was generated before the commit 
that included an earlier version of it).

--
nosy: +luiz.poleto

___
Python tracker 

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



[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

The second patch looks reasonable (I left one minor grammar comment).

About getproxies_environment(), I meant that if you set no_proxy="", it may be 
ignored if NO_PROXY=. . . is also set. E.g. if you already have these set:

http_proxy=http://proxy
no_proxy=example.net
NO_PROXY=example.net

you should be able to override no_proxy="" to cancel bypassing for example.net.

I agree the proxy_bypass() docstring looks wrong. If you want to write a patch 
to fix that, or to make the code more efficient or easier to understand, that 
would be good.

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

If you decide to only do a Python implementation, the main reason to write a 
wrapper in C would be because the datetime class is defined in C. Similar to 
how the datetime_strptime() function in Modules/_datetimemodule.c imports and 
calls _strptime._strptime_datetime().

An alternative might be to subclass the C classes _datetime.datetime, etc, and 
define the methods directly in those subclasses. Similar to how the C-defined 
class _socket.socket is subclassed in Lib/socket.py and more methods are added.

--

___
Python tracker 

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



[issue26811] segfault due to null pointer in tuple

2016-04-20 Thread random832

New submission from random832:

I was writing something that iterates over all objects in gc.get_objects(). I 
don't know precisely where the offending tuple is coming from, but nearby 
objects in gc.get_objects() appear to be related to frozen_importlib.

A tuple exists somewhere with a null pointer in it. Attempting to iterate over 
it or access its item results in a segmentation fault.

I confirmed this on both Linux and OSX.

Python 3.6.0a0 (default:778ccbe3cf74, Apr 20 2016, 20:17:38)

--
components: Interpreter Core
files: fnt.py
messages: 263866
nosy: random832
priority: normal
severity: normal
status: open
title: segfault due to null pointer in tuple
versions: Python 3.6
Added file: http://bugs.python.org/file42545/fnt.py

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-04-20 Thread STINNER Victor

STINNER Victor added the comment:

Nathaniel, Antoine: ping?

--

___
Python tracker 

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



[issue23236] asyncio: add timeout to StreamReader read methods

2016-04-20 Thread Alexander Mohr

Alexander Mohr added the comment:

any updates on this?  I think this would be perfect for 
https://github.com/aio-libs/aiobotocore/issues/31

--
nosy: +thehesiod

___
Python tracker 

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



[issue26810] inconsistent garbage collector behavior across platforms when using ctypes data-structures

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

You should write your program so that it does not release objects until they 
are no longer needed, then it can handle the garbage collector running at any 
time. But it is not clear to me what your offending null pointer is. Your code 
has lots of pointers that could be null.

Can you provide a complete demonstration, perhaps using a standard function 
such as libc.printf, rather than your arbitrary function?

--
nosy: +martin.panter
stage:  -> test needed

___
Python tracker 

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



[issue16679] Add advice about non-ASCII wsgiref PATH_INFO

2016-04-20 Thread Alexey Gorshkov

Alexey Gorshkov added the comment:

I'm from Issue 26808. I'd like to see some explanation on: how about 
QUERY_STRING value? Why only PATH_INFO is encoded in such a manner, but 
QUERY_STRING is passed without any changes and does not requires any latin-1 to 
utf-8 recodings?

--
nosy: +animus

___
Python tracker 

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



[issue26781] os.walk max_depth

2016-04-20 Thread Aviv Palivoda

Aviv Palivoda added the comment:

I am not sure about the wide use of this feature but I do think this is a nice 
feature to add to os.walk. I can see how you can implement is_too_deep by 
counting the number of separators in the path. However I don't think it is 
trivial to do that. In addition doing the same when topdown is False will not 
work.
As for the other limitations you suggested I think they are less trivial then 
limiting the recursion depth.

As for the "symlink infinite loop" I agree that it will be better to do that by 
tracking the paths we have already visited but avoiding infinite loop is just a 
bonus that you get from this feature.

--

___
Python tracker 

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



[issue26806] IDLE not displaying RecursionError tracebacks

2016-04-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Interesting idea.  We avoid the problem by adding something like the following 
to run.py

_setrecursionlimit = sys.setrecursionlimit
def setrecursionlimit(n):
_setrecursionlimit(max(n, 50))
sys.setrecursionlimit = setrecursionlimit

This works when entered interactively, and I presume it would within run.py.  
For _setrecursionlimit to be accessible from user code (to reverse the monkey 
patching), it would have to be attached to the function as an attribute.

setrecursionlimit.original = _setrecursionlimit

Though user-friendly for most users, this would make IDLE execute code 
differently from raw Python.  The builtin has a lower limit, based on the 
current stack depth, but it raises instead of setting a higher limit.  I 
presume we could use len(inspect.stack()) to get the current 'recursion depth', 
and add, say, 30 rather than 3. (The current error message could be more 
helpful.)

>>> sys.setrecursionlimit(3)
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: cannot set the recursion limit to 3 at the recursion depth 1: 
the limit is too low
>>> sys.setrecursionlimit(4)
>>> f()
>>>
>>> def f():
...   print('f')
...   f()
...
>>> f()
>>>

The call to f seems to be silently ignored.  This does not seem helpful.

Whatever we do, I would mention it in a revision of the proposed paragraph 
above.

--

___
Python tracker 

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



[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-20 Thread Hans-Peter Jansen

Hans-Peter Jansen added the comment:

Hi Martin, hi Senthil,

please find a new patch attached, that incorporates your suggestions.

 * added a comment to get_proxies doc in urllib.rst
 * documented and fixed the mixed case scheme 
 * added a note to proxy_bypass_environment, that behaves slightly 
   different in this respect

Yes, mixed case situations are not handled in proxy_bypass_environment,
just lowercase and uppercase, while lowercase is preferred correctly.
I think, that the mixed case situation is pathologic enough and deserves to be 
ignored here. 

BTW, while looking at the code, I noticed, that most docstrings of the callers 
of proxy_bypass_environment are wrong: they say, that the proxies dict is 
returned, but they return the value of proxy_bypass_environment(), not 
get_proxies().

A follow up patch could do this in order to clean up this mess:
since there's always a call to get_proxies preceding the call to 
proxy_bypass_environment, we could add a second argument to the latter, passing 
in the proxy dict, that is thrown away at the moment. Since that carries a 'no' 
key already, if it exists, using it here would fix this ambiguity. While at it, 
fix up the affected docstrings.

What do you think about the attached patch and the last paragraph?

--
Added file: 
http://bugs.python.org/file42544/python-urllib-prefer-lowercase-proxies.diff

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

This patch corrects the non-ascii quote character in the Misc/NEWS diff.

--
Added file: http://bugs.python.org/file42543/unix_abstract_namespace_3.patch

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Here is the patch.

As a  reference, issue #8373 with changeset 1f23bb74f4bc changed the AF_UNIX
socket addresses encoding from UTF-8 to the file system encoding and the
'surrogateescape' error handler (PEP 383).

--
Added file: http://bugs.python.org/file42542/unix_abstract_namespace_2.patch

___
Python tracker 

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



[issue26806] IDLE not displaying RecursionError tracebacks

2016-04-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We can monkeypatch sys.setrecursionlimit() to set recursion limit to at least 
say 50.

--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2016-04-20 Thread Alessandro Cucci

Alessandro Cucci added the comment:

I would like to work on a patch if nobody currently are working on it. I'll 
keep you updated

--
nosy: +acucci

___
Python tracker 

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



[issue26806] IDLE not displaying RecursionError tracebacks

2016-04-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks for the investigation.  I copied the limit from a python-ideas example 
and did not realize that IDLE adds so much to the call stack.  I should add a 
bit on the subject to the IDLE doc in "3.2. IDLE-console differences".  (It can 
also impact tracebacks -- as reported on a couple of tracker issues.)

"IDLE adds it own calls to the call stack before (and possibly after) running 
user code.  Tracebacks are filtered to remove these, but the filtering may not 
be perfect.  Setting a recursion limit that is too low, such as with 
sys.setrecursionlimit(20), will result in mysterious malfunctions."

--
components: +Documentation, IDLE
stage: test needed -> needs patch

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-20 Thread Christian Heimes

Christian Heimes added the comment:

First experimental version of blake2b and blake2s for Python 3.6:
https://github.com/tiran/cpython/commits/feature/blake2

The code is based on Dmitry Chestnykh's pyblake2 but modified to support 
argument clinic. I had to replace the macro magic with plain C code. The clinic 
is not able to deal with the macros. blake2s.c is auto-generated from blake2b.c

--

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread Emanuel Barry

Changes by Emanuel Barry :


Added file: http://bugs.python.org/file42541/ChainMap___all___2.patch

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread leewz

leewz added the comment:

Why not both?

--

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread Emanuel Barry

Emanuel Barry added the comment:

I added an underscore in front of ChainMap, but I kept the __all__ definition 
because I think it should be there regardless (like every module, basically).

--
Added file: http://bugs.python.org/file42540/ChainMap___all__.patch

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Judging by the line “import re as _re”, somebody once tried to use the second 
> technique for the “string” module.

So I think it is preferable to use this technique for ChainMap.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26799] gdb support fails with "Invalid cast."

2016-04-20 Thread STINNER Victor

STINNER Victor added the comment:

> The second option seems like the safest choice, attached is a patch that 
> addresses just that.

Thanks, I applied your patch (your a bugfix, you forgot one "return" ;-)).

I also inlined _type_void_ptr() into _sizeof_void_p(), since it was only called 
there.

Thanks for your bug report and your patch.

Can you please sign the PSF Contributor Agreement? 
https://www.python.org/psf/contrib/contrib-form/

It's required when you contribute to Python. In short, it warns you that Python 
is free software ;-)

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



[issue26799] gdb support fails with "Invalid cast."

2016-04-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e4561aad29e6 by Victor Stinner in branch '2.7':
Fix python-gdb.py: get C types on demand
https://hg.python.org/cpython/rev/e4561aad29e6

New changeset 952c89a10be6 by Victor Stinner in branch '3.5':
Issue #26799: Fix typo in Misc/NEWS
https://hg.python.org/cpython/rev/952c89a10be6

--

___
Python tracker 

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



[issue26799] gdb support fails with "Invalid cast."

2016-04-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e1c6f8895fd8 by Victor Stinner in branch '3.5':
python-gdb.py: get C types at runtime
https://hg.python.org/cpython/rev/e1c6f8895fd8

New changeset 6425728d8dc6 by Victor Stinner in branch 'default':
Merge 3.5: Issue #26799
https://hg.python.org/cpython/rev/6425728d8dc6

--
nosy: +python-dev

___
Python tracker 

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



[issue26810] inconsistent garbage collector behavior across platforms when using ctypes data-structures

2016-04-20 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge, pitrou

___
Python tracker 

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



[issue26810] inconsistent garbage collector behavior across platforms when using ctypes data-structures

2016-04-20 Thread unsec treedee

New submission from unsec treedee:

The garbage collector is not behaving consistently across platforms for python 
2.7.11.

I realize that the example code and style is not proper :-)

On the Mac OSX platform this code runs without the garbage collector "cleaning 
house" and there is no resulting crash from a NULL pointer.  On the Linux 
platform the garbage collector decides to "clean house" (deallocates the 
object) resulting in a NULL pointer which is not handled correctly by the 
c-function code (some legacy stuff) and causes a segmentation fault.

Temporarily disabling the garbage collector and enabling it later on allows a 
workaround (valid or not) that is consistent on all platforms.

Improper coding and style aside... the issue I am reporting is the inconsistent 
behaviour of the garbage collector.  I am looking for consistency across 
platforms (same result on all platforms).  :-)

--
components: ctypes
files: gc_snippet_report_pybug.py
messages: 263846
nosy: unsec treedee
priority: normal
severity: normal
status: open
title: inconsistent garbage collector behavior across platforms when using 
ctypes data-structures
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file42539/gc_snippet_report_pybug.py

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2016-04-20 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue26799] gdb support fails with "Invalid cast."

2016-04-20 Thread Thomas

Thomas added the comment:

The second option seems like the safest choice, attached is a patch that 
addresses just that.

--
keywords: +patch
Added file: http://bugs.python.org/file42538/gdb-python-invalid-cast.patch

___
Python tracker 

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



[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-20 Thread Anthony Sottile

Anthony Sottile added the comment:

PEP states that environ variables are str variables decoded using
latin1:
https://www.python.org/dev/peps/pep-/#id19

Therefore, to get the original bytes, one must encode using latin1
On Apr 20, 2016 3:46 AM, "Александр Эри"  wrote:

>
> Александр Эри added the comment:
>
> Why wsgiref uses latin1? It must use utf-8.
>
> --
> keywords: +patch
> nosy: +Александр Эри
> Added file: http://bugs.python.org/file42531/simple_server.py.diff
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2016-04-20 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

___
Python tracker 

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



[issue20116] urlparse.parse_qs should take argument for query separator

2016-04-20 Thread Ruben D. Orduz

Ruben D. Orduz added the comment:

Hi all,

OP here. My intent was to optionally pass a separator parameter, _not_ 
enable/disable toggle.

--

___
Python tracker 

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



[issue20116] urlparse.parse_qs should take argument for query separator

2016-04-20 Thread Luiz Poleto

Luiz Poleto added the comment:

Based on the example provided by the OP, it appears that he would expect
the output to be:
{'family': ['citrus'], 'fruits': ['lemon;lime']}

Since the W3C recommendation for the application/x-www-form-urlencoded type
specify using '&' to separate the parameters in the query string (';' is
not mentioned there), I recommended a parameter for disabling the use of
';' as a separator (but '&' will still be the separator to be used).

The only thing I see against using the RFC is that although it specifies
which characters are valid in a query string, it does not define how they
should be used; that is done by W3C's application/x-www-form-urlencoded and
it is very specific about using '&' as a separator.

--

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

I will give it a try.

--

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread STINNER Victor

STINNER Victor added the comment:

> Then it seems that makesockaddr() should be fixed instead of the logging 
> handler.

Yes. That's why I didn't understand the issue at the beginning :-) Would you 
like to work on fixing the _socket module?

It may be worth to keep your syslog unit test. It's up to you.

--

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Then it seems that makesockaddr() should be fixed instead of the logging
handler.

--

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

makesockaddr() in socketmodule.c calls PyBytes_FromStringAndSize() when the
first byte is a null byte.

My opinion is not worth much in this matter :). The socket documentation does
say that AF_UNIX addresses are "represented as a string, using the file system
encoding", so the implementation looks wrong. However it is possible that
PyUnicode_DecodeFSDefault() fails for some file system encodings when the
encoded address contains null bytes ?

--

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread STINNER Victor

STINNER Victor added the comment:

> However it is possible that
PyUnicode_DecodeFSDefault() fails for some file system encodings when the
encoded address contains null bytes ?

No, it's not possible. Undecode bytes are escaped as surrogate characters using 
the surrogateescape error handler. See the PEP 393.

--

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread Emanuel Barry

Emanuel Barry added the comment:

Thanks SilentGhost, seems my brain decided not to see uppercase names :) 
Attached patch adds Formatter and Template as well.

--
Added file: http://bugs.python.org/file42537/string___all___2.patch

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread SilentGhost

SilentGhost added the comment:

> Silent Ghost: perhaps you were thinking of Issue 23883 (adding to __all__ in 
> various modules). This case is the opposite: we want to limit the exported 
> names.

It was one of mine, issue 10895. Been dead for a while now.

--

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread Emanuel Barry

Emanuel Barry added the comment:

Patch fixes this the proper way by defining __all__ in the string module.

--
keywords: +patch
nosy: +ebarry
Added file: http://bugs.python.org/file42536/string___all__.patch

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

Okay looks like I was mistaken about dir(). It ignores __all__, and just gives 
you everything. But the star-import point is still valid :)

--

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread leewz

leewz added the comment:

(Never mind that last bit. I see it now.)

> I agree that the namespace pollution is a valid bug. It affects “from string 
> import *” and dir(string).

How do I get this behavior for `dir`? I get '_re' in `dir(string)`.

--

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread leewz

leewz added the comment:

> The fact that ChainMap pollutes namespace when doing star import ("from 
> string import *"), however, is unfortunate.

This is what I meant by "this kind of thing". (IPython also ignores underscored 
names for autocomplete suggestions, unless you start with an underscore. 
IPython doesn't respect `__all__` by default, but that's a report for IPython's 
tracker.)


> This case is the opposite: we want to limit the exported names.

(Well, not exactly the opposite. Same purpose.)

--

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Александр Эри

Александр Эри added the comment:

My browser encodes url in utf-8. To resolve this bug we need to look in web 
standards, not in pep.

--

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

I agree that the namespace pollution is a valid bug. It affects “from string 
import *” and dir(string). Normally, modules either define __all__ listing 
their exported names, or they are really careful to define non-exported names 
beginning with underscores (_). Judging by the line “import re as _re”, 
somebody once tried to use the second technique for the “string” module.

Silent Ghost: perhaps you were thinking of Issue 23883 (adding to __all__ in 
various modules). This case is the opposite: we want to limit the exported 
names.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread STINNER Victor

STINNER Victor added the comment:

Xavier de Gaye added the comment:
> when self.server_address is a string and contains a null byte, then
> getsockname() returns a bytes object.

Ah? It sounds strange to me that the type of getsockname() depends on
the NULL byte. I would also expect a Unicode name for the abstract
namespace. 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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

I think this is already covered in Issue 16679. PEP  says it’s meant to 
work this way.

I admit it is very quirky. See also Issue 22264 discussing future enhancements.

--
nosy: +martin.panter
resolution:  -> duplicate
status: open -> closed
superseder:  -> Add advice about non-ASCII wsgiref PATH_INFO

___
Python tracker 

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



[issue26807] mock_open()().readline() fails at EOF

2016-04-20 Thread Yolanda

Yolanda added the comment:

diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 7400fb7..9e47cd2 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -991,7 +991,10 @@ class CallableMixin(Base):
 raise effect
 
 if not _callable(effect):
-result = next(effect)
+try:
+result = next(effect)
+except StopIteration:
+result = None
 if _is_exception(result):
 raise result
 if result is DEFAULT:

--
nosy: +yolanda.robla

___
Python tracker 

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



[issue20001] pathlib inheritance diagram too large

2016-04-20 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +easy
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread SilentGhost

SilentGhost added the comment:

I wouldn't say it matter, "from configparser import _ChainMap" works too, but 
that's just how imports work in Python. There is not reason to do what you've 
done on purpose - ChainMap is undocumented and is clearly just a detail of 
implementation.

The fact that ChainMap pollutes namespace when doing star import ("from string 
import *"), however, is unfortunate. I believe there was an issue around that 
was supposed to add missing __all__, but I'm not able to find that issue atm.

--
nosy: +SilentGhost, georg.brandl

___
Python tracker 

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



[issue26809] `string` exposes ChainMap from `collections`

2016-04-20 Thread leewz

New submission from leewz:

I don't know if this kind of thing matters, but `from string import ChainMap` 
works (imports from `collections). It's used internally by `string`. This was 
done when ChainMap was made official:
https://github.com/python/cpython/commit/2886808d3809d69a6e9b360380080140b95df0b6#diff-4db7f78c8ac9907c7ad6231730d7900c

You can see in the above commit that `configparser` had `_ChainMap` changed to 
`ChainMap as _ChainMap`, but this was not done in `string`.

--
components: Library (Lib)
messages: 263824
nosy: leewz
priority: normal
severity: normal
status: open
title: `string` exposes ChainMap from `collections`
type: behavior
versions: 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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov

Alexey Gorshkov added the comment:

also attaching same print output in console

--
Added file: http://bugs.python.org/file42535/Screenshot from 2016-04-20 
14-28-03.png

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov

Alexey Gorshkov added the comment:

take a look at 'pi:' result, please. - attaching screenshot

--
Added file: http://bugs.python.org/file42534/Screenshot from 2016-04-20 
14-26-03.png

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread SilentGhost

SilentGhost added the comment:

What do you mean by "breaks"? Also, why do you encode your string as utf-8?

--
components: +Library (Lib) -Extension Modules
nosy: +SilentGhost, orsenthil

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Александр Эри

Александр Эри added the comment:

look also #issue26717

--
nosy: +Александр Эри

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov

Changes by Alexey Gorshkov :


Added file: http://bugs.python.org/file42533/t.py

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov

Changes by Alexey Gorshkov :


Removed file: http://bugs.python.org/file42532/t.py

___
Python tracker 

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



[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov

New submission from Alexey Gorshkov:

example code is in attachment

example URI is (for example): http://127.0.0.1:8005/тест

--
components: Extension Modules
files: t.py
messages: 263819
nosy: animus
priority: normal
severity: normal
status: open
title: wsgiref.simple_server breaks unicode in URIs
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file42532/t.py

___
Python tracker 

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



[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-20 Thread Александр Эри

Александр Эри added the comment:

Why wsgiref uses latin1? It must use utf-8.

--
keywords: +patch
nosy: +Александр Эри
Added file: http://bugs.python.org/file42531/simple_server.py.diff

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The SysLogHandlerTest class instantiates a 'server_class' that eventually calls 
the
server_bind() method of the TCPServer class of the socketserver module.

This server_bind() method executes the statements:

self.socket.bind(self.server_address)
self.server_address = self.socket.getsockname()

and when self.server_address is a string and contains a null byte, then
getsockname() returns a bytes object.

So finally, self.server in SysLogHandlerTest is a bytes object in this case,
hence the needed to fix Lib/logging/handlers.py.

--

___
Python tracker 

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



[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2016-04-20 Thread jcristau

jcristau added the comment:

Well yes, but as far as I can tell that's why python used B.__new__ for C 
before your change, as that has a compatible layout.

--

___
Python tracker 

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



[issue22359] Remove incorrect uses of recursive make

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Martin, thanks for the review and the suggestions.

The attached patch makes the following changes:
* do not modify the source files so as not to break builds made from
  read-only build sources (as per issue 15819)
* the cross-build copies the graminit.[ch] files to the build directory
* fix tab indentation

Patch tested by checking that the graminit.[ch] time stamps do not
change in the source directory afer a build and after a cross-build,
and by running the test suite both natively and on android emulator.

--
Added file: http://bugs.python.org/file42530/crossbuild-sources-readonly.patch

___
Python tracker 

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



[issue26807] mock_open()().readline() fails at EOF

2016-04-20 Thread Robert Collins

New submission from Robert Collins:

>>> import unittest.mock
>>> o = unittest.mock.mock_open(read_data="fred")
>>> f = o()
>>> f.read()
'fred'
>>> f.read()
''
>>> f.readlines()
[]
>>> f.readline()
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/robertc/work/cpython/Lib/unittest/mock.py", line 935, in __call__
return _mock_self._mock_call(*args, **kwargs)
  File "/home/robertc/work/cpython/Lib/unittest/mock.py", line 994, in 
_mock_call
result = next(effect)
StopIteration

--
components: Library (Lib)
messages: 263814
nosy: rbcollins
priority: normal
severity: normal
stage: test needed
status: open
title: mock_open()().readline() fails at EOF
type: behavior
versions: 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



[issue21668] The select and time modules uses libm functions without linking against it

2016-04-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7530caa5ed1a by Victor Stinner in branch 'default':
Issue #21668: Add also Chi Hsuan Yen to Misc/ACKS
https://hg.python.org/cpython/rev/7530caa5ed1a

--

___
Python tracker 

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



[issue21668] The select and time modules uses libm functions without linking against it

2016-04-20 Thread STINNER Victor

STINNER Victor added the comment:

> Xavier de Gaye: "The patch should be acknowledged in Misc/NEWS to Chi Hsuan 
> Yen and not to me."

Oh sorry. I see 4 authors in attached patches, I picked the latest. Thank you 
to all authors for your contribution on this issue ;-) I fixed the author in 
Misc/NEWS.

--

___
Python tracker 

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



[issue21668] The select and time modules uses libm functions without linking against it

2016-04-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f76753f26982 by Victor Stinner in branch 'default':
Issue #21668: Fix author of the patch.
https://hg.python.org/cpython/rev/f76753f26982

--

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread STINNER Victor

STINNER Victor added the comment:

Ok. And what is the link between abstract namespace and the fact that the 
syslog handler gets bytes? Is it tested by your change?

--

___
Python tracker 

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




[issue26802] Avoid copy in call_function_var when no extra stack args are passed

2016-04-20 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy: "I was not sure about documenting this change in Misc/NEWS, but I think 
that it is not worth to mention it in What's New. This is very minor change. 
It's effect on any real code is negligible. I have pushed it only because it is 
trivial, unlikely has a negative effect, and there is a hope that the 
accumulated effect of several similar minor optimizations can be noticeable."

I documented other similar optimizations which probably have a negligible 
effect. I also expect a visible effect when other optimizations are accumulated.

https://docs.python.org/dev/whatsnew/3.6.html#optimizations

It also a deliberate choice to document optimization. It's to communicate on 
the fact that we *are working* on performance. It looks like users are happy to 
see work done on this area:
https://twitter.com/TalkPython/status/720704770198126594/photo/1

The drawback is maybe that users may have too high expectations on these 
optimizations.

--

___
Python tracker 

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



[issue26802] Avoid copy in call_function_var when no extra stack args are passed

2016-04-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I was not sure about documenting this change in Misc/NEWS, but I think that it 
is not worth to mention it in What's New. This is very minor change. It's 
effect on any real code is negligible. I have pushed it only because it is 
trivial, unlikely has a negative effect, and there is a hope that the 
accumulated effect of several similar minor optimizations can be noticeable.

Simple refactoring or bug fix can have comparable performance effect on large 
program, but we don't mention this regression in What's New.

--

___
Python tracker 

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



[issue26800] Don't accept bytearray as filenames part 2

2016-04-20 Thread Philip Jenvey

Philip Jenvey added the comment:

Thanks Serhiy, I did not see the python-dev thread. This coincidentally came up 
recently in pypy3.

+1 for some kind of deprecation period needed

--

___
Python tracker 

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



[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-20 Thread Hans-Peter Jansen

Hans-Peter Jansen added the comment:

Hi Martin, hi Senthil,

thanks for the valuable comments. 

Will incorporate your suggestions later today.

Yes, Martin, it's a bug, and should be fixed for 2.7 and 3.5 as well, but I was 
unsure, if I get some feedback at all... Hence, this is a very nice experience 
for me. 

I'm out for jogging now,
Pete

--
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue26800] Don't accept bytearray as filenames part 2

2016-04-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In the light of issue8485 this looks as a bug. Thank you for investigating this 
Philip.

I already raised this issue on Python-Dev less than a week ago [1], and only 
Victor had answered, thus we can assume that the consensus about bytes-like 
paths is not changed.

The only question is whether we need the deprecation period before removing the 
support of non-bytes bytes-like paths. Since they are supported during two 
major releases, and there are even tests for this support, I think that the 
deprecation period is needed. Third-party code written in last 3.5 years can 
use this feature.

[1] http://comments.gmane.org/gmane.comp.python.devel/157296

--
nosy: +gvanrossum
stage:  -> needs patch

___
Python tracker 

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



[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Left testing only the most common cases: sys.__stdout__ is None or is non a 
terminal.

--
Added file: http://bugs.python.org/file42529/get_terminal_size_valueerror2.patch

___
Python tracker 

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



[issue21668] The select and time modules uses libm functions without linking against it

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The patch should be acknowledged in Misc/NEWS to Chi Hsuan Yen and not to me.

--

___
Python tracker 

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



[issue26803] syslog logging handler fails with address in unix abstract namespace

2016-04-20 Thread Xavier de Gaye

Xavier de Gaye added the comment:

A unix abstract socket address is defined here:
http://man7.org/linux/man-pages/man7/unix.7.html
as:

"Traditionally, UNIX domain sockets can be either unnamed, or bound to
a filesystem pathname (marked as being of type socket).  Linux also
supports an abstract namespace which is independent of the
filesystem."

and:

"abstract: an abstract socket address is distinguished (from a
pathname socket) by the fact that sun_path[0] is a null byte ('\0').
..."

It is also documented in the Python socket module documentation at
https://docs.python.org/3/library/socket.html
and tested in the TestLinuxAbstractNamespace test of
Lib/test/test_socket.py.

--

___
Python tracker 

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



[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-20 Thread Martin Panter

Martin Panter added the comment:

It’s not just documentation, it is a real bug. If you run

http_proxy="" HTTP_PROXY=http://bad-proxy python . . .

the empty value of lowercase “http_proxy” should have priority over the other 
one. At the moment it depends on the order of os.environ.items(), which I 
understand is random.

--

___
Python tracker 

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



[issue26780] Illustrate both binary operator conventions in PEP-8

2016-04-20 Thread Senthil Kumaran

Senthil Kumaran added the comment:

The patch is committed in changeset 9afe77ad549b.

Thanks for update Brandon. Citing the original source and stating the rationale 
for this suggestion was a great addition.

--
nosy: +orsenthil
resolution:  -> fixed
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



[issue26780] Illustrate both binary operator conventions in PEP-8

2016-04-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9afe77ad549b by Senthil Kumaran in branch 'default':
PEP-8 Update on Knuth style breaking of a long formula. #issue26780
https://hg.python.org/peps/rev/9afe77ad549b

--
nosy: +python-dev

___
Python tracker 

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