[issue33189] pygettext doesn't work with f-strings

2018-04-18 Thread miss-islington

miss-islington  added the comment:


New changeset a4fb580f701df5bf07ce569a4f43abfb05c92759 by Miss Islington (bot) 
in branch '3.7':
bpo-33189: pygettext.py now accepts only literal strings (GH-6364)
https://github.com/python/cpython/commit/a4fb580f701df5bf07ce569a4f43abfb05c92759


--
nosy: +miss-islington

___
Python tracker 

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



[issue33189] pygettext doesn't work with f-strings

2018-04-18 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6227

___
Python tracker 

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



[issue33189] pygettext doesn't work with f-strings

2018-04-18 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6228

___
Python tracker 

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



[issue33189] pygettext doesn't work with f-strings

2018-04-18 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 69524821a87251b7aee966f6e46b3810ff5aaa64 by Serhiy Storchaka in 
branch 'master':
bpo-33189: pygettext.py now accepts only literal strings (GH-6364)
https://github.com/python/cpython/commit/69524821a87251b7aee966f6e46b3810ff5aaa64


--

___
Python tracker 

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



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

2018-04-18 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



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

2018-04-18 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset d988c0b6bd1c5965fdc51428119e9104211e688f by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-33308: Fix a crash in the parser module when convert an ST object. 
(GH-6519) (GH-6532)
https://github.com/python/cpython/commit/d988c0b6bd1c5965fdc51428119e9104211e688f


--

___
Python tracker 

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



