[issue29536] test_hashlib failure on Ubuntu 16.04

2017-02-15 Thread Martin Panter

Martin Panter added the comment:

Looks like the tests should run if the data is already downloaded. First run 
needs -u urlfetch. My guess is your data is somehow corrupted. Check out your 
copy of the files in Lib/test/data/, compare them to e.g. 
. If you delete the files and 
re-run the test, you should get a fresh copy.

If my theory is correct, I wonder how the data got corrupted.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29225] distutils.command.install_lib.get_outputs() wrong with extensions built inplace

2017-02-15 Thread Elvis Stansvik

Elvis Stansvik added the comment:

It's been over a month. It would be great if someone could at least acknowledge 
the bug. The current behavior is clearly wrong.

I realize changes to distutils is perhaps not the most fun thing to review, but 
I'd like some kind of fix for this to go in. I have a hard time seeing anyone 
is relying on this broken behavior or have put in workarounds for it, so 
provided the fix is good, it should have minimal impact.

--
nosy: +estan

___
Python tracker 

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



[issue29355] sqlite3: remove sqlite3_stmt_readonly()

2017-02-15 Thread Palm Kevin

Changes by Palm Kevin :


--
nosy: +palm.kevin

___
Python tracker 

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



[issue29540] Add compact=True flag to json.dump/dumps

2017-02-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Everyone can chime in with their thoughts, but Bob gets to make the decision on 
this one.

--

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Georg, do remember why this admonition was present?

--
nosy: +georg.brandl, rhettinger

___
Python tracker 

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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

In general, we should have a strong aversion to deprecation except in cases 
where something is actually broken.   API changes make it more difficult for 
people to migrate to Python 3 or to upgrade between minor releases.  

The longer an API has existed, the more pronounced are effects of changing it 
(invalidating published references, killing weakly maintained projects, and 
affecting more code that we may not know about).

--
nosy: +rhettinger

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

i do know what's causing it, it's the twilio module not cleanly finishing up. i 
pointed out my call to this in the initial description.

/usr/lib/python3.6/site-packages/httplib2/__init__.py:857: DeprecationWarning: 
key_file, cert_file and check_hostname are deprecated, use a custom context 
instead.
  check_hostname=disable_ssl_certificate_validation ^ True)
/usr/lib/python3.6/site-packages/psycopg2/extras.py:314: ResourceWarning: 
unclosed 
  ts = super(NamedTupleCursor, self).fetchall()
Object allocated at (most recent call first):
  File "/usr/lib/python3.6/ssl.py", lineno 401
_context=self, _session=session)
  File "/usr/lib/python3.6/http/client.py", lineno 1400
server_hostname=server_hostname)
  File "/usr/lib/python3.6/site-packages/httplib2/__init__.py", lineno 994
conn.connect()
  File "/usr/lib/python3.6/site-packages/httplib2/__init__.py", lineno 1071
(response, content) = self._conn_request(conn, request_uri, method, body, 
headers)
  File "/usr/lib/python3.6/site-packages/httplib2/__init__.py", lineno 1321
(response, content) = self._request(conn, authority, uri, request_uri, 
method, body, headers, redirections, cachekey)
  File "/usr/lib/python3.6/site-packages/twilio/rest/resources/base.py", lineno 
117
resp, content = http.request(url, method, headers=headers, body=data)
  File "/usr/lib/python3.6/site-packages/twilio/rest/resources/base.py", lineno 
152
resp = make_request(method, uri, **kwargs)
  File "/usr/lib/python3.6/site-packages/twilio/rest/resources/base.py", lineno 
200
resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
  File "/usr/lib/python3.6/site-packages/twilio/rest/resources/base.py", lineno 
333
resp, item = self.request("GET", uri)
  File "/usr/lib/python3.6/site-packages/twilio/rest/resources/base.py", lineno 
328
return self.get_instance(sid)
  File "provider.py", lineno 524
msg = self._twilio.messages.get(r.delivery_id)
  File "/usr/lib/python3.6/asyncio/events.py", lineno 126
self._callback(*self._args)
  File "/usr/lib/python3.6/asyncio/base_events.py", lineno 1425
handle._run()
  File "/usr/lib/python3.6/asyncio/base_events.py", lineno 421
self._run_once()
  File "/usr/lib/python3.6/site-packages/autobahn/asyncio/wamp.py", lineno 168
loop.run_forever()
  File "provider.py", lineno 595
runner.run(make)

the socket is referenced by ip:port correctly and is coherent with the stack 
trace. nothing about the IP, socket, or stack trace, is related to the 
referenced file:position that is reported:

/usr/lib/python3.6/site-packages/psycopg2/extras.py:314: ResourceWarning: 
unclosed 
  ts = super(NamedTupleCursor, self).fetchall()

the psycopg2 connection is against a completely different IP and on the 
standard pgsql port of 5432.

here's the snippet of psycopg2/extras.py:

313 def fetchall(self):
314 ts = super(NamedTupleCursor, self).fetchall()
315 nt = self.Record
316 if nt is None:
317 nt = self.Record = self._make_nt()
318 return list(map(nt._make, ts))

nothing at all between my pgsql database and twilio share any form of 
connection or socket and there are no similarly named variables, complex code 
paths, or global variables. the only object data which has any shared scope is 
the twilio message fetch using the ID fetched from the pgsql database. if this 
section of code is commented out, the resource warning vanishes.

msg = self._twilio.messages.get(r.delivery_id)

if i patch the involved calls in twilio so i can touch the socket object and 
close it such as:

class Response(object):
"""
Take a httplib2 response and turn it into a requests response
"""
def __init__(self, httplib_resp, content, url, http_obj):
self.content = content
self.cached = False
self.status_code = int(httplib_resp.status)
self.ok = self.status_code < 400
self.url = url
self.connections = http_obj.connections

(http_obj added which is an instance of httplib2.Http which has a property of 
.connections wherein sockets are cached)

then after modifying the twilio module to pass the Response object to me as 
well as the message resource, i can eventually in my code:

for r in rows:
resp, msg = self._twilio.messages.get(r.delivery_id)
errors[r.delivery_id] = r.recipient, msg.error_code, 
msg.error_message

for k in resp.connections:
resp.connections[k].close()

this closes all the cached sockets and ensures the ResourceWarning is never 
emitted. this messiness is another conversation however, the incorrect file:pos 
annotation for the ResourceWarning is the purpose of this bug.


the only way i can see this inaccurate message being presented as above, is if 
the resource warning code is not correctly tracking state inside GC runs. 
supposition:

* psycop

