[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-27 Thread Srinivas Reddy T
Srinivas Reddy T added the comment: Renaming the method `copy()` to `__copy__` breaks the API. I would rather have an alias for `__copy__`. I agree that it is not documented, but some users tend to assume public methods are documented and use them. So i

[issue32436] Implement PEP 567

2017-12-27 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4915 ___ Python tracker ___

[issue32436] Implement PEP 567

2017-12-27 Thread Yury Selivanov
Change by Yury Selivanov : -- assignee: yselivanov components: Interpreter Core, Library (Lib) nosy: gvanrossum, yselivanov priority: normal severity: normal stage: patch review status: open title: Implement PEP 567 type: enhancement versions: Python 3.7

[issue25942] Add a new optional cleanup_timeout parameter to subprocess.call()

2017-12-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: you'll notice I added an alternate PR. I don't like the complication of adding yet another knob (cleanup_timeout) to subprocesses already giant API surface. It will rarely be used. My PR tries to take a practical approach: Just wait a

[issue25942] Add a new optional cleanup_timeout parameter to subprocess.call()

2017-12-27 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +4914 ___ Python tracker ___ ___

[issue32337] Dict order is now guaranteed, so add tests and doc for it

2017-12-27 Thread shangdahao
shangdahao added the comment: Thanks inada, I removed the tests from the PR. -- nosy: +shangdahao ___ Python tracker ___

[ANN] txaws 0.5.0

2017-12-27 Thread Jean-Paul Calderone
Hello all, I'm pleased to announce the release of txAWS 0.5.0. txAWS is a library for interacting with Amazon Web Services (AWS) using Twisted. You can download the release from PyPI . Since the last release, the following enhancements have been made:

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

2017-12-27 Thread Ilya Kulakov
Ilya Kulakov added the comment: Is there anything to be done for this patch to get merged? -- ___ Python tracker ___

[issue32428] dataclasses: make it an error to have initialized non-fields in a dataclass

2017-12-27 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > I'm not sure I understand the distinction. Initially I thought about only flagging code like this: @dataclass class C: x = field() But not this: @dataclass class C: x = 42 Now I think we should probably flag both as errors.

[issue21288] hashlib.pbkdf2_hmac Hash Constructor

2017-12-27 Thread Armin Ronacher
Armin Ronacher added the comment: I have no good solution. What I do so far is pretty much exactly what was originally reported here: https://github.com/pallets/werkzeug/blob/6922d883ba61c6884fa6cab5bfd280c5a60399af/werkzeug/security.py#L96-L104 --

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread Glenn Linderman
Glenn Linderman added the comment: I don't know how to look back at the previous version of the PR, I was barely able to find the "current version" each time. The following line is in the current version: daemon_threads = True Whether it was in the previous version, I

[issue32401] No module named '_ctypes'

2017-12-27 Thread YoSTEALTH
YoSTEALTH added the comment: Yes, it does work without pip. -- stage: -> resolved status: open -> closed ___ Python tracker

[issue32435] tarfile recognizes .gz file as tar

2017-12-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This file is a correct empty tar file. The tar utility accepts it too. $ tar tf big_0_file_1.gz; echo $? 0 -- nosy: +serhiy.storchaka ___ Python tracker

[issue21288] hashlib.pbkdf2_hmac Hash Constructor

2017-12-27 Thread Christian Heimes
Christian Heimes added the comment: Do you have a proper solution that works within the limits of PEP 247? I could not, hence the existing API. -- ___ Python tracker

[issue32435] tarfile recognizes .gz file as tar

2017-12-27 Thread Sergey Petrunin
New submission from Sergey Petrunin : Library's function 'tarfile.is_tarfile' returns 'True' on GZip file (9.7 megabytes see attachment), that is a file with 10 gigabytes of '0' character compressed with 'gzip' utility (no 'tar' whatsoever). Desired result: this

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread Julien Palard
Julien Palard added the comment: David you're right, I updated my patch, also added some documentation and a news entry. Glenn I can't tell if my PR fixes your issue without an strace or a test. It fixes the one I straced (pre-opening sockets leading to Python

[issue8800] add threading.RWLock

2017-12-27 Thread Jesús Cea Avión
Change by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing

[issue21288] hashlib.pbkdf2_hmac Hash Constructor

2017-12-27 Thread Armin Ronacher
Armin Ronacher added the comment: Yes, I'm definitely still interested in this. I still carry this hack around. -- status: pending -> open ___ Python tracker

[issue17258] multiprocessing.connection challenge implicitly uses MD5

2017-12-27 Thread Christian Heimes
Christian Heimes added the comment: Dave, are you still interested to address the issue? I think it's a good idea to replace HMAC-MD5 in the long run. But instead of hard-coding another hash algorithm, I would like to see an improved handshake protocol that supports

[issue32434] pathlib.WindowsPath.reslove(strict=False) returns absoulte path only if at least one component exists

2017-12-27 Thread Martin Liska
New submission from Martin Liska : The documentation for pathlib.Path.resolve says: "Make the path absolute, resolving any symlinks." On Windows, the behavior doesn't always match the first part of the statement. Example: On a system with an existing, but empty directory

[issue21288] hashlib.pbkdf2_hmac Hash Constructor

2017-12-27 Thread Christian Heimes
Christian Heimes added the comment: Is anybody interested still to solve the problem? I don't see a viable way to solve the issue in a correct way (*). The hashlib API is not designed to provide sufficient information from a digestmod object. I don't want to include hacks

[issue32416] Refactor and add new tests for the f_lineno setter

2017-12-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32416] Refactor and add new tests for the f_lineno setter

2017-12-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c60eca06adda4900e6b469d989e6082cda3a3004 by Serhiy Storchaka in branch '2.7': [2.7] bpo-32416: Refactor tests for the f_lineno setter and add new tests. (GH-4991). (#5017)

[issue32416] Refactor and add new tests for the f_lineno setter

2017-12-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ea98eba3465fff2b191610cea253d43000c84b4a by Serhiy Storchaka in branch '3.6': [3.6] bpo-32416: Refactor tests for the f_lineno setter and add new tests. (GH-4991). (#5016)

[issue29504] blake2: compile error with -march=bdver2

2017-12-27 Thread Christian Heimes
Christian Heimes added the comment: The issue has been fixed on Nov 1st in PR https://github.com/python/cpython/pull/4173 (master) and https://github.com/python/cpython/pull/4214 (3.6.4). -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed

[issue32433] Provide optimized HMAC digest

2017-12-27 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +4913 ___ Python tracker ___

[issue32431] Two bytes objects of zero length don't compare equal

2017-12-27 Thread Jonathan Underwood
Jonathan Underwood added the comment: Actually the commentary at the top of bytesobject.c for PyBytes_FromStringAndSize says: "... If `str' is NULL then PyBytes_FromStringAndSize() will allocate `size+1' bytes (setting the last byte to the null terminating

[issue32433] Provide optimized HMAC digest

2017-12-27 Thread Christian Heimes
New submission from Christian Heimes : hmac.HMAC's flexibility comes with a cost. To create the MAC of a message, it has to create between three and four hash instances (inner, outer, key for long keys, result), multiple bound method objects and other temporary objects. For

[issue32431] Two bytes objects of zero length don't compare equal

2017-12-27 Thread Jonathan Underwood
Jonathan Underwood added the comment: Py_SIZE is actually precisely specified and documented[1] as it stands; I don't think a change there is needed. The usage I outlined is in line with that documentation, and many other uses of that macro in the cpython

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread Glenn Linderman
Glenn Linderman added the comment: I tried the approach in the PR "externally" (when starting the server using a test program), and I couldn't get it to work. But my test case was probably different: I was using Chrome rather than Chromium, and while they both work for

Re: Default annotations for variables

2017-12-27 Thread INADA Naoki
typing's primary intention is "static" typing with tools like mypy. Introspection is not primary usage. Adding such information for every class, module, etc makes Python slower and fatter. But I want to make Python more swift and slim. INADA Naoki On Wed, Dec 27, 2017

[issue32431] Two bytes objects of zero length don't compare equal

2017-12-27 Thread R. David Murray
R. David Murray added the comment: I think what Py_SIZE "means" depends on the object type in the general case, not just this one, so documenting that it is mucking with the internal representation is probably the way to go. --

[issue32432] [BUG] Python vs Macbook High Sierra 10.13.2

2017-12-27 Thread Felipe Filgueira Barral
New submission from Felipe Filgueira Barral : When i open the IDLE and try include ' or " in any script, the python closes alone! Does anyone know what might be happening? I use mac, version high sierra... Process: Python [1048] Path: /Applications/Python

[issue32431] Two bytes objects of zero length don't compare equal

2017-12-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Much C code implies that bytes are null terminated. For example bytes-to-number converters and most functions that accept bytes as file path. Changing just the compare logic will not help. The documented way of changing the

[issue32431] Two bytes objects of zero length don't compare equal

2017-12-27 Thread Jonathan Underwood
Change by Jonathan Underwood : -- keywords: +patch pull_requests: +4911 stage: -> patch review ___ Python tracker ___

[issue32431] Two bytes objects of zero length don't compare equal

2017-12-27 Thread Jonathan Underwood
Jonathan Underwood added the comment: https://github.com/python/cpython/pull/5021 -- ___ Python tracker ___

[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-27 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: Ultimately, yeah, the Python version should probably define __deepcopy__ as well. But since this is just a rename of an existing method, I figure we can defer that to another time. --

[issue32431] Two bytes objects of zero length don't compare equal

2017-12-27 Thread R. David Murray
R. David Murray added the comment: My suspicion is that this behavior/code is left over from when the code was handling strings in python2, where strings were always null terminated and so the equal-bytes test would always pass. I don't think this is appropriate for

[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-27 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- keywords: +patch pull_requests: +4909 stage: -> patch review ___ Python tracker ___

[issue32431] Two bytes objects of zero length don't compare equal

2017-12-27 Thread Jonathan Underwood
New submission from Jonathan Underwood : With the current logic in Objects/bytesobject.c in the function bytes_compare_eq it can be the case that zero length bytes object object created in an extension module like this: val = PyBytes_FromStringAndSize (NULL, 20);

PyWin32 installer question

2017-12-27 Thread Skip Montanaro
I'm fiddling around with Appveyor, trying to build a Windows installer for SpamBayes. This is complicated by two facts: 1. I don't know squat about Windows. 2. I don't have access to a Windows command line. Consequently, every new attempt requires a change to appveyor.yml and a git push

[issue26746] struct.pack(): trailing padding bytes on x64

2017-12-27 Thread Stefan Krah
Change by Stefan Krah : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker ___ ___

[issue26746] struct.pack(): trailing padding bytes on x64

2017-12-27 Thread Stefan Krah
Stefan Krah added the comment: I have just worked on PEP-3118 ==> Datashape translation and I have encountered many issues similar to the ones in the PR referenced by Allan. It seems to me that we should simplify the PEP-3118 struct syntax as much as possible in order to

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2017-12-27 Thread Jerome Leclanche
Jerome Leclanche added the comment: Anything holding up the PR? Looks good at a glance, would be nice to get this landed in time for 3.7. -- nosy: +jleclanche ___ Python tracker

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread R. David Murray
R. David Murray added the comment: I don't think the PR as it stands is a good idea. These classes are designed to be composable, so it should be up to the library user whether or not to use threads. However it would be perfectly reasonable to choose to use threads in

Re: RegExp - please help me!

2017-12-27 Thread szykcech
> (?s)struct (.+?)\s*\{\s*(.+?)\s*\}; Thank you Vlastimil Brom for regexp and for explanation! -- https://mail.python.org/mailman/listinfo/python-list

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread Julien Palard
Julien Palard added the comment: I wrote a 2 lines PR in which I propose to use threads to handle connections as it's well supported by socketserver via a ThreadingMixIn and fixes the issue. -- ___ Python tracker

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread Julien Palard
Change by Julien Palard : -- keywords: +patch pull_requests: +4908 stage: -> patch review ___ Python tracker ___

[issue12178] csv writer doesn't escape escapechar

2017-12-27 Thread Dmitriy Shashkin
Change by Dmitriy Shashkin : -- nosy: +Dmitriy Shashkin ___ Python tracker ___

[issue32430] Simplify Modules/Setup{,.dist,.local}

2017-12-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Personally I'll go for a single Setup file (No .dist, no .local, no copy), > that one can modify and commit, delegating the pain of merging to git, as I > prefer simple solutions. +1 for this. -- nosy: +barry, pitrou type: ->

Re: Default annotations for variables

2017-12-27 Thread Kirill Balunov
2017-12-27 14:19 GMT+03:00 Kirill Balunov : > Here I was a bit knocked down by the IPython console. Strangely, but the ` > __annotations__` is not initialized to a an empty dict when you start it, > while in Python console it is. > In addition, there are some imbalance

Re: Default annotations for variables

2017-12-27 Thread Kirill Balunov
2017-12-27 13:54 GMT+03:00 Chris Angelico : > This won't work. When you say "a.__type__", it means "take the *value* > referenced by a, and look up its __type__ attribute". So it's > equivalent to writing: > > (11).__type__ > (12).__type__ > Thank you for clarification, I

[issue32430] Simplify Modules/Setup{,.dist,.local}

2017-12-27 Thread Julien Palard
New submission from Julien Palard : Related to: https://bugs.python.org/issue32429 The bahavior of Modules/Setup{,.dist,.local} looks inherited from an old time: - A Setup.dist exist - ./configure copies it to Setup (cp $srcdir/Modules/Setup.dist Modules/Setup) -

[issue32429] Outdated Modules/Setup warning is invisible

2017-12-27 Thread Julien Palard
Julien Palard added the comment: Discussion about further simplifications goes here: https://bugs.python.org/issue32430 -- ___ Python tracker

[issue32430] Simplify Modules/Setup{,.dist,.local}

2017-12-27 Thread Julien Palard
Change by Julien Palard : -- components: +Build versions: +Python 2.7, Python 3.6, Python 3.7 ___ Python tracker ___

Re: Default annotations for variables

2017-12-27 Thread Chris Angelico
On Wed, Dec 27, 2017 at 9:41 PM, Kirill Balunov wrote: > Will there be any implications (or is it possible) if all variables will > have an attribute *something like* `__type__` which by default will be > initialized to *something like* `AnyType`. So in the case `x = 12`

Default annotations for variables

2017-12-27 Thread Kirill Balunov
Will there be any implications (or is it possible) if all variables will have an attribute *something like* `__type__` which by default will be initialized to *something like* `AnyType`. So in the case `x = 12` will be equivalent to `x: AnyType = 12`. x: int x = 12 x.__type__ # int a, b = 11, 12

[issue32429] Outdated Modules/Setup warning is invisible

2017-12-27 Thread Xavier de Gaye
Xavier de Gaye added the comment: It seems that it is possible to keep the current behavior for those that want to customize the configuration of Modules/Setup.dist (knowing that they can just use Modules/Setup.local if they are only doing additions to the Setup

[issue32416] Refactor and add new tests for the f_lineno setter

2017-12-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4907 ___ Python tracker ___ ___

Re: [issue32429] Outdated Modules/Setup warning is invisible

2017-12-27 Thread M.-A. Lemburg
On 27.12.2017 00:24, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> +1 - do you have any thoughts on that? > > I think the current scheme may have been useful at a time where DVCS didn't > exist. You would maintain an unversioned copy of Modules/Setup.dist

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread Julien Palard
Julien Palard added the comment: I straced both chromium and Python during the issue and seen this: Chromium open a socket (port 55084), sends "GET /domain1.html" to it. Python accepts it, reads "GET /domain1.html", replies, OK Chromium closes socket on port 55084

[issue32416] Refactor and add new tests for the f_lineno setter

2017-12-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4906 ___ Python tracker ___ ___

Re: RegExp - please help me!

2017-12-27 Thread Lele Gaifax
szykc...@gmail.com writes: > Please help me with this regexp or tell me that I neeed do this in other way. I think that using regexps to parse those structures is fragile and difficult to get right[0], as there are lots of corner cases (comments, complex types, ...). I'd suggest using a tool

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread Roger Wang
Change by Roger Wang : -- nosy: +rogerwang ___ Python tracker ___ ___ Python-bugs-list