[issue33307] socket.send() fails to send large amount of bytes

2018-04-18 Thread Kaulkwappe
New submission from Kaulkwappe : socket.setblocking(0) socket.send(b'a' * 32 * 1024 * 1024) In the example above socket.send() fails with this error: Error in connection handler Traceback (most recent call last): File

[issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler.

2018-04-18 Thread INADA Naoki
Change by INADA Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___

[issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning

2018-04-18 Thread Thomas Wouters
Thomas Wouters added the comment: Looks like this was fixed in 3.7 by checking PyThreadState_GET()->interp->modules before trying to use it. That leaves the crash in 3.6 and earlier, though. -- stage: patch review -> ___ Python

[issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning

2018-04-18 Thread Thomas Wouters
Change by Thomas Wouters : -- keywords: +patch pull_requests: +6211 stage: -> patch review ___ Python tracker ___

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread Brett Cannon
New submission from Brett Cannon : `parser.st2list(parser.suite(""), col_info=True)` causes: Fatal Python error: a function returned a result with an error set IndexError: list assignment index out of range ``` The above exception was the direct cause of the following

[issue33305] Improve syntax error for numbers with leading zero

2018-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 6517 improves syntax error messages for invalid numerical literals. >>> 012 File "", line 1 SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers >>> 0o129 File "",

[issue33307] socket.send() fails to send large amount of bytes

2018-04-18 Thread Kaulkwappe
Kaulkwappe added the comment: Sorry for the misunderstanding, here is the complete example: socket.setblocking(0) try: buffer = socket.recv() if not buffer: break except OSError: bytes_sent = socket.send(b'a' * 32 * 1024 *

[issue33305] Improve syntax error for numbers with leading zero

2018-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6210 stage: -> patch review ___ Python tracker ___

[issue33307] socket.send() fails to send large amount of bytes

2018-04-18 Thread Christian Heimes
Christian Heimes added the comment: The same way as with any other non-blocking I/O system. You have to keep track how much data you have already sent and repeat non-blocking send() until you have succeeded. With TLS/SSL it's even more complex, because a send() also

[issue33307] socket.send() fails to send large amount of bytes

2018-04-18 Thread Kaulkwappe
Kaulkwappe added the comment: But why does socket.send() throws an exception in this case only when sending a large amount of bytes? That would mean it is impossible to send large amount of bytes over SSL sockets as it would fail everytime. -- status: closed

[issue33307] socket.send() fails to send large amount of bytes

2018-04-18 Thread Kaulkwappe
Kaulkwappe added the comment: Thank you for your answer Christian. Indeed it seems a little more complex. As I worked with Non-TLS sockets before it looked like unexpected behaviour to me as on non-blocking sockets socket.send() would normally return 0 when no data

[issue33307] socket.send() fails to send large amount of bytes

2018-04-18 Thread INADA Naoki
INADA Naoki added the comment: Isn't it an expected behavior of SSL with nonblocking socket? What's wrong? -- nosy: +inada.naoki ___ Python tracker

[issue33307] socket.send() fails to send large amount of bytes

2018-04-18 Thread Christian Heimes
Christian Heimes added the comment: Inada is correct. This is the expected and documented behavior for non-blocking SSLSockets, see https://docs.python.org/3/library/ssl.html#ssl-nonblocking . -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue33309] Unittest Mock objects do not freeze arguments they are called with

2018-04-18 Thread Nathaniel Duarte
New submission from Nathaniel Duarte : It is possible to make a call with a Mock object, for example, where a dictionary is passed to the mock and later modified. If a call assertion is then made against the mock using the initial value/contents of the dictionary the

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6212 stage: test needed -> patch review ___ Python tracker

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka components: +Extension Modules -Library (Lib) nosy: +serhiy.storchaka type: behavior -> crash versions: +Python 2.7 ___ Python tracker

[issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning

2018-04-18 Thread Thomas Wouters
Change by Thomas Wouters : -- pull_requests: +6213 stage: -> patch review ___ Python tracker ___

[issue33283] Mention PNG as a supported image format by Tcl/Tk

2018-04-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6214 ___ Python tracker ___

[issue24905] Allow incremental I/O to blobs in sqlite3

2018-04-18 Thread Aviv Palivoda
Aviv Palivoda added the comment: As I wrote in the PR: I think that the contains operation should not be supported for blobs. As blobs can be very large, looking for a subset of bytes inside them will be a very inefficient process in memory or in compute. I believe that

[issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning

2018-04-18 Thread Thomas Wouters
Thomas Wouters added the comment: We ran into this at work, with Python 3.6, where it involved extension types with a reference to files, with the (open) files being deallocated during interpreter exit and raising ResourceWarnings because of that. I tried to create a

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-18 Thread Gregory P. Smith
New submission from Gregory P. Smith : Build CPython (master in this case - though I originally noticed the problem when building a 3.6 tree) as follows with clang installed: build$ LD=clang-5.0 LDFLAGS=-fsanitize=undefined CC=clang-5.0 CXX=clang-5.0

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-18 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +twouters ___ Python tracker ___ ___ Python-bugs-list

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-18 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +benjamin.peterson, fweimer ___ Python tracker ___

[issue33310] Update references to PIL-style arrays

2018-04-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The documentation for buffer protocol and memoryview objects contains references to "PIL-style arrays". Since PIL [1] seems dead (it was not ported to Python 3) and superseded by Pillow [2], I think it is worth to update these

[issue33311] cgitb: remove parentheses when the error is in module

2018-04-18 Thread Stéphane Blondon
Change by Stéphane Blondon : -- keywords: +patch pull_requests: +6215 stage: -> patch review ___ Python tracker ___

[issue3356] some tests fail with 'make EXTRA_CFLAGS="-DPy_DEBUG"' (test_distutils, test_set)

2018-04-18 Thread Stéphane Blondon
Change by Stéphane Blondon : -- pull_requests: +6216 ___ Python tracker ___ ___

[issue33310] Update references to PIL-style arrays

2018-04-18 Thread Stefan Krah
Stefan Krah added the comment: I guess I don't really see much of an issue: The first link for "PIL Python" goes Pillow page and since Pillow is just a fork, the technical term is IMHO "PIL-style". I like to give credit to original authors. --

[issue33310] Update references to PIL-style arrays

2018-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks. -- ___ Python tracker ___ ___

[issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8'

2018-04-18 Thread Nicolás Hatcher
Change by Nicolás Hatcher : -- keywords: +patch pull_requests: +6217 stage: -> patch review ___ Python tracker ___

[issue33283] Mention PNG as a supported image format by Tcl/Tk

2018-04-18 Thread miss-islington
miss-islington added the comment: New changeset b88f73749db98ed62dbc8fa59480aa62202e25d7 by Miss Islington (bot) in branch '3.7': bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479)

[issue33311] cgitb: remove parentheses when the error is in module

2018-04-18 Thread Stéphane Blondon
New submission from Stéphane Blondon : The cgitb module displays a traceback in text or html. When a module is called, there are no parameters (displayed as '()'). I think they are unnecessary and the parentheses should be removed. ### example for the text version

[issue33310] Update references to PIL-style arrays

2018-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Indeed, the name of the top-level package is PIL in Pillow. Unless you want to rewrite the wording or add links I think this issue can be closed. -- ___ Python tracker

[issue33310] Update references to PIL-style arrays

2018-04-18 Thread Stefan Krah
Stefan Krah added the comment: I think I want to leave it as is. Probably no one is using suboffsets anyway. :-) -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue33305] Improve syntax error for numbers with leading zero

2018-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: Maybe once Python 2.7 officially reaches EOL, we can remove the syntax error altogether and allow leading zeros on decimal integer literals. -- nosy: +mark.dickinson ___ Python tracker

[issue33306] Improving SyntaxError for unmatched parentheses

2018-04-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : SyntaxError messages were improved recently in PyPy. [1] [2] The part of this improvement in CPython (showing an expected token) is discussed in issue1634034. The following PR implements other part, related to unmatched

[issue33292] Fix secrets.randbelow docstring

2018-04-18 Thread Vex Woo
Vex Woo added the comment: It looks simple and good. -- ___ Python tracker ___ ___

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-18 Thread Mahmud Al Hasan
Mahmud Al Hasan added the comment: Thanks to Steve Dower the problem is solved! -- ___ Python tracker ___

[issue33292] Fix secrets.randbelow docstring

2018-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: """Return a random integer x satisfying 0 <= x < n""" ? -- nosy: +mark.dickinson ___ Python tracker

[issue33306] Improving SyntaxError for unmatched parentheses

2018-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6209 stage: -> patch review ___ Python tracker ___

[issue33305] Improve syntax error for numbers with leading zero

2018-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It still can cause when copy octal constants from other languages or from old Python 2 books and articles. Perhaps it should emit SyntaxWarning if all digits are in range 0-7 and the number is larger than 7. -- nosy:

[issue33261] inspect.isgeneratorfunction fails on hand-created methods

2018-04-18 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Can we please go back to the original issue? If you think that __code__ should be an alias for __call__.__code__, that is a different issue. On https://github.com/python/cpython/pull/6448#issuecomment-381507329 I posted an alternative

[issue33305] Improve syntax error for numbers with leading zero

2018-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: For the message: > invalid token, use 0o prefix for octal integers I'd expect (without having any evidence to back this up) that the majority of people who encounter this error would be those who intended a decimal literal rather than an

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: Yeah, I've run into this before. The "correct" thing to do is use C99 VLAs. Unfortunately, that doesn't work for PyDictKeysObject because it really wants a union of VLAs but that isn't supported. The best I could do is making a struct

[issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8'

2018-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In simplejson: >>> simplejson.dumps({u"greeting": "hi", "currency": "€"}, ensure_ascii=False, >>> encoding="utf8") u'{"currency": "\u20ac", "greeting": "hi"}' >>> simplejson.dumps({u"greeting": "hi", "currency": "€"},

[issue31583] 2to3 call for file in current directory yields error

2018-04-18 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 1957e7b76a1319995360492223a4dfe1cd5d105c by Łukasz Langa (Miss Islington (bot)) in branch '3.6': bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (GH-6529)

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread miss-islington
miss-islington added the comment: New changeset b27c71cdc02ae01081c14e7192f47abe636a831f by Miss Islington (bot) in branch '3.7': bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519)

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +6225 ___ Python tracker ___ ___

[issue33299] Return an object itself for some types in _PyCode_ConstantKey()

2018-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33299] Return an object itself for some types in _PyCode_ConstantKey()

2018-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b7e1eff8436f6e0c4aac440036092fcf96f82960 by Serhiy Storchaka in branch 'master': bpo-33299: Return an object itself for some types in _PyCode_ConstantKey(). (GH-6513)

[issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7"

2018-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7"

2018-04-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6226 ___ Python tracker ___

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-18 Thread Gregory P. Smith
Gregory P. Smith added the comment: I think it is worth getting such a change in. its arguable that the compiler should be able to see through the union for this use case but I assume such a fix would only land in a recent clang version. i'm attaching a variant on your patch

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread miss-islington
miss-islington added the comment: New changeset fc8693dc7a228d687bf066e163f82a7724b58b68 by Miss Islington (bot) in branch '3.6': bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519)

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e5362eaa75a154c6e91c5b1c47719d0a0f5ca48b by Serhiy Storchaka in branch 'master': bpo-33308: Fix a crash in the parser module when convert an ST object. (#6519)

[issue31583] 2to3 call for file in current directory yields error

2018-04-18 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 67067d85eb1df8c52399f9fc74dc4c1a32ec86cd by Łukasz Langa (Miss Islington (bot)) in branch '3.7': bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (#6528)

[issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7"

2018-04-18 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : The "What's new in 3.7" is missing the functions exposed in issue31368 and issue20104: pwritev, preadv and posix_spawn. -- messages: 315465 nosy: gregory.p.smith, pablogsal, serhiy.storchaka priority: normal severity:

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-18 Thread Gregory P. Smith
Gregory P. Smith added the comment: related: https://ssl.icu-project.org/trac/ticket/13503 -- ___ Python tracker ___

[issue33314] Bad rendering in the documentation for the os module

2018-04-18 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +6219 stage: needs patch -> patch review ___ Python tracker

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6221 ___ Python tracker ___

[issue33308] parser.st2list(..., col_info=True) triggers a SystemError

2018-04-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6220 ___ Python tracker ___

[issue31583] 2to3 call for file in current directory yields error

2018-04-18 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset e3a523a0fa16aec880880928303bfcbd1fb74bc2 by Łukasz Langa (Denis Osipov) in branch 'master': bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758)

[issue31583] 2to3 call for file in current directory yields error

2018-04-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6222 ___ Python tracker ___

[issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7"

2018-04-18 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- assignee: -> pablogsal components: +Documentation priority: normal -> high stage: -> needs patch type: -> enhancement versions: +Python 3.7 ___ Python tracker

[issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7"

2018-04-18 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +6218 stage: needs patch -> patch review ___ Python tracker

[issue33314] Bad rendering in the documentation for the os module

2018-04-18 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : Currently, there are rendering issues in the os module documentation for the constants os.RWF_HIPRI and os.RWF_NOWAIT: https://docs.python.org/3.7/library/os.html#os.RWF_HIPRI

[issue31583] 2to3 call for file in current directory yields error

2018-04-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6223 ___ Python tracker ___

[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2018-04-18 Thread Max Rees
Max Rees added the comment: Actually the symlinks don't need to be broken. It fails for any kind of symlink on musl. $ ls -l /tmp/symtest lrwxrwxrwx 1 mcrees mcrees 10 Apr 18 21:16 empty -> /var/empty -rw-r--r-- 1 mcrees mcrees 0 Apr 18 21:16 regular lrwxrwxrwx 1 mcrees

[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2018-04-18 Thread iunknwn
Change by iunknwn : -- pull_requests: +6224 ___ Python tracker ___ ___ Python-bugs-list

[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2018-04-18 Thread iunknwn
iunknwn added the comment: Done - as recommend, I've opened a new PR that changes the behavior to spawn all worker threads when the executor is created. This eliminates all the thread logic from the submit function. -- ___ Python