[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-15 Thread Igor Kudrin

New submission from Igor Kudrin:

It looks like resolving https://bugs.python.org/issue20160 didn't fix all the 
issues. When a large struct is used as a parameter, a reference to the object 
itself is passed to the function, not a reference to a temporary copy, as it is 
required in https://msdn.microsoft.com/en-us/library/zthk2dkh.aspx.

Here is the reproduction sample:

=== Sample.c: ===
typedef struct
{
  int v[3];
} Data;

__declspec(dllexport) void Cripple(Data data)
{
  data.v[0] = 0;
}

=== Sample.py ===
from ctypes import *

class Data(Structure):
_fields_ = [("v", c_int * 3)]

lib = cdll.LoadLibrary('Sample.dll')
getattr(lib, 'Cripple').argtypes = [Data]

data = Data()
data.v[0] = 42
lib.Cripple(data)
assert data.v[0] == 42
print "OK"

=== repro.cmd ===
call "%VS140COMNTOOLS%/../../VC/vcvarsall.bat" x86_amd64
cl /LD Sample.c
python Sample.py

--
components: Windows, ctypes
messages: 287831
nosy: Igor Kudrin, christian.heimes, doko, mark.dickinson, meador.inge, 
paul.moore, steve.dower, tim.golden, vinay.sajip, zach.ware
priority: normal
severity: normal
status: open
title: Still broken ctypes calling convention on MSVC / 64-bit Windows (large 
structs)
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



[issue29532] functools.partial is not compatible between 2.7 and 3.5

2017-02-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Agree that this is a bug.  Patch and test looks good.

--
nosy: +rhettinger

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-15 Thread INADA Naoki

INADA Naoki added the comment:

I've stopped to deprecating.  changed issue title.

--
title: deprecate PyEval_Call*() functions. -> Recommend PyObject_Call* APIs  
over PyEval_Call*() APIs

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think first at all PyEval_Call* functions should be documented (issue11165). 
The documentation should recommend to use corresponding PyObject_Call* 
functions and explicitly describe the difference between PyEval_Call* and 
PyObject_Call* APIs.

Few releases after deprecating PyEval_Call APIs in documentation we can add the 
Py_DEPRECATED attribute for emitting compiler warnings. Few releases after 
deprecating in code we can remove PyEval_Call* declarations from headers, but 
keep exporting them in binary library. In Python 4 (or other major release that 
will break binary compatibility) they can be removed at all.

--
dependencies: +Document PyEval_Call* functions

___
Python tracker 

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



[issue11165] Document PyEval_Call* functions

2017-02-15 Thread INADA Naoki

INADA Naoki added the comment:

I think PyObject_Call* APIs should be preferred.

As discussed in #29548, we can't remove or deprecate PyEval_Call*.
But I don't think it's worth enough to document them.
How about keep them undocumented?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue11165] Document PyEval_Call* functions

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

While they are undocumented there is no a place for adding the recommendation 
of using corresponding PyObject_Call* functions and describing the way of 
porting from PyEval_Call* functions to PyObject_Call* functions.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

"I think first at all PyEval_Call* functions should be documented
(issue11165). The documentation should recommend to use corresponding
PyObject_Call* functions (...)"

I *now* agree :-)

--
title: Recommend PyObject_Call* APIs  over PyEval_Call*() APIs -> Recommend 
PyObject_Call* APIs over PyEval_Call*() APIs

___
Python tracker 

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



[issue11165] Document PyEval_Call* functions

2017-02-15 Thread INADA Naoki

INADA Naoki added the comment:

In PR 75, I added a comment in Include/ceval.h, right before PyEval_Call* APIs.

https://github.com/python/cpython/pull/75/files#diff-da3df9def5eca3595399b0a5a7698eac

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Andrew Nester

Changes by Andrew Nester :


--
pull_requests: +76

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Andrew Nester

Andrew Nester added the comment:

I've just added PR fixing this.

--
nosy: +andrewnester

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread Martin Panter

Martin Panter added the comment:

You say that the line number is incorrect. What would you consider a correct 
line number to be?

Let me try again to explain my theory about garbage collection and reference 
cycles. Perhaps you have two objects a and b, linked such that a.x = b and b.y 
= a. This is a reference cycle. Suppose that the socket is also attached e.g. 
as the attribute a.socket. Even if all functions have deleted their references 
to a and b and the socket, the interpreter does not immediately realize that a 
and b (and therefore the socket) can be cleaned up and released from memory.

At some arbitrary point after everything has released its reference to a, b, 
and the socket, the interpreter will run the garbage collecter. It will pull 
apart the reference cycle, call the socket’s destructor, and trigger the 
warning. So I would expect that the line number that happened to trigger the 
garbage collector is indeed as reported. It is just not very useful in your 
case.

Please try calling gc.collect() at some point before just before the line 
indicated in the warning. That should force the warning to be emitted as part 
of the garbage collector run, and indicate that was indeed the indicated line 
that was triggering the warning.

--
resolution:  -> not a bug

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

The report issue is not a bug. By design, Python cannot emits the 
ResourceWarning warning where you expect that it should be emitted. Martin 
explained you the thing with reference counter, reference cycles and the 
garbage collector.

It is exactly *why* I implemented the glue with tracemalloc to provide the 
traceback where the socket was allocated. I'm very happy to see that this 
feature (the traceback using tracemalloc) works as expected!

By the way, the warning module might log a message suggesting to enable 
tracemalloc to get the traceback if tracemalloc is available but disabled? What 
do you think?

The root issue is that the code doesn't close the SSLSocket: fix the code to 
close the socket, no?

--
nosy: +haypo

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

FYI the implementation of the ResourceWarning traceback was not as simple as I 
expected :-) I just wrote a blog post about, search for "ResourceWarning 
warnings now come with a traceback" in:
https://haypo.github.io/contrib-cpython-2016q1.html

--

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

i quite understand the way objects can be associated with reference counts by 
using a, a.b, c=a.b, d=a, etc etc, and how they increase/decrease and when the 
GC can prune the objects. yes, the root issue is the unclosed web socket and 
i've already filed a bug with Twilio.

@Martin,

/usr/lib/python3.6/site-packages/psycopg2/extras.py:314: ResourceWarning: 
unclosed 

/usr/lib/python3.6/site-packages/psycopg2/extras.py:314 is unrelated to the 
resource in question. there is nothing in psycopg2 that can have any direct or 
indirect reference to the tcp/443 socket used by the twilio by any path in the 
code all the way back to glibc under python. nothing in psycopg2 and twilio 
down to _ssl/glibc have any associated references.

the reference link between the two is at best as vague as connecting the water 
in the garden hose to the condensation on the hot shower mirror.

the pg socket is created and used which will fetch a result that has no 
reference to the socket used by that query method. regardless, the socket is a 
completely different IP/port pair. there is nothing in the pool, connection, 
cursor, or query that will ever be used by twilio. psycopg2 has nothing to do 
with any of the http or httplib2 modules.

after the pgsql query is completed, the twilio module gets used. a new https 
socket is created. the only data every seen by the twilio module that has a 
reference to any objected created by the psycopg2 module is the r.delivery_id 
which is a UUID value derived from the pgsql database. it has no references to 
its parent chain of objects and the twilio module doesn't derive any objects 
from it.

to be more obtuse about it, if i replace the r.delivery_id with a quoted string 
i manually insert, the ResourceWarning is now logged against asyncio/events.py. 
the traceback is still the same. 

/usr/lib/python3.6/asyncio/events.py:126: ResourceWarning: unclosed 

  self._callback(*self._args)

this one happens to exist in the stack trace albeit even further up the call 
chain.

if the ResourceWarning is unable to emit an accurate file:pos, then it 
shouldn't print it at all and instead, use the stack print as mentioned by 
@STINNER. at least at this point, the developer has a legitimate stack to 
wander through and isn't going on a wild goose chase in an unrelated file.