[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 that doesn't cast entire structs but just 
casts the VLA.

thoughts?

--
Added file: https://bugs.python.org/file47542/maybe-less-horrible-gps01.patch

___
Python tracker 

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



[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": "€"}, ensure_ascii=False)
u'{"currency": "\u20ac", "greeting": "hi"}'

I think it makes sense to fix the case for "utf-8".

--
nosy: +bob.ippolito, serhiy.storchaka

___
Python tracker 

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



[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 

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



[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 

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



[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)
https://github.com/python/cpython/commit/b7e1eff8436f6e0c4aac440036092fcf96f82960


--

___
Python tracker 

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



[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 

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



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

2018-04-18 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6225

___
Python tracker 

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



[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)
https://github.com/python/cpython/commit/fc8693dc7a228d687bf066e163f82a7724b58b68


--

___
Python tracker 

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



[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)
https://github.com/python/cpython/commit/b27c71cdc02ae01081c14e7192f47abe636a831f


--
nosy: +miss-islington

___
Python tracker 

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



[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)
https://github.com/python/cpython/commit/1957e7b76a1319995360492223a4dfe1cd5d105c


--

___
Python tracker 

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



[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 
for every possible member of the union. See the attached patch. I didn't land 
it because it's gross. OTOH, undefined behavior is bad, so I'm okay landing 
this if you don't find it too revolting.

--
keywords: +patch
Added file: https://bugs.python.org/file47541/horrible.patch

___
Python tracker 

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



[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 mcrees 16 Apr 18 21:16 resolv.conf -> /etc/resolv.conf

$ python3
>>> import shutil; shutil.copytree('/tmp/symtest', '/tmp/symtest2', 
>>> symlinks=True)
shutil.Error: [('/tmp/symtest/resolv.conf', '/tmp/symtest2/resolv.conf', "[Errno
95] Not supported: '/tmp/symtest2/resolv.conf'"), ('/tmp/symtest/empty',
'/tmp/symtest2/empty', "[Errno 95] Not supported: '/tmp/symtest2/empty'")]

$ ls -l /tmp/symtest2
total 0
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 mcrees 16 Apr 18 21:16 resolv.conf -> /etc/resolv.conf

The implication of these bugs mean that things like pip may fail if it calls
shutil.copytree(..., symlinks=True) on a directory that contains symlinks(!)

Attached is a patch that works around the issue but does not address why chmod
is returning OSError instead of NotImplementedError.

--
keywords: +patch
nosy: +sroracle
Added file: https://bugs.python.org/file47540/musl-eopnotsupp.patch

___
Python tracker 

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



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

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



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)
https://github.com/python/cpython/commit/67067d85eb1df8c52399f9fc74dc4c1a32ec86cd


--

___
Python tracker 

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



[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 

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



[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 

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



[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)
https://github.com/python/cpython/commit/e3a523a0fa16aec880880928303bfcbd1fb74bc2


--
nosy: +lukasz.langa

___
Python tracker 

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



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

2018-04-18 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6221

___
Python tracker 

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



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

2018-04-18 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6220

___
Python tracker 

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



[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)
https://github.com/python/cpython/commit/e5362eaa75a154c6e91c5b1c47719d0a0f5ca48b


--

___
Python tracker 

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



[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
https://docs.python.org/3.7/library/os.html#os.RWF_NOWAIT

--
assignee: pablogsal
components: Documentation
messages: 315467
nosy: pablogsal
priority: high
severity: normal
stage: needs patch
status: open
title: Bad rendering in the documentation for the os module
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



[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 

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



[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 

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



[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 

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



[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 

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



[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: normal
status: open
title: pwritev, preadv and posix_spawn are missing from "What's new in 3.7"

___
Python tracker 

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



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

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



[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 
CFLAGS=-fsanitize=undefined CXXFLAGS=-fsanitize=undefined ../gpshead/configure
build$ make -j12

...

notice many of the warnings scroll by during the build itself as it executes 
the interpreter

then execute it yourself at the end and you'll get a bunch of these:

../gpshead/Objects/dictobject.c:547:12: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:1145:18: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:2817:15: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:831:27: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:1144:18: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:1034:15: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:728:11: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:1064:9: runtime error: index 64 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:2960:31: runtime error: index 64 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:1489:11: runtime error: index 32 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:637:27: runtime error: index 128 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:788:27: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:1671:22: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:554:31: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:1223:15: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:876:27: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:2396:15: runtime error: index 32 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:2078:10: runtime error: index 128 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:3584:38: runtime error: index 16 out of bounds 
for type 'int8_t [8]'
../gpshead/Objects/dictobject.c:3502:38: runtime error: index 64 out of bounds 
for type 'int8_t [8]'

At issue is the hash table here: 
https://github.com/python/cpython/blob/3.7/Objects/dict-common.h

which is intentionally meant to be indexed "out of bounds" off the end of the 
struct.

I'm not a strict C language definition so I don't know if that is _supposed_ to 
be defined behavior as we all tend to assume it is in C or not.  If it is 
supposed to be okay, we should be able to annotate it as such to avoid the 
warning under ubsan builds.

If it is not, we need to change the way this is written.

--
messages: 315464
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: ubsan undefined behavior sanitizer flags struct _dictkeysobject 
(PyDictKeysObj)
type: compile error
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[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 

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



[issue33310] Update references to PIL-style arrays

2018-04-18 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thanks.

--

___
Python tracker 

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



[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 

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



[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 

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



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

--

___
Python tracker 

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



[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 

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



[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 

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



[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 ###
$ python3 demo.py
[...]
 /home/stephane/src/cgitest/demo.py in ()
7 def func1(a, b): ^-- to be removed?
[...]
### end of example ###

It occurs in both text and html versions.

--
components: Library (Lib)
messages: 315459
nosy: sblondon
priority: normal
severity: normal
status: open
title: cgitb: remove parentheses when the error is in module
type: enhancement

___
Python tracker 

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



[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 
references. Either rename "PIL-style arrays" to "Pillow-style arrays" or change 
the wording to more general.

[1] http://www.pythonware.com/products/pil/
[2] http://python-pillow.org/

--
assignee: docs@python
components: Documentation
messages: 315458
nosy: docs@python, pitrou, serhiy.storchaka, skrah
priority: normal
severity: normal
status: open
title: Update references to PIL-style arrays
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[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)
https://github.com/python/cpython/commit/b88f73749db98ed62dbc8fa59480aa62202e25d7


--

___
Python tracker 

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



[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 

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



[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 

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



[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 

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



[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 

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



[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 assertion will fail.

--
components: Library (Lib)
files: mock_issue.py
messages: 315456
nosy: slacknate
priority: normal
severity: normal
status: open
title: Unittest Mock objects do not freeze arguments they are called with
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file47539/mock_issue.py

___
Python tracker 

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



[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 exception:

SystemError:  returned a result with an error set

Current thread 0x7fff9ca99380 (most recent call first):
  File "/private/tmp/tester/lazy/sub.py", line 3 in 
fish: '/Users/brettcannon/Repositories…' terminated by signal SIGABRT (Abort)
```

--
components: Library (Lib)
messages: 315455
nosy: brett.cannon
priority: normal
severity: normal
stage: test needed
status: open
title: parser.st2list(..., col_info=True) triggers a SystemError
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



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

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



[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 

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



[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 simple reproducer and failed, but I *did* manage to reproduce it in 
2.7:

% cat warningscrash.py
import threading
import warnings

class WarnOnDel(object):
def __del__(self):
warnings.warn("oh no something went wrong", UserWarning)

def do_work():
while True:
w = WarnOnDel()

for i in range(10):
t = threading.Thread(target=do_work)
t.setDaemon(1)
t.start()

% python2 warningscrash.py
warningscrash.py:7: UserWarning: oh no something went wrong
  warnings.warn("oh no something went wrong", UserWarning)
Fatal Python error: PyImport_GetModuleDict: no module dictionary!
Aborted (core dumped)

It's clearly dependent on timing, as even when starting 10 threads it doesn't 
always happen. Starting more threads makes it happen more often (but might 
cause your machine to trash a little). This doesn't reproduce it with Python 
3.6, but I do believe it's possible there, too, but perhaps it requires threads 
that release the GIL for a longer period of time, or do deallocations with less 
overhead.

Python 2.7's warnings module doesn't try to do anything sensible during 
interpreter shutdown, as far as I can tell. Python 3.6's warnings module does, 
a little, but it's still possible to get this crash. The problem is that 
interp->modules (sys.modules) is deleted right before the _warnings module 
tries to access it (with PyImport_GetModuleDict in 
Python/_warnings.c:get_warnings_attr). I think a fix for 3.6 shouldn't be too 
hard, since we can check _Py_Finalizing.

--
nosy: +twouters
versions: +Python 2.7, Python 3.4, Python 3.6

___
Python tracker 

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



[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 
was sent.

By the way this is the code I currently use:

Code:

n = 0

while 1:

time.sleep(0.001)

try:

buffer = socket.recv(8192)

if not buffer:
break

except OSError:
print('{0}. try to send:'.format(n), len(blark), 
'bytes')

try:
sent = socket.send(blark)
except ssl.SSLWantWriteError:
sent = 0
n += 1

print('Bytes sent:', sent)

else:
[...]

Result:

1. try to send: 33554469 bytes
Bytes sent: 0

[...]

137. try to send: 33554469 bytes
Bytes sent: 0

138. try to send: 33554469 bytes
Bytes sent: 0

139. try to send: 33554469 bytes
Bytes sent: 33554469

--

___
Python tracker 

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



[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 
requires reading and a recv() also involves writing.

PS: bugs.python.org is an issue tracker, not a help forum.

--
status: open -> closed

___
Python tracker 

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



[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 this is a very good feature for the sqlite module. I know that 
there is no active core developer that is currently working on sqlite module 
but this patch is already waiting 2 years. Could I do anything to help this 
patch merged?

--

___
Python tracker 

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



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

___
Python tracker 

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



[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
type: crash -> behavior

___
Python tracker 

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



[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 * 1024)

In this case the socket is ready for sending data and should return the bytes 
that were actually sent. But when sending a large amount of bytes it every time 
fails with SSLWantWriteError exception.

--

___
Python tracker 

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



[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 

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



[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 

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



[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 "", line 1
SyntaxError: invalid digit '9' in octal literal
>>> 0o
  File "", line 1
SyntaxError: invalid octal literal
>>> 1_2_
  File "", line 1
SyntaxError: invalid decimal literal
>>> 0.1_2_
  File "", line 1
SyntaxError: invalid decimal literal
>>> 12e+
  File "", line 1
SyntaxError: invalid decimal literal
>>> 12e+1_
  File "", line 1
SyntaxError: invalid decimal literal

"SyntaxError: invalid token" was emitted before.

No tests yet. Suggestions about error messages are welcome.

--
components: +Interpreter Core

___
Python tracker 

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



[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 

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



[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 "/usr/lib/python3/dist-packages/websockets/server.py", line 81, in 
handler
yield from self.ws_handler(self, path)
  File "/var/www/vhosts/.../app/sockets/core/Daemon.py", line 286, in 
websocketClientHandler
self.api.connection.send(data)
  File "/usr/lib/python3.5/ssl.py", line 869, in send
return self._sslobj.write(data)
  File "/usr/lib/python3.5/ssl.py", line 594, in write
return self._sslobj.write(data)
ssl.SSLWantWriteError: The operation did not complete (write) (_ssl.c:1949)

--
assignee: christian.heimes
components: SSL
messages: 315444
nosy: Kaulkwappe, christian.heimes
priority: normal
severity: normal
status: open
title: socket.send() fails to send large amount of bytes
type: crash
versions: Python 3.5

___
Python tracker 

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



[issue33292] Fix secrets.randbelow docstring

2018-04-18 Thread Vex Woo

Vex Woo  added the comment:

It looks simple and good.

--

___
Python tracker 

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



[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: +serhiy.storchaka

___
Python tracker 

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



[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 

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



[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 
parentheses.

Showing the number of the line containing an unmatched opening parenthesis 
looks as enhancement. But I'm not sure that this change is always an 
enhancement (in comparison with issue1634034). Syntax error for unmatched 
parentheses will be raised even if the code contains other syntax errors before 
unmatched parenthesis.

[1] https://morepypy.blogspot.de/2018/04/improving-syntaxerror-in-pypy.html
[2] 
https://bitbucket.org/pypy/pypy/commits/e66f24650dafbcd2ac1c443af7417eddf8e8f093

--
components: Interpreter Core
messages: 315441
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improving SyntaxError for unmatched parentheses
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[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 

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



[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 octal one, in which case an error message that talks about octal 
might be confusing.

>>> import datetime
>>> birthday = datetime.datetime(1912, 06, 23)
  File "", line 1
birthday = datetime.datetime(1912, 06, 23)
^
SyntaxError: invalid token

Could we cover both cases in a single message? "leading zeros in decimal 
integer literals are not permitted; use an 0o prefix for octal integers"

--

___
Python tracker 

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



[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 solution for the problem. Is either the original PR or the new 
variant acceptable?

--

___
Python tracker 

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



[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 

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