i argue that printing a completely unrelated file:pos is definitely a bug. if 
it is likely to emit a wholly unrelated file:pos, it shouldn't be printed at 
all. unreliable information is just useless.

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-15 Thread Christian Heimes

Christian Heimes added the comment:

Do you modify the SSLContext object in your SNI callback? That's the wrong way 
to do it. You have to create a SSLContext object for each certificate/key pair 
at startup and then change the socket's context attribute.

--

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

@stinner your traceback suggestion was highly useful and much appreciated. i 
have spent several dozen hours researching ResourceWarnings in the past and 
tearing my hair out because the emitted warning was very much useless. i 
couldn't even make educated guesses about the code as socket pairs were used 
randomly.

i strongly approve of mentioning the tracemalloc / traceback in the warning, 
and i would also very much encourage saying "this filename:position could be 
completely wrong" or do away with it all together.

--

___
Python tracker 

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



[issue29558] Provide run_until_complete inside loop

2017-02-15 Thread Javier Domingo

Javier Domingo added the comment:

Yes, indeed it is. Would it be possible to reconsider this functionality? It 
plays a key role when trying to rewrite full applications to async.

Rewriting the full stack of libraries at once is impossible, but the patching 
can easily be done in many cases.

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

yes, i create a context and then when a request comes in, i load the 
appropriate key. this is how most [all?] SNI capable python server examples 
show how to do it, or did, at the time I wrote this module a few years ago. 
from that time, ~py 3.2 until now, it worked perfectly.

thank you for this information, i'll rewrite my callback accordingly. perhaps 
18.2.5.3 in https://docs.python.org/3/library/ssl.html can be updated to inform 
developers how to change their socket.context in an SNI callback

--
resolution:  -> not a bug

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0; ssl SNI callbacks should not modify context objects

2017-02-15 Thread David Ford (FirefighterBlu3)

Changes by David Ford (FirefighterBlu3) :


--
title: [python] Error in `/usr/bin/python': free(): invalid size: 
0x7f628400d0e0 -> [python] Error in `/usr/bin/python': free(): invalid 
size: 0x7f628400d0e0; ssl SNI callbacks should not modify context objects

___
Python tracker 

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



[issue29566] binhex() creates files with mixed line endings

2017-02-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

binhex.binhex() creates files with mixed line endings in Python 3. The header 
line '(This file must be converted with BinHex 4.0)' is separated from the data 
by LFs, but the data is split for lines by CRs.

>>> import binhex
>>> with open('inp', 'wb') as f: f.write(bytes(range(256)))
... 
256
>>> binhex.binhex('inp', 'outp')
>>> for line in open('outp', 'rb').read().splitlines(True): print(repr(line))
... 
b'(This file must be converted with BinHex 4.0)\r'
b'\r'
b':!fPZF!!rN!J!N!3"!*!&*VF!!3)$"!8\'"`J*#JX-$3i2%"%5%a39&KFB\'4SE("d\n'
b'H(b!K)L-N*5BR+#NU+b`Y,Lm`-6)c0$8f0cJj1MXm26ir3%d4&4NG)58T,6%e\n'
b'16e"48P0899CA@&PD@eaGAPpJB@*MC\'9QCfKTDQYXE@j[F(&bFh4eGRGiHATlI(e\n'
b'qIi#"JS1%KBD(L)Q+Lib0MSq3!*\'5Nj59PTHBQCUER*fHRk#KSU1NTDDRU+QUUkb\n'
b'YVUq`XE+cY,@fYlLjZVZm[Ekr`-(#`m6&aXI)bFV,c-h1cp$4dY28eGEAf0RDfpc\n'
b'GhYrJiH,Mj1AQjqMTkZ[XlHl[m2(bmr6ep[IiqIVlr2hqrhj9!!!:\n'

In Python 2 the output file was file object usually opened in text mode. 
Newline characters were translated to platform-depending line endings: CRLF on 
Windows, LF on classic Mac OS. In Python 2 the output file is binary stream 
that doesn't do any newline translations.

The last related commit is 34a042d301d6ab88645046a6dfa6c38265ca4b39 with 
Guido's message "This is the last time I fix binhex.  If it breaks again it 
goes in the dustbin."

--
components: macOS
messages: 287849
nosy: gvanrossum, ned.deily, ronaldoussoren, serhiy.storchaka
priority: normal
severity: normal
status: open
title: binhex() creates files with mixed line endings
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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread Martin Panter

Martin Panter added the comment:

The file position is often useful when the cleanup is deterministic. Example:

def f1():
file1 = open("/dev/null")

def f2():
file2 = open("/dev/null")
del file2  # ResourceWarning

f1()  # ResourceWarning at function exit
f2()

In the these cases, the line number can identify the affected code:

demo.py:8: ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' 
mode='r' encoding='UTF-8'>
  f1()  # ResourceWarning at function exit
demo.py:6: ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' 
mode='r' encoding='UTF-8'>
  del file2  # ResourceWarning

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Christoph Stahl

Christoph Stahl added the comment:

Hi,

I thought a bit about the problem and came up with the following:

The | in the usage is de facto an XOR operator. Exactly one of the options can 
be used. The XOR operator has the associative property, meaning:

  (A XOR B) XOR C = A XOR (B XOR C)

So translated to the | this means:
  
  [[ -a | -b ] | -c ] = [ -a | [ -b | -c ]]

usually one writes:

  [ -a | -b | -c ]

So I propose dropping the inner brackets altogether.

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Brian Curtin

Brian Curtin added the comment:

Dropping the inner brackets sounds like a better move to me.

--
nosy: +bethard, brian.curtin

___
Python tracker 

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



[issue23109] French quotes in the documentation are often ungrammatical

2017-02-15 Thread A.M. Kuchling

A.M. Kuchling added the comment:

It looks like there's nothing left to do for this ticket.

--
nosy: +akuchling
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



[issue29567] Allow argparse to be used in setup.py

2017-02-15 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

When proposing a fix for issue29442, I got another issue - argparse can't be 
used in setup.py for native (non-cross) builds because argparse imports gettext 
and gettext imports struct. I'll propose a fix for that.

--
components: Build
messages: 287854
nosy: Chi Hsuan Yen
priority: normal
severity: normal
status: open
title: Allow argparse to be used in setup.py
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



[issue29567] Allow argparse to be used in setup.py

2017-02-15 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
pull_requests: +78

___
Python tracker 

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



[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-15 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Aha the fix is simple => issue29567

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Andrew Nester

Changes by Andrew Nester :


--
pull_requests: +80

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Andrew Nester

Andrew Nester added the comment:

Ive just added alternative PR that drops inner brackets. So we've got options 
to choose!

--

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Jerry Dimitrov

New submission from Jerry Dimitrov:

Hello everyone,
This is my first bug report to the python project, so please excuse me if the 
metadata for this particular issue is not 100% accurate.

Today I noticed (with the help from couple of people in IRC) a strange behavior 
in the python string formatting functionality.

Consider the following code snippets:

```
'%(a)s %(b)' % {'a': '1', 'b': '2'}

# result:
Traceback (most recent call last):
  File "", line 1, in 
ValueError: incomplete format
```


```
'%(a) %(b)s' % {'a': '1', 'b': '2'}

# result:
'%(b)s'

# expected result:
Traceback (most recent call last):
  File "", line 1, in 
ValueError: incomplete format
```

It seems that there is some kind of inconsistent (undefined) behavior, during 
the parsing of the type character for the formatted string (tested across all 
major python 2.x/3.x versions).

According to the documentation for string formatting and the relevant PEPs, 
there is no additional info about this particular case.

I want to say thank you to Yhg1s, JustASlacker, Jerub and lz1irq for 
discovering this 'bug/feature' and the additional information about it.

Please let me know if this is a bug, since I am not 100% sure if this is the 
case.
Thanks in advance for your time!

Best Regards,
Jerry

--
components: Interpreter Core
messages: 287857
nosy: Jerry Dimitrov
priority: normal
severity: normal
status: open
title: undefined parsing behavior with the old style string formatting
type: behavior
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



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

2017-02-15 Thread slytomcat

Changes by slytomcat :


--
pull_requests: +81

___
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-02-15 Thread slytomcat

New submission from slytomcat:

I think that functionality of threading.Timer class can be easily extended to 
generate the sequence of runs with specified period. The idea comes from the 
GLib.timeout_add function. 

Run method of threading.Timer should look like:

def run(self):
"""Continue execution after wait till function returns True"""
while(not self.finished.wait(self.interval)):
if not self.function(*self.args, **self.kwargs):
break
self.finished.set()

--
components: Library (Lib)
messages: 287858
nosy: slytomcat
priority: normal
severity: normal
status: open
title: threading.Timer class: Continue periodical execution till action returns 
True
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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In this example characters between percents are parsed as for any conversion 
specifier but ignored and '%(a) %' is formatted to '%'. '(a)' specifies a 
mapping key, ' ' is a conversion flag, the second '%' is a conversion type.

>>> '%(a) d' % {'a': 123}
' 123'
>>> '%(a) %' % {'a': 123}
'%'

This behavior is explicable but looks weird and errorprone. I'm not sure about 
changing behavior in maintained branches (technically this may be not a bug), 
but I think it is worth to make this an error in the developed branch.

--
nosy: +benjamin.peterson, larry, ned.deily, rhettinger, serhiy.storchaka
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I think the comment about needing translation on non-mac systems is incorrect. 
Binhex is (or rather was) a textual encoding for binary files used on classic 
MacOS.  The encoded file is more likely to be binary data than a text file and 
replacing b'\r' by the line ending of the current platform could well corrupt 
that data.

--

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

File flags are saved in binhex format, therefore it is possible to distinguish 
text files from binary files.

--

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-15 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +82

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread R. David Murray

R. David Murray added the comment:

I don't think we should change the behavior in maintenance branches.  I take it 
what you want to do is make it so that if the parser ends up thinking it is 
seeing '%%' but there is stuff between the two %s, that's an error?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue28814] Deprecation notice on inspect.getargvalues() is incorrect

2017-02-15 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +83

___
Python tracker 

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



[issue20438] inspect: Deprecate getfullargspec?

2017-02-15 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +84

___
Python tracker 

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



[issue29570] Windows Buildbot 2.7 is broken

2017-02-15 Thread STINNER Victor

New submission from STINNER Victor:

Example of failure:
http://buildbot.python.org/all/builders/AMD64%20Windows8%202.7/builds/67/steps/test/logs/stdio

FAIL: test_incrementaldecoder (test.test_codecencodings_iso2022.Test_ISO2022_KR)
=> failure with newline, maybe caused by the migration to GitHub: see issue 
#29530

ERROR: test_bug_1727780 (test.test_random.WichmannHill_TestBasicOps)
ImportError: No module named random
=> ... no idea, can it be related to the commit 
0f48ecddfb79ef541500ecfcbda0b4178af1cc29 which only changes a comment!?

--
components: Tests, Windows
keywords: buildbot
messages: 287863
nosy: haypo, inada.naoki, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows Buildbot 2.7 is broken
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



[issue28814] Deprecation notice on inspect.getargvalues() is incorrect

2017-02-15 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it is what I want. Current behavior is just an artefact of the 
implementation. I have doubts that any other implementation of printf-like 
formatting has such behavior.

Bytes formatting starves from the same issue.

>>> b'% %' % {}
b'%'

But there are differences:

>>> '%12%' % ()
'%'
>>> b'%12%' % ()
b'   %'

--

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

> # builtin min and max doesn't support FASTCALL
> (...): 1.16x slower (+16%)

Hum, the slowdown is not negligible, even if functools.reduce() is rarely used.

Do you think that it would be insane to have two code paths instead?

* New FASTCALL path if func suports FASTCALL calling _PyObject_FastCall()
* Current code path using cached args tuple otherwise

For example, you can use args==NULL marker for the FASTCALL path. Maybe we need 
a _PyObject_SupportFastCall() function which would return 1 for Python 
functions and C functions, except of C functions with METH_VARARGS flag set.

My expectation is a speedup for functions supporting FASTCALL, but *no 
slowdown* for functions not supporting FASTCALL.

--

property_descr_get() also caches args tuple. I started my work on FASTCALL 
because this optimization caused bugs (but also because I wanted to make Python 
faster, but that's a different topic ;-)).

In the past, the _pickle module also used cached args tuple, but the cache was 
removed because it was vulnerable to race conditions.

For this issue, I suggest to leave functools.reduce() unchanged, but open a new 
issue to discuss what to do with code still using a cached args tuple.

My long term goal with FASTCALL was to remove completely cached tuple used to 
call functions. I wrote tp_fastcall for that, but tp_fastcall (issue #29259) 
was rejected. The rejected tp_fastcall blocked my long term plan, we have to 
find a different approach.

Maybe we should add support for FASTCALL for a little bit more functions, and 
later simply remove the optimization (hack, cached tuple)?

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0; ssl SNI callbacks should not modify context objects

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

> Do you modify the SSLContext object in your SNI callback? That's the wrong 
> way to do it. You have to create a SSLContext object for each certificate/key 
> pair at startup and then change the socket's context attribute.

Would it be possible to prevent bugs? For example, make SSLContext "read only" 
while the SNI callback is called? Or my question doesn't make sense? :-) I 
don't know well how OpenSSL works.

At least, we should warn users in the ssl documentation to mention such crash?

--

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-15 Thread Georg Brandl

Georg Brandl added the comment:

I don't remember anything specific about this, sorry.

--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Jaysinh shukla

New submission from Jaysinh shukla:

Description:
A test case is failing while running `./python -m test -v test_re`.

Traceback:
$>./python -m test -v test_re
== CPython 3.7.0a0 (default, Feb 15 2017, 22:28:32) [GCC 5.4.0 20160609]
==   Linux-4.4.0-62-generic-x86_64-with-debian-stretch-sid little-endian
==   hash algorithm: siphash24 64bit
==  cwd: /home/bigj/Jaysinh/cpython_git/cpython/build/test_python_613
==  encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
Run tests sequentially
0:00:00 [1/1] test_re
test_re_benchmarks (test.test_re.ExternalTests)
re_tests benchmarks ... ok
test_re_tests (test.test_re.ExternalTests)
re_tests test suite ... ok
test_overlap_table (test.test_re.ImplementationTest) ... ok
test_bytes (test.test_re.PatternReprTests) ... ok
test_inline_flags (test.test_re.PatternReprTests) ... ok
test_locale (test.test_re.PatternReprTests) ... ok
test_long_pattern (test.test_re.PatternReprTests) ... ok
test_multiple_flags (test.test_re.PatternReprTests) ... ok
test_quotes (test.test_re.PatternReprTests) ... ok
test_single_flag (test.test_re.PatternReprTests) ... ok
test_unicode_flag (test.test_re.PatternReprTests) ... ok
test_unknown_flags (test.test_re.PatternReprTests) ... ok
test_without_flags (test.test_re.PatternReprTests) ... ok
test_anyall (test.test_re.ReTests) ... ok
test_ascii_and_unicode_flag (test.test_re.ReTests) ... ok
test_backref_group_name_in_exception (test.test_re.ReTests) ... ok
test_basic_re_sub (test.test_re.ReTests) ... ok
test_big_codesize (test.test_re.ReTests) ... ok
test_bigcharset (test.test_re.ReTests) ... ok
test_bug_113254 (test.test_re.ReTests) ... ok
test_bug_114660 (test.test_re.ReTests) ... ok
test_bug_117612 (test.test_re.ReTests) ... ok
test_bug_1661 (test.test_re.ReTests) ... ok
test_bug_16688 (test.test_re.ReTests) ... ok
test_bug_20998 (test.test_re.ReTests) ... ok
test_bug_2537 (test.test_re.ReTests) ... ok
test_bug_29444 (test.test_re.ReTests) ... ok
test_bug_3629 (test.test_re.ReTests) ... ok
test_bug_418626 (test.test_re.ReTests) ... ok
test_bug_448951 (test.test_re.ReTests) ... ok
test_bug_449000 (test.test_re.ReTests) ... ok
test_bug_449964 (test.test_re.ReTests) ... ok
test_bug_462270 (test.test_re.ReTests) ... ok
test_bug_527371 (test.test_re.ReTests) ... ok
test_bug_581080 (test.test_re.ReTests) ... ok
test_bug_612074 (test.test_re.ReTests) ... ok
test_bug_6509 (test.test_re.ReTests) ... ok
test_bug_6561 (test.test_re.ReTests) ... ok
test_bug_725106 (test.test_re.ReTests) ... ok
test_bug_725149 (test.test_re.ReTests) ... ok
test_bug_764548 (test.test_re.ReTests) ... ok
test_bug_817234 (test.test_re.ReTests) ... ok
test_bug_926075 (test.test_re.ReTests) ... ok
test_bug_931848 (test.test_re.ReTests) ... ok
test_bytes_str_mixing (test.test_re.ReTests) ... ok
test_category (test.test_re.ReTests) ... ok
test_character_set_errors (test.test_re.ReTests) ... ok
test_compile (test.test_re.ReTests) ... ok
test_constants (test.test_re.ReTests) ... ok
test_dealloc (test.test_re.ReTests) ... ok
test_debug_flag (test.test_re.ReTests) ... ok
test_dollar_matches_twice (test.test_re.ReTests)
$ matches the end of string, and just before the terminating ... ok
test_empty_array (test.test_re.ReTests) ... ok
test_enum (test.test_re.ReTests) ... ok
test_error (test.test_re.ReTests) ... ok
test_expand (test.test_re.ReTests) ... ok
test_finditer (test.test_re.ReTests) ... ok
test_flags (test.test_re.ReTests) ... ok
test_getattr (test.test_re.ReTests) ... ok
test_getlower (test.test_re.ReTests) ... ok
test_group (test.test_re.ReTests) ... ok
test_group_name_in_exception (test.test_re.ReTests) ... ok
test_groupdict (test.test_re.ReTests) ... ok
test_ignore_case (test.test_re.ReTests) ... ok
test_ignore_case_range (test.test_re.ReTests) ... ok
test_ignore_case_set (test.test_re.ReTests) ... ok
test_inline_flags (test.test_re.ReTests) ... ok
test_issue17998 (test.test_re.ReTests) ... ok
test_keep_buffer (test.test_re.ReTests) ... ok
test_keyword_parameters (test.test_re.ReTests) ... ok
test_large_search (test.test_re.ReTests) ... ok
test_large_subn (test.test_re.ReTests) ... ok
test_locale_caching (test.test_re.ReTests) ... skipped 'test needs 
en_US.iso88591 locale'
test_locale_flag (test.test_re.ReTests) ... FAIL
test_lookahead (test.test_re.ReTests) ... ok
test_lookbehind (test.test_re.ReTests) ... ok
test_match_getitem (test.test_re.ReTests) ... ok
test_match_repr (test.test_re.ReTests) ... ok
test_misc_errors (test.test_re.ReTests) ... ok
test_multiple_repeat (test.test_re.ReTests) ... ok
test_not_literal (test.test_re.ReTests) ... ok
test_nothing_to_repeat (test.test_re.ReTests) ... ok
test_other_escapes (test.test_re.ReTests) ... ok
test_pattern_compare (test.test_re.ReTests) ... ok
test_pattern_compare_bytes (test.test_re.ReTests) ... ok
test_pickling (te

[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

David Ford (FirefighterBlu3) added the comment:
> @stinner your traceback suggestion was highly useful and much appreciated. i 
> have spent several dozen hours researching ResourceWarnings in the past and 
> tearing my hair out because the emitted warning was very much useless. i 
> couldn't even make educated guesses about the code as socket pairs were used 
> randomly.

So did I. Why do you think that I implemented this feature? :-D

> i strongly approve of mentioning the tracemalloc / traceback in the warning, 
> and i would also very much encourage saying "this filename:position could be 
> completely wrong" or do away with it all together.

I dislike removing filename:line information: in some cases, the
information is valid and helps to understand a warning.

Ok, let's go to add a line suggestion to enable tracemalloc. Is there
someone here interested to propose a pull request? It should only be
done in Python 3.7 and later 3.6, it's a new feature in Python 3.6.

--

___
Python tracker 

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



[issue29564] ResourceWarning: suggest to enable tracemalloc in the message

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

To be clear: warnings should only suggest to enable tracemalloc if 
tracemalloc.is_tracing() is False.

It is possible to tracemalloc is tracing, but failed (for different reasons) to 
track where the memory of the resource was allocated.

--
title: ResourceWarning tracking is attaching incorrect file:position to 
unclosed socket -> ResourceWarning: suggest to enable tracemalloc in the message

___
Python tracker 

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



[issue29470] ssl: SNI callbacks should not modify context objects

2017-02-15 Thread STINNER Victor

Changes by STINNER Victor :


--
title: [python] Error in `/usr/bin/python': free(): invalid size: 
0x7f628400d0e0; ssl SNI callbacks should not modify context objects -> ssl: 
SNI callbacks should not modify context objects

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Xiang Zhang

Xiang Zhang added the comment:

The documentation[1] explicitly states using % to do string format could be 
error-prone and recommends using str.format(). So +1 on no change in 
maintenance branches.

[1] 
https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Xiang Zhang

Xiang Zhang added the comment:

Or even not fix it in develop branch.

--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29563] Update Devguide about building documentation.

2017-02-15 Thread Brett Cannon

Brett Cannon added the comment:

Would you mind moving this issue over to 
https://github.com/python/devguide/issues where we track devguide issues, Jim?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue29536] test_hashlib failure on Ubuntu 16.04

2017-02-15 Thread Sachin Kumar

Sachin Kumar added the comment:

@Xiang
I tried that command earlier but that returned around 8 failed test cases. I 
think it is due to a fault with my connection. Although I can replicate this 
error every time. I've tried over 5 times already.


@Martin
I compared the data. My file has been attached. Deleting the files fixed the 
issue. Can all the test files be deleted safely, since some other tests are 
failing too?

--
Added file: http://bugs.python.org/file46639/blake2b.txt

___
Python tracker 

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



[issue29470] ssl: SNI callbacks should not modify context objects

2017-02-15 Thread Christian Heimes

Christian Heimes added the comment:

It's not a bug in Python's ssl module. If I understand David's approach 
correctly, then he is using the SNI callback the wrong way. By using it the 
wrong way he has discovered a threading bug in OpenSSL. There is some kind of 
race condition going on in which two threads free and replace the RSA private 
key at the same time.

I'm -1 to try to make the SSLContext object magically read-only.

David, which examples did you read? The documentation 
https://docs.python.org/3/library/ssl.html#ssl.SSLContext.set_servername_callback
 is pretty clear:

A typical use of this callback is to change the ssl.SSLSocket‘s 
SSLSocket.context attribute to a new object of type SSLContext representing a 
certificate chain that matches the server name.

Apache mod_ssl does it correctly, the first hit on stack overflow, too. 
https://stackoverflow.com/questions/511/how-to-implement-server-name-indication-sni

--

___
Python tracker 

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



[issue29536] test_hashlib failure on Ubuntu 16.04

2017-02-15 Thread Christian Heimes

Christian Heimes added the comment:

Yeah, somehow you ended up with a broken vector file. Your file contains HTTP 
with JavaScript redirect. Did you attempt to download test data from a hotel or 
airport wifi?

You can safely remove Lib/test/data and start over.

--
nosy: +christian.heimes
resolution:  -> not a bug
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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
type:  -> behavior

___
Python tracker 

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



[issue29572] Upgrade installers to OpenSSL 1.0.2k

2017-02-15 Thread Zachary Ware

New submission from Zachary Ware:

It's that time once again (as of a few weeks ago).  This one doesn't seem to be 
a high severity update, though.  Also, it seems that 1.1.0e is due tomorrow; 
I'm not sure if that means 1.0.2l will also come out tomorrow, so we'll want to 
hold off until at least then anyway.  This is mostly just a reminder for now.

--
assignee: christian.heimes
components: Installation, SSL, Windows, macOS
messages: 287877
nosy: christian.heimes, ned.deily, paul.moore, ronaldoussoren, steve.dower, 
tim.golden, zach.ware
priority: high
severity: normal
status: open
title: Upgrade installers to OpenSSL 1.0.2k
type: security
versions: Python 2.7, 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



[issue28837] 2to3 does not wrap zip correctly

2017-02-15 Thread Stuart Berg

Changes by Stuart Berg :


--
pull_requests: +85

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-15 Thread Eryk Sun

Changes by Eryk Sun :


--
priority: normal -> high
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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-15 Thread Eryk Sun

Changes by Eryk Sun :


--
stage:  -> needs patch

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-15 Thread Eryk Sun

Eryk Sun added the comment:

Our support of passing structs and unions by value is really bad. Passing this 
particular struct by value is also broken on 64-bit Unix, but instead because 
it's small. It crashes Python due to an abort(). See issue 22273.

--
nosy: +eryksun
priority: normal -> high
stage:  -> needs patch
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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Matthew Barnett

Matthew Barnett added the comment:

I'm just wondering whether the problem is just due to the locale's encoding 
being UTF-8. The locale support in re really only works with encodings that use 
1 byte/character.

--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Locale encoding is ISO8859-1. This test is skipped on non 8-bit locale.

This is a problem with tests, not with the re module. I don't have a solution.

--
components: +Tests
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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-15 Thread Eryk Sun

Eryk Sun added the comment:

ctypes defines arrays as a pointer FFI type because they degenerate as pointers 
in C calls. But it's generally wrong to set a pointer FFI type for an array in 
the `elements` of a struct's FFI type. An integer array in a struct that's 16 
bytes or less should be packed in one or two general-purpose registers (rdi, 
rsi, rdx, rcx, r8, r9). 

For the example 16-byte struct, classify_argument() in ffi64.c expects to 
classify two 8-byte words. But the struct's FFI type only has one element, 
which we've incorrectly defined as a pointer element. Thus the second word is 
left at the default classification X86_64_NO_CLASS. Back in ffi_call() it 
expects two classified words, so it aborts when it sees X86_64_NO_CLASS.

I think we can special-case small arrays in PyCStructUnionType_update_stgdict 
when assigning the `elements` of the FFI type of a struct or union. If we have 
an array that's 32 bytes or less, unpack it as individual FFI elements, e.g. a 
c_ushort * 8 array would be stored as 8 ffi_type_uint16 elements in the 
struct's FFI type.

--
nosy: +eryksun

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Matthew Barnett

Matthew Barnett added the comment:

The report says "==  encodings: locale=UTF-8, FS=utf-8".

It says that "test_locale_caching" was skipped, but also that 
"test_locale_flag" failed.

--

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 36da1c3589e1bc4246cccf6bd0094a110416a43a by GitHub in branch 
'master':
bpo-29481: add versionadded 3.6.1 to typing.Deque docs (#107)
https://github.com/python/cpython/commit/36da1c3589e1bc4246cccf6bd0094a110416a43a


--

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 7224a049b88ed37c510861528147e0db54911bb7 by GitHub in branch 
'3.6':
bpo-29481: add versionadded 3.6.1 to typing.Deque docs (#108)
https://github.com/python/cpython/commit/7224a049b88ed37c510861528147e0db54911bb7


--

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset bb53a27a5d56a4f33c3fc8eebb486b34808c92b7 by GitHub in branch 
'3.5':
[cherry-pick for 3.5] bpo-29481: add versionadded 3.5.4 to typing.Deque docs 
(#109)
https://github.com/python/cpython/commit/bb53a27a5d56a4f33c3fc8eebb486b34808c92b7


--

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Merged and backported to 3.5 and 3.6.

Thanks all :)

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




[issue28334] netrc does not work if $HOME is not set

2017-02-15 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +86

___
Python tracker 

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



[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-02-15 Thread DAVID ALEJANDRO Pineda

DAVID ALEJANDRO Pineda added the comment:

Now
I try again with different ways to run a method with args, without args works 
fine to insert in the executor.
I find there are big differences with file functools betwen versions 3.5.1 to 
3.6.0.
 Here a more simple example for test the functools:
https://github.com/dpineiden/async_multiprocessing

--

___
Python tracker 

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



[issue29573] NamedTemporaryFile with delete=True should not fail if file already deleted

2017-02-15 Thread Richard Xia

New submission from Richard Xia:

Here is a very short program to demonstrate what I'm seeing:

>>> import tempfile
>>> import os
>>> with tempfile.NamedTemporaryFile(delete=True) as fp:
... print(fp.name)
... os.system('rm {}'.format(fp.name))
/tmp/tmpomw0udc6
0
Traceback (most recent call last):
  File "", line 3, in 
  File "/usr/local/lib/python3.6/tempfile.py", line 502, in __exit__
self.close()
  File "/usr/local/lib/python3.6/tempfile.py", line 509, in close
self._closer.close()
  File "/usr/local/lib/python3.6/tempfile.py", line 446, in close
unlink(self.name)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpomw0udc6'


In my specific use case, I am shelling out to another program (binutils' 
objcopy) and passing the path of the NamedTemporaryFile as the output file. 
objcopy apparently deletes the output file if it encounters an error, which 
causes NamedTemporaryFile's exit method to fail when it tries to delete the 
file.

While I can work around this by using delete=False and manually doing the 
cleanup on my own, it's less elegant than being able to rely on the normal 
context manager exit.

--
components: IO
messages: 287888
nosy: richardxia
priority: normal
severity: normal
status: open
title: NamedTemporaryFile with delete=True should not fail if file already 
deleted
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



[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-02-15 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2017-02-15 Thread Jakub Stasiak

Changes by Jakub Stasiak :


--
pull_requests: +87

___
Python tracker 

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



[issue29563] Update Devguide about building documentation.

2017-02-15 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

Per request from Brett Cannon, I've moved this issue to 
https://github.com/python/devguide/issues/116 . Please continue the discussion 
there.

--

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2017-02-15 Thread Jakub Stasiak

Changes by Jakub Stasiak :


--
versions: +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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
keywords: +patch
stage:  -> patch review
versions:  -Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46640/format-percent.patch

___
Python tracker 

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



[issue29574] python-3.6.0.tgz permissions borked

2017-02-15 Thread Dave Anderson

New submission from Dave Anderson:

Downloaded https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz

Extracted on CentOS6 with sudo tar -xf Python-3.6.0.tgz

Result: 

[vagrant@developer tmp]$ ls -l Python-3.6.0
ls: cannot access Python-3.6.0/Tools: Permission denied
ls: cannot access Python-3.6.0/config.guess: Permission denied
ls: cannot access Python-3.6.0/pyconfig.h.in: Permission denied
ls: cannot access Python-3.6.0/config.sub: Permission denied
ls: cannot access Python-3.6.0/configure.ac: Permission denied
ls: cannot access Python-3.6.0/Python: Permission denied
ls: cannot access Python-3.6.0/Objects: Permission denied
ls: cannot access Python-3.6.0/PCbuild: Permission denied
ls: cannot access Python-3.6.0/Include: Permission denied
ls: cannot access Python-3.6.0/aclocal.m4: Permission denied
ls: cannot access Python-3.6.0/configure: Permission denied
ls: cannot access Python-3.6.0/Misc: Permission denied
ls: cannot access Python-3.6.0/Makefile.pre.in: Permission denied
ls: cannot access Python-3.6.0/setup.py: Permission denied
ls: cannot access Python-3.6.0/Lib: Permission denied
ls: cannot access Python-3.6.0/PC: Permission denied
ls: cannot access Python-3.6.0/Doc: Permission denied
ls: cannot access Python-3.6.0/README: Permission denied
ls: cannot access Python-3.6.0/Programs: Permission denied
ls: cannot access Python-3.6.0/install-sh: Permission denied
ls: cannot access Python-3.6.0/LICENSE: Permission denied
ls: cannot access Python-3.6.0/Modules: Permission denied
ls: cannot access Python-3.6.0/Grammar: Permission denied
ls: cannot access Python-3.6.0/Parser: Permission denied
ls: cannot access Python-3.6.0/Mac: Permission denied
total 0
-? ? ? ? ?? aclocal.m4
-? ? ? ? ?? config.guess
-? ? ? ? ?? config.sub
-? ? ? ? ?? configure
-? ? ? ? ?? configure.ac
d? ? ? ? ?? Doc
d? ? ? ? ?? Grammar
d? ? ? ? ?? Include
-? ? ? ? ?? install-sh
d? ? ? ? ?? Lib
-? ? ? ? ?? LICENSE
d? ? ? ? ?? Mac
-? ? ? ? ?? Makefile.pre.in
d? ? ? ? ?? Misc
d? ? ? ? ?? Modules
d? ? ? ? ?? Objects
d? ? ? ? ?? Parser
d? ? ? ? ?? PC
d? ? ? ? ?? PCbuild
d? ? ? ? ?? Programs
-? ? ? ? ?? pyconfig.h.in
d? ? ? ? ?? Python
-? ? ? ? ?? README
-? ? ? ? ?? setup.py
d? ? ? ? ?? Tools
[vagrant@developer tmp]$

Same operation with Python 3.5.2 tgz file downloaded from same location:

[vagrant@developer tmp]$ ls -l Python-3.5.2
total 1008
-rw-r--r--  1 1000 1000   8464 Jun 25  2016 aclocal.m4
-rwxr-xr-x  1 1000 1000  42856 Jun 25  2016 config.guess
-rwxr-xr-x  1 1000 1000  35740 Jun 25  2016 config.sub
-rwxr-xr-x  1 1000 1000 474932 Jun 25  2016 configure
-rw-r--r--  1 1000 1000 155069 Jun 25  2016 configure.ac
drwxrwxr-x 18 1000 1000   4096 Jun 25  2016 Doc
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Grammar
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Include
-rwxr-xr-x  1 1000 1000   7122 Jun 25  2016 install-sh
drwxrwxr-x 46 1000 1000  12288 Jun 25  2016 Lib
-rw-r--r--  1 1000 1000  12767 Jun 25  2016 LICENSE
drwxrwxr-x  8 1000 1000   4096 Jun 25  2016 Mac
-rw-r--r--  1 1000 1000  58449 Jun 25  2016 Makefile.pre.in
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Misc
drwxrwxr-x 11 1000 1000   4096 Jun 25  2016 Modules
drwxrwxr-x  4 1000 1000   4096 Jun 25  2016 Objects
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Parser
drwxrwxr-x  4 1000 1000   4096 Jun 25  2016 PC
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 PCbuild
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Programs
-rw-r--r--  1 1000 1000  41897 Jun 25  2016 pyconfig.h.in
drwxrwxr-x  3 1000 1000   4096 Jun 25  2016 Python
-rw-r--r--  1 1000 1000   8060 Jun 25  2016 README
-rw-r--r--  1 1000 1000  99778 Jun 25  2016 setup.py
drwxrwxr-x 22 1000 1000   4096 Jun 25  2016 Tools
[vagrant@developer tmp]$

--
components: Build
messages: 287891
nosy: Dave_Anderson
priority: normal
severity: normal
status: open
title: python-3.6.0.tgz permissions borked
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



[issue29574] python-3.6.0.tgz permissions borked

2017-02-15 Thread Dave Anderson

Dave Anderson added the comment:

Sorry, should have shown sudo ls -l output for 3.6:

[vagrant@developer tmp]$ sudo ls -l Python-3.6.0
total 1016
-rw-r--r--  1 caturra games  10910 Dec 22 18:21 aclocal.m4
-rwxr-xr-x  1 caturra games  42856 Dec 22 18:21 config.guess
-rwxr-xr-x  1 caturra games  35740 Dec 22 18:21 config.sub
-rwxr-xr-x  1 caturra games 481627 Dec 22 18:21 configure
-rw-r--r--  1 caturra games 158661 Dec 22 18:21 configure.ac
drwxr--r-- 18 caturra games   4096 Dec 22 18:23 Doc
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Grammar
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Include
-rwxr-xr-x  1 caturra games   7122 Dec 22 18:21 install-sh
drwxr--r-- 33 caturra games   4096 Dec 22 18:21 Lib
-rw-r--r--  1 caturra games  12767 Dec 22 18:21 LICENSE
drwxr--r--  8 caturra games   4096 Dec 22 18:21 Mac
-rw-r--r--  1 caturra games  58829 Dec 22 18:21 Makefile.pre.in
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Misc
drwxr--r-- 13 caturra games   4096 Dec 22 18:21 Modules
drwxr--r--  4 caturra games   4096 Dec 22 18:21 Objects
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Parser
drwxr--r--  5 caturra games   4096 Dec 22 18:21 PC
drwxr--r--  2 caturra games   4096 Dec 22 18:21 PCbuild
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Programs
-rw-r--r--  1 caturra games  41250 Dec 22 18:21 pyconfig.h.in
drwxr--r--  3 caturra games   4096 Dec 22 18:21 Python
-rw-r--r--  1 caturra games   8434 Dec 22 18:21 README
-rw-r--r--  1 caturra games 101041 Dec 22 18:21 setup.py
drwxr--r-- 24 caturra games   4096 Dec 22 18:21 Tools
[vagrant@developer tmp]$

--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

> Following patch ...

Seriously? Not a GitHub pull request? ;-) (old habit?)

--

___
Python tracker 

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



[issue29575] doc 17.2.1: basic Pool example is too basic

2017-02-15 Thread Joachim

New submission from Joachim:

The »basic example of data parallelism using Pool« is too basic. It 
demonstrates the syntax, but otherwise makes no sense, and therefore is 
potentially confusing. It is blatant nonsense to run 5 processes when there are 
only 3 data to be treated. Let me suggest the following:


from multiprocessing import Pool
import time

def f(x):
time.sleep(1)
return x*x

if __name__ == '__main__':
start_time = time.time()
with Pool(4) as p:
print(p.map(f, range(20)))
print("elapsed wall time: ", time.time()-start_time)

The sleep command makes f representative for a function that takes significant 
time to execute. Printing the elapsed time shows the user that the 20 calls of 
f have indeed taken place in parallel.

--
assignee: docs@python
components: Documentation
messages: 287895
nosy: docs@python, j5w6
priority: normal
severity: normal
status: open
title: doc 17.2.1: basic Pool example is too basic
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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good point. The test used locale.getlocale() and it returned returned ('en_IN', 
'ISO8859-1').

Following patch makes the test using locale.getpreferredencoding(False), the 
same encoding as was reported at the header of test report.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file46641/test_re_locale_flag.patch

___
Python tracker 

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



[issue29531] Update Doc/README.txt to README.rst

2017-02-15 Thread Roger Sachan

Changes by Roger Sachan :


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



[issue29561] Interactive mode gives sys.ps2 not sys.ps1 after comment-only line

2017-02-15 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

Thank you for the analysis, Eryk Sun.

You wrote, "the interpreter is correctly conveying that it's still tokenizing 
the input; it hasn't compiled or executed any code." I think one important 
question for this issue is, what meaning should the choice of prompt convey?  
That breaks down into, 1. what meaning does the user believe it conveys, and 2. 
what meaning does the present behaviour of the code imply?

"it's still tokenizing the input" translates to a meaning, sys.ps1 indicates 
the interpreter just finished executing and has no input, while sys.ps2 
indicates the interpreter is tokenizing input and awaiting a chance to execute.

I think my intuition is, and the bash shell's behaviour says, sys.ps1 indicates 
the interpreter is ready to start a new statement, and sys.ps2 indicates the 
interpreter is in the midst of a compound statement.

--

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 85064db281545d587992df61154e76439138319f by Victor Stinner in 
branch 'master':
bpo-29521 update Misc/ACKS (#106)
https://github.com/python/cpython/commit/85064db281545d587992df61154e76439138319f


--

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset de553b8210882823d3df3f1ef6882eba3f8accf3 by Victor Stinner in 
branch '3.5':
bpo-29521 update Misc/ACKS (#111)
https://github.com/python/cpython/commit/de553b8210882823d3df3f1ef6882eba3f8accf3


--

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 02e3357e089f37c23d0f3d1ebee9aa3d7a1492a9 by Victor Stinner in 
branch '3.6':
bpo-29521 update Misc/ACKS (#110)
https://github.com/python/cpython/commit/02e3357e089f37c23d0f3d1ebee9aa3d7a1492a9


--

___
Python tracker 

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



[issue29556] Remove unused #include

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 72e81d00eee685cfe33aaddf2aa9feef2d07591f by Victor Stinner in 
branch 'master':
bpo-29556: Remove unused #include  (#98)
https://github.com/python/cpython/commit/72e81d00eee685cfe33aaddf2aa9feef2d07591f


--

___
Python tracker 

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



[issue29470] ssl: SNI callbacks should not modify context objects

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

@Christian, that was years ago and there were few examples available of people 
that had tried to make an SNI capable server. in several cases, people were 
monkey patching to make a callback. .set_servername_callback() didn't formally 
show up in ssl mod until 3.4.

i disagree that the documentation is very clear about this. there's one direct 
reference to usage which is worded as "A typical use of this callback is 
to...". that doesn't imply 'very clear' :}

i cannot recall anything anywhere that says one must not modify the context 
after it is used. 18.2.3 implies that a context is a long lived object, longer 
lived than a socket. it's clear that several people including myself, have 
mistakenly tried modifying the context after it was built. until now, it 
worked, probably purely by coincidence.

as a matter of fact, i used to change more than just the key loaded. i changed 
the ciphers, options, and verify_flags when i knew the incoming IP was 
incapable of supporting modern ciphers and options. i also modified the verify 
paths to support a messed up corporate environment.

i suggest the 18.2.3 documentation be modified to be clear about:
a) if, when, and how a context can be modified after creation
b) an SNI example that changes contexts and explicitly indicates (a)

i don't see any value to not being clear about it, and it's disingenuous to 
leave nooses hiding in shadows for devs to hang themselves with :-]

--

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

@matejcik: would you mind to create a pull request for your patch?

--

___
Python tracker 

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



[issue29566] binhex() creates files with mixed line endings

2017-02-15 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue29563] Update Devguide about building documentation.

2017-02-15 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for moving the issue, Jim!

--
resolution:  -> out of date
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



  1   2   >