[issue9146] Segfault in hashlib in OpenSSL FIPS mode using non-FIPS-compliant hashes, if "ssl" imported before "hashlib"

2017-05-24 Thread Gregory P. Smith

Gregory P. Smith added the comment:


New changeset 07244a83014fad42da937c17d98474b47a570bf7 by Gregory P. Smith in 
branch 'master':
bpo-9146: Raise a ValueError if OpenSSL fails to init a hash func. (#1777)
https://github.com/python/cpython/commit/07244a83014fad42da937c17d98474b47a570bf7


--

___
Python tracker 

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



[issue14111] IDLE Debugger should handle interrupts

2017-05-24 Thread Louie Lu

Louie Lu added the comment:

The reproduce step can be reduce to:

1. open idlelib with debugger (./python -m idlelib -d)
2. enter print() (or any other function call)
3. Control-C breakout

Then it will restart the shell.

--
nosy: +louielu

___
Python tracker 

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



[issue30395] deadlocked child process after forking on pystate.c's head_mutex

2017-05-24 Thread STINNER Victor

STINNER Victor added the comment:

Gregory P. Smith added the comment:

Would PyThread_free_lock (effectively sem_destroy()) work without
(additional) problems?

If I recall correctly, no, you can get issues if the lock is still
acquired... But I should check.

--

___
Python tracker 

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



[issue28707] add 'directory' option to the http.server module

2017-05-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset a17a2f52c4c3b37414da95a152fc8669978c7c83 by Victor Stinner 
(Stéphane Wirtel) in branch 'master':
bpo-28707: Add the directory parameter to http.server.SimpleHTTPRequestHandler 
and http.server module (#1776)
https://github.com/python/cpython/commit/a17a2f52c4c3b37414da95a152fc8669978c7c83


--

___
Python tracker 

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



[issue30150] raw debug allocators to not return malloc alignment

2017-05-24 Thread Julian Taylor

Julian Taylor added the comment:

The largest type is usually the long double. Its alignment ranges from 4 bytes 
(i386) to 16 bytes (sparc).
So Py_MAX (sizeof (size_t), 8) should indeed do it.

--

___
Python tracker 

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



[issue28707] add 'directory' option to the http.server module

2017-05-24 Thread STINNER Victor

STINNER Victor added the comment:

Patch merged. Thanks Stéphane and Julien! Especially because writing the unit 
test was much more painful than I expected, but it's really worth it!

--

___
Python tracker 

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



[issue28707] add 'directory' option to the http.server module

2017-05-24 Thread STINNER Victor

Changes by STINNER Victor :


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



[issue30452] xml.etree sourcecode bug

2017-05-24 Thread Zoltan Baksa

New submission from Zoltan Baksa:

Hi,
I used before an XML merger script with 2.7 version, which was running fine. 
After my Anaconda was updated by SCCM to version 3.6 the same script fails and 
reports the following traceback:

File "C:\Program Files\Anaconda3\lib\xml\etree\ElementTree.py", line 1190, in
parse
 tree.parse(source, parser)
  File "C:\Program Files\Anaconda3\lib\xml\etree\ElementTree.py", line 591, in p
arse
self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: unclosed token: line 128, column 4

What can I do?

--
components: XML
files: xmlMerge.py
messages: 294335
nosy: baksaz
priority: normal
severity: normal
status: open
title: xml.etree sourcecode bug
versions: Python 3.6
Added file: http://bugs.python.org/file46891/xmlMerge.py

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-24 Thread Iryna Shcherbina

Iryna Shcherbina added the comment:

Thank you, Erik. I have applied your new patch, and ran another build on arm64. 
The tests passed. Attaching the build log for more information.

--
Added file: http://bugs.python.org/file46892/arm64_build_log.txt

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-24 Thread Erik Bray

Erik Bray added the comment:

Thanks for checking!

--

___
Python tracker 

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



[issue14111] IDLE Debugger should handle interrupts

2017-05-24 Thread Louie Lu

Louie Lu added the comment:

Update roger's patch to current version.

Is there any reason this patch isn't merged? The problem in #26949 is a 
separate issue about this problem.

--
Added file: http://bugs.python.org/file46893/0001-WIP.patch

___
Python tracker 

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



[issue16806] col_offset is -1 and lineno is wrong for multiline string expressions

2017-05-24 Thread Ivailo Karamanolev

Ivailo Karamanolev added the comment:

What's the status on this? Anything preventing it getting fixed? Still the same 
in 3.6.1:

>>> import ast
>>> ast.parse("""'''foo\n'''""").body[0].value.col_offset
-1

--
nosy: +karamanolev

___
Python tracker 

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



[issue30453] str.format() method, Rounding off wrong

2017-05-24 Thread Kazuhiro Fujie

New submission from Kazuhiro Fujie:

To whom it may concern:

I post issue at first time.
Please forgive me if this is rude

C:\Users\kudo-shunsaku>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> num = 4.625
>>> "{:.2f}".format(num)
'4.62'
>>> num = 4.645
>>> "{:.2f}".format(num)
'4.64'
>>> num = 4.655
>>> "{:.2f}".format(num)
'4.66'
>>>

Please, check this out.
 I checked it version 3.5.3 and 3.6.1 on Windows and Cent OS.

--
components: Build
messages: 294340
nosy: kudoshunsaku
priority: normal
severity: normal
status: open
title: str.format() method, Rounding off wrong
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



[issue30453] str.format() method, Rounding off wrong

2017-05-24 Thread Mark Dickinson

Mark Dickinson added the comment:

The code is behaving correctly. The surprise is due to the internal binary 
representation of Python floats, and is related to the documentation note about 
`round` here:

https://docs.python.org/3/library/functions.html#round

> The behavior of round() for floats can be surprising: for example, 
> round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: 
> it’s a result of the fact that most decimal fractions can’t be represented 
> exactly as a float.

--
nosy: +mark.dickinson
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



[issue30453] str.format() method, Rounding off wrong

2017-05-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Actually, there are two potential sources of confusion here:

1. Python uses the round-ties-to-even rounding mode, which means cases that are 
*exactly* halfway between two target values round to the value with even last 
digit. This rule is being used in your first example (4.625), which is a value 
that's exactly representable in the IEEE 754 binary64 format that Python 
typically uses to represent floats, and is exactly halfway between 4.2 and 4.3.

2. It might look as though round-ties-to-even applies in the second and third 
cases, too, but that's not the case, since these values *aren't* exactly 
halfway between the relevant decimal values, thanks to the representation error 
incurred when translating to the binary64 format. The value specified by the 
literal "4.645" is stored internally as 
"4.644573674358543939888477325439453125", which is a tiny amount 
closer to 4.64 than to 4.65, so it rounds to 4.64. The value 4.655 works 
similarly.

--

___
Python tracker 

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



[issue30453] str.format() method, Rounding off wrong

2017-05-24 Thread Mark Dickinson

Mark Dickinson added the comment:

> is exactly halfway between 4.2 and 4.3.

That should have said "between 4.62 and 4.63", of course. Apologies.

--

___
Python tracker 

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



[issue25430] speed up ipaddress __contain__ method

2017-05-24 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +1866

___
Python tracker 

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



[issue30454] Python module cx_Oracle ld installation issue on Solaris11U3 SPARC: fatal: file /oracle/database/lib/libclntsh.so: wrong ELF class: ELFCLASS64 error

2017-05-24 Thread sameer natekar

New submission from sameer natekar:

Trying to install cx_Oracle on Solaris11U3 but getting ld: fatal: file 
/oracle/database/lib/libclntsh.so: wrong ELF class: ELFCLASS64 error
 
# python setup.py build
running build
running build_ext
building 'cx_Oracle' extension
cc -DNDEBUG -KPIC -DPIC -I/oracle/database/rdbms/demo 
-I/oracle/database/rdbms/public -I/usr/include/python2.7 -c cx_Oracle.c -o 
build/temp.solaris-2.11-sun4v.32bit-2.7-11g/cx_Oracle.o -DBUILD_VERSION=5.2.1
"SessionPool.c", line 202: warning: integer overflow detected: op "<<"
cc -G build/temp.solaris-2.11-sun4v.32bit-2.7-11g/cx_Oracle.o 
-L/oracle/database/lib -L/usr/lib -lclntsh -lpython2.7 -o 
build/lib.solaris-2.11-sun4v.32bit-2.7-11g/cx_Oracle.so
ld: fatal: file /oracle/database/lib/libclntsh.so: wrong ELF class: ELFCLASS64
error: command 'cc' failed with exit status 2
 
Tried all available information on the internet:
Installed gcc
Installed solarisstudio12.4
Installed instantclient-basic-solaris.sparc64-12.2.0.1.0, 
instantclient-odbc-solaris.sparc64-12.2.0.1.0
Set LD_LIBRARY_PATH to oracle home directory:instantclient_12_2/
 
Same issue seen while installing DBD:Oracle perl module.

--
components: Installation
messages: 294344
nosy: sameernatekar
priority: normal
severity: normal
status: open
title: Python module cx_Oracle ld installation issue on Solaris11U3 SPARC: 
fatal: file /oracle/database/lib/libclntsh.so: wrong ELF class: ELFCLASS64 error
type: compile error
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



[issue25324] Importing tokenize modifies token

2017-05-24 Thread Albert-Jan Nijburg

Albert-Jan Nijburg added the comment:

I've updated the PR and added the tokenize tokens to token.h and their names to 
tokenizer.c. This way they'll show up when you run token.py. The names will 
always be in tok_name and tokenizer.py will use those. Not breaking the public 
api and no longer modifying token.py when you import tokenizer.py.

--

___
Python tracker 

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



[issue30377] Unnecessary complexity in tokenize.py: comments and newlines

2017-05-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset c471ca448cf336d7eb4a7cbe14d0012baf122d1f by Serhiy Storchaka 
(Albert-Jan Nijburg) in branch 'master':
bpo-30377: Simplify handling of COMMENT and NL in tokenize.py (#1607)
https://github.com/python/cpython/commit/c471ca448cf336d7eb4a7cbe14d0012baf122d1f


--

___
Python tracker 

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



[issue30290] IDLE: add tests for help_about.py

2017-05-24 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Thanks Terry.

I'll leave those other items alone for now.  It makes sense what you said about 
the 'create widget' styles.  Looking at it for the first time, I kind of liked 
the second version (in query) because I could more immediately understand what 
was happening, plus it seemed to lend itself to modularizing.  For example, 
have one function that has all 'create' and one that has all the 'place'.  
help_about was a small dialog and there were already a lot of lines of code.  
But, to your last point, blue tagging seems like it would make it all easier.

For the next step, do you have a plan in mind for what you'd like me to do 
next?  I know you mentioned ttk for help_about, but didn't know if you wanted 
me to tackle that.  Or should I PEP8 and docstring other modules such as 
textview.py and configdialog.py?

One question I forgot to ask before -- the `Toplevel.__init__(self, parent)` 
line, can this be changed to super().__init__(parent)?

--

___
Python tracker 

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



[issue30392] default webbrowser fails on macOS Sierra 10.12.5

2017-05-24 Thread Andrew Jaffe

Andrew Jaffe added the comment:

I'll also note that my bug report (radar) has been marked as "DUPLICATE OF 
31898264 (OPEN)". So Apple is aware of the bug, and possibly not completely 
ignoring it. However, the opacity of the system is such that there is no way to 
get any further information (even though we know the bug number).

--

___
Python tracker 

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



[issue30377] Unnecessary complexity in tokenize.py: comments and newlines

2017-05-24 Thread Serhiy Storchaka

Changes 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



[issue30452] xml.etree sourcecode bug

2017-05-24 Thread Zoltan Baksa

Zoltan Baksa added the comment:

The error was caused, because the xml files did not had the correct close 
element for the root tag.
The issue is not closed, because the error message was not adequate to be able 
to highlight the root cause.

--

___
Python tracker 

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



[issue30455] Generate C code from token.py and not vice versa

2017-05-24 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Currently Lib/token.py is generated from Include/token.h. This contradicts 
common practice when the C code is generated from the Python code (see for 
example opcode.py and sre_constants.py). In additional the table in 
Parser/tokenizer.c should be manually supported matching Include/token.h.

Generating Include/token.h and Parser/tokenizer.c from Lib/token.py would be 
simpler and more reliable.

--
components: Interpreter Core, Library (Lib)
messages: 294350
nosy: Albert-Jan Nijburg, benjamin.peterson, haypo, meador.inge, 
r.david.murray, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Generate C code from token.py and not vice versa
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



[issue30456] 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses

2017-05-24 Thread Eli_B

New submission from Eli_B:

The documentation says isinstance(x, (int, int)) would be fixed to 
isinstance(x, (int)). The fix is actually isinstance(x, int).

I propose the following text instead:
"
2to3fixer:: isinstance

Fixes duplicate types in the second argument of :func:`isinstance`.  For 
example, isinstance(x, (int, int)) is converted to isinstance(x, int) and 
isinstance(x, (int, float, int)) is converted to isinstance(x, (int, float)).
"

--
assignee: docs@python
components: Documentation
files: 2to3.rst
messages: 294351
nosy: Eli_B, docs@python
priority: normal
pull_requests: 1867
severity: normal
status: open
title: 2to3 docs: example of fix for duplicates in second argument of 
isinstance has superfluous parentheses
versions: Python 2.7
Added file: http://bugs.python.org/file46894/2to3.rst

___
Python tracker 

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



[issue27728] HTTPConnection.requests has a mutable as default value for headers

2017-05-24 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


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



[issue27728] HTTPConnection.requests has a mutable as default value for headers

2017-05-24 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


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



[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

2017-05-24 Thread Martin Panter

Martin Panter added the comment:

Previous report: Issue 25641. At least in Posix, the “putenv” function is not 
required to be thread safe.

--
nosy: +martin.panter

___
Python tracker 

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



[issue30438] tarfile would fail to extract tarballs with files under R/O directories

2017-05-24 Thread Yaroslav Halchenko

Yaroslav Halchenko added the comment:

Dear Catherine,

Thank you very much for looking into it!! And sorry that I have missed the fact 
of recursive addition when pointing to a directory.  Indeed though, tar handles 
that case a bit more gracefully.

BUT I feel somewhat dumb since I am afraid that may be the actual original 
issue I have observed was simply because I already had that archive extracted 
and tried to extract it twice, overriding existing files.  That leads to the 
failure I think I was trying to chase down (example with a sample tiny real 
annex repo):

$> wget -q http://onerussian.com/tmp/sample.tar ; python -c 'import tarfile; 
tarfile.open("sample.tar").extractall()'
$> python -c 'import tarfile; tarfile.open("sample.tar").extractall()'
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/tarfile.py", line 2081, in extractall
self.extract(tarinfo, path)
  File "/usr/lib/python2.7/tarfile.py", line 2118, in extract
self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
  File "/usr/lib/python2.7/tarfile.py", line 2194, in _extract_member
self.makefile(tarinfo, targetpath)
  File "/usr/lib/python2.7/tarfile.py", line 2234, in makefile
with bltn_open(targetpath, "wb") as target:
IOError: [Errno 13] Permission denied: 
'./sample/.git/annex/objects/G6/qW/SHA256E-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b/SHA256E-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b'

$> tar -xf sample.tar && echo "extracted ok"
extracted ok


But I wouldn't even consider it a failure but would take it as a feature in my 
case (stuff is read-only for a reason!)

Altogether, I do not have the earth-shaking problem now, thus if you feel that 
issue needs retitle or closing, feel free to do so

--

___
Python tracker 

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



[issue30438] tarfile would fail to extract tarballs with files under R/O directories (twice)

2017-05-24 Thread Yaroslav Halchenko

Changes by Yaroslav Halchenko :


--
title: tarfile would fail to extract tarballs with files under R/O directories 
-> tarfile would fail to extract tarballs with files under R/O directories 
(twice)

___
Python tracker 

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



[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

2017-05-24 Thread Osvaldo Santana Neto

Osvaldo Santana Neto added the comment:

There are exceptions being raised in many applications (as reported here and in 
http://bugs.python.org/issue25641) and there are three paths to follow: 

1. We handle this exception somewhere;
2. We avoid raising it;
3. Just leave it. I don't care about this exception.

If we chose to handle this exception we need to decide where we'll do it. At 
os.py module? At urllib/request.py? At all http client libraries (eg. 
python-requests)? At our applications?

If we chose to avoid this exception we, probably, need to implement some kind 
of lock/mutex in os.environ.

I can implement any of these options. You just need to decide which one is best.

If we chose the third option, we can just close this issue.

--

___
Python tracker 

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



[issue30362] Launcher add list and list with paths options

2017-05-24 Thread Steve Barnes

Steve Barnes added the comment:

--list and --list-paths added back in following review by paul.moore.
The short options -0 & -0p left in as short forms.

--

___
Python tracker 

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



[issue30455] Generate C code from token.py and not vice versa

2017-05-24 Thread STINNER Victor

STINNER Victor added the comment:

I like the idea.

--

___
Python tracker 

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



[issue30457] Allow retrieve the number of waiters pending for most of the asyncio lock primitives

2017-05-24 Thread pfreixes

New submission from pfreixes:

Currently, there is no way to access to the number of waiters pending to be 
woken up. This information can be useful for those environments which create 
and delete asyncio primitives instances depending if there are waiters still to 
be processed.

The following example shows an example of the DogPile solution that uses the 
Event lock mechanism. Each time that there is a miss in the cache, a new Event 
is created and it will be removed by the last waiter.


import asyncio

cache = {}
events = {}

async def get(process, key):
try:
return cache[key]
except KeyError:
try:
await events[key].wait()
if len(events[key]._waiters) == 0:
events.pop(key)
return cache[key]
except KeyError:
events[key] = asyncio.Event()
# simulates some IO to get the Key
await asyncio.sleep(0.1)
cache[key] = "some random value"
events[key].set()


async def main():
tasks = [get(i, "foo") for i in range(1, 10)]
await asyncio.gather(*tasks)

asyncio.get_event_loop().run_until_complete(main())

--
components: asyncio
messages: 294357
nosy: pfreixes, yselivanov
priority: normal
severity: normal
status: open
title: Allow retrieve the number of waiters pending for most of the asyncio 
lock primitives
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



[issue30457] Allow retrieve the number of waiters pending for most of the asyncio lock primitives

2017-05-24 Thread pfreixes

Changes by pfreixes :


--
pull_requests: +1868

___
Python tracker 

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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-05-24 Thread Steve Dower

Steve Dower added the comment:

The reason to keep it running is for all the existing people who are building 
from source. Unless you're porting all the old versions over and providing 
instructions for updating old sources? I wouldn't bother - just leave the 
server up for a few more years.

Ben probably knows - can we add a custom message to svn requests? Then we could 
start publicising an end of life date for it.

--
assignee:  -> zach.ware
nosy: +benjamin.peterson

___
Python tracker 

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



[issue30458] CRLF Injection in httplib

2017-05-24 Thread Orange

New submission from Orange:

Hi, the patch in CVE-2016-5699 can be broke by an addition space.
http://www.cvedetails.com/cve/CVE-2016-5699/
https://hg.python.org/cpython/rev/bf3e1c9b80e9
https://hg.python.org/cpython/rev/1c45047c5102

import urllib, urllib2

urllib.urlopen('http://127.0.0.1\r\n\x20hihi\r\n :11211')
urllib2.urlopen('http://127.0.0.1\r\n\x20hihi\r\n :11211')

--
components: Library (Lib)
messages: 294360
nosy: orange
priority: normal
severity: normal
status: open
title: CRLF Injection in httplib
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



[issue30455] Generate C code from token.py and not vice versa

2017-05-24 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I can work on it

--
nosy: +matrixise

___
Python tracker 

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



[issue30459] PyList_SET_ITEM could be safer

2017-05-24 Thread Espie Marc

New submission from Espie Marc:

Documentation says PyList_SET_ITEM is void, but it lies. The macro is such that 
it yields the actual element being set.

wrapping the macro content in a do {} while (0)  makes sure PyList_SET_ITEM is 
really void, e.g.:
#define PyList_SET_ITEM(op, i, v) do { (((PyListObject *)(op))->ob_item[i] = 
(v)); } while (0)


I just ran into the problem while compiling py-qt4 with clang.
There was some confusion between PyList_SET_ITEM and PyList_SetItem:

if (obj == NULL || PyList_SET_ITEM (l, i, obj) < 0)

g++ didn't catch it (because it doesn't see negative pointers as a problem), 
but clang++ instantly broke.

With PyList_SET_ITEM truly void the problem disappears.

--
components: Interpreter Core
messages: 294362
nosy: espie
priority: normal
severity: normal
status: open
title: PyList_SET_ITEM  could be safer
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue30455] Generate C code from token.py and not vice versa

2017-05-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I already write a patch.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread Mike

Mike added the comment:

It's been about a month since I heard back, so I thought I'd comment here just 
in case this slipped of anyone's radar. Is there anything I can doto help this 
land?

--

___
Python tracker 

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



[issue29871] Enable optimized locks on Windows

2017-05-24 Thread Steve Dower

Steve Dower added the comment:

I updated the PR to be mergeable and let the AppVeyor run work - 
https://ci.appveyor.com/project/python/cpython/build/3.7.0a0.2452

Unfortunately, there appear to be a number of regressions due to this. I'm not 
going to have time right now to work through them myself, but if someone else 
can it would be great to resolve these and get the change in.

--

___
Python tracker 

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



[issue30394] smtplib leaves open sockets around if SMTPConnectError is raised in __init__

2017-05-24 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
pull_requests: +1872

___
Python tracker 

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



[issue30394] smtplib leaves open sockets around if SMTPConnectError is raised in __init__

2017-05-24 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
pull_requests: +1870

___
Python tracker 

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



[issue30394] smtplib leaves open sockets around if SMTPConnectError is raised in __init__

2017-05-24 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
pull_requests: +1871

___
Python tracker 

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



[issue29510] gitignore settings files for Eclipse IDE

2017-05-24 Thread G Young

Changes by G Young :


--
pull_requests: +1873

___
Python tracker 

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



[issue30395] deadlocked child process after forking on pystate.c's head_mutex

2017-05-24 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Another alternative *might* be to check if the lock is locked (non-blocking 
acquire?) and release it if so. Under the normal assumption that we are the 
only thread running immediately post-fork().

I'm not sure that can be guaranteed reliable given that other C code could've 
used pthread_atfork to register an "after" fork handler that spawns threads.  
But that should be rare, and nothing here can really fix the underlying 
"programmer has mixed fork and threads" issue. Only ameliorate it.

But i'm not sure this post fork memory leak is really a problem other than 
potentially showing up in memory sanatizer runs involving forked children.  The 
scenario where it would be an actual leak is if a process does serial fork() 
calls with the parent(s) dying rather than forking new children from a common 
parent.  That would grow the leak as each child would have an additional lock 
allocated (a few bytes).  I don't _believe_ that kind of process pattern is 
common (but people do everything).

--

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-05-24 Thread Ned Deily

Ned Deily added the comment:

Thanks everyone for the input on this issue.  We've had some discussions here 
at PyCon US and I think the consensus is that we all agree with Nathaniel's 
comment above that, for 3.6.x, that modules built on 3.6.2 (and later 3.6.x) 
should be importable on any 3.6.x (including 3.6.0), and 3.6.2 (and later 
3.6.x) should be able to import modules built on any 3.6.x.  Steve Dower has 
suggested that it would be nice to provide a compile option so that users could 
compile an extension with the benefit of the 3.6.1 fix if they do not have the 
need for 3.6.0 compatibility.  I think that would be nice but not essential.  
But we do need to ensure that 3.6.2 is fixed to be compatible as above prior to 
3.6.2rc currently scheduled for 2017-06-26.  Serhiy, is that doable?

Otherwise, I believe no further changes are needed for the other branches, 
correct?

--

___
Python tracker 

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



[issue9146] Segfault in hashlib in OpenSSL FIPS mode using non-FIPS-compliant hashes, if "ssl" imported before "hashlib"

2017-05-24 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Resolved for 3.7, assigning to christian to deal with the backports as I 
believe he has employer motivation to see those in (should be trivial).

--
assignee: gregory.p.smith -> christian.heimes
resolution:  -> fixed
stage: patch review -> backport needed
versions: +Python 3.5 -Python 3.7

___
Python tracker 

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



[issue30362] Launcher add list and list with paths options

2017-05-24 Thread Steve Barnes

Steve Barnes added the comment:

Note that the -0, --list, -0p & --list-path options will only be invoked if 
they are the only argument to py.exe this mirrors the original implementation 
of --help.

--

___
Python tracker 

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



[issue29102] Add an id field to PyInterpreterState.

2017-05-24 Thread Eric Snow

Eric Snow added the comment:

Apparently it is PRId64.

--

___
Python tracker 

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



[issue30447] test_capi.test_subinterps() fails on ARMv7 Ubuntu 3.x

2017-05-24 Thread Eric Snow

Changes by Eric Snow :


--
pull_requests: +1874

___
Python tracker 

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



[issue29102] Add an id field to PyInterpreterState.

2017-05-24 Thread Eric Snow

Eric Snow added the comment:

(see issue30447)

--

___
Python tracker 

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



[issue30394] smtplib leaves open sockets around if SMTPConnectError is raised in __init__

2017-05-24 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset 779e7c933e777270897b1e35fa9e5b12eee12af9 by Xiang Zhang (Stéphane 
Wirtel) in branch '2.7':
bpo-30394: Fix a socket leak in smtplib.SMTP.__init__() (#1700) (#1788)
https://github.com/python/cpython/commit/779e7c933e777270897b1e35fa9e5b12eee12af9


--

___
Python tracker 

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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread R. David Murray

R. David Murray added the comment:


New changeset a083c8ee6cb89ca573fe10c4c1922e2fa69ceaa3 by R. David Murray 
(jugglinmike) in branch 'master':
bpo-30160: Clarify intended usage of wfile (gh-1300)
https://github.com/python/cpython/commit/a083c8ee6cb89ca573fe10c4c1922e2fa69ceaa3


--

___
Python tracker 

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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread R. David Murray

R. David Murray added the comment:

Pinging the issue is exactly what you needed to do :)  As I said on the PR, I'm 
not set up to do backports yet so hopefully you or someone else will do those.

--
stage:  -> backport needed
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



[issue30442] Skip test_xml_etree under coverage

2017-05-24 Thread Kushal Das

Kushal Das added the comment:


New changeset 1de4705d00168afa8c5b6741af02e21fc609af58 by Kushal Das in branch 
'master':
bpo-30442: Skips refcount test in test_xml_etree under coverage (#1767)
https://github.com/python/cpython/commit/1de4705d00168afa8c5b6741af02e21fc609af58


--

___
Python tracker 

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



[issue30394] smtplib leaves open sockets around if SMTPConnectError is raised in __init__

2017-05-24 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset ebbefae14039aa86d4c8a7cfab8f2b5a3ef0d241 by Xiang Zhang (Stéphane 
Wirtel) in branch '3.5':
bpo-30394: Fix a socket leak in smtplib.SMTP.__init__() (#1700) (#1789)
https://github.com/python/cpython/commit/ebbefae14039aa86d4c8a7cfab8f2b5a3ef0d241


--

___
Python tracker 

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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +1876

___
Python tracker 

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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +1875

___
Python tracker 

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



[issue30394] smtplib leaves open sockets around if SMTPConnectError is raised in __init__

2017-05-24 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset c3454f0e79b35fb81b0426cfac4b801d4495b8ea by Xiang Zhang (Stéphane 
Wirtel) in branch '3.6':
bpo-30394: Fix a socket leak in smtplib.SMTP.__init__() (#1700) (#1790)
https://github.com/python/cpython/commit/c3454f0e79b35fb81b0426cfac4b801d4495b8ea


--

___
Python tracker 

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



[issue30394] smtplib leaves open sockets around if SMTPConnectError is raised in __init__

2017-05-24 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2017-05-24 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

@haypo, you told me there is an alternative to my patch, provided by an other 
dev. what's the bpo issue for the alternative.

--

___
Python tracker 

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



[issue30460] file opened for updating cannot write after read

2017-05-24 Thread Jeremy Kloth

New submission from Jeremy Kloth:

Attempting to append to an existing file fails with no error set:

>>> import os, tempfile
>>> fd, fn = tempfile.mkstemp()
>>> os.write(fd, 'some text')
9
>>> os.close(fd)
>>> with open(fn, 'r+') as f:
... f.read()
... f.write('more text')
... 
'some text'
Traceback (most recent call last):
  File "", line 3, in 
IOError: [Errno 0] Error

(error 0 is defined as NO_ERROR)

--
components: IO, Windows
messages: 294379
nosy: jkloth, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: file opened for updating cannot write after read
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



[issue28845] Clean up known issues for AIX

2017-05-24 Thread Zachary Ware

Zachary Ware added the comment:


New changeset 7c2f82d158a19ec9ee6b7e259c243e1f06f0434f by Zachary Ware (Eric N. 
Vander Weele) in branch 'master':
bpo-28845: Clean up known issues for AIX (GH-1670)
https://github.com/python/cpython/commit/7c2f82d158a19ec9ee6b7e259c243e1f06f0434f


--
nosy: +zach.ware

___
Python tracker 

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



[issue30461] glob returns results in undeterministic order

2017-05-24 Thread Bernhard M. Wiedemann

New submission from Bernhard M. Wiedemann:

because POSIX readdir does not guarantee any order
glob often gives unexpectedly random results.

Some background:
for openSUSE Linux we build packages in the Open Build Service (OBS)
which tracks dependencies, so when e.g. a new glibc is submitted,
all packages depending on glibc are rebuilt
and if those depending binaries changed,
the new version is pushed to the mirrors.

Many python modules build their .so files from a glob.glob(path, "*.cpp")

The old glob behaviour would often lead to the linker
randomly ordering functions in resulting object files,
thus we were not able to auto-detect
that the package did not actually change
which wastes bandwidth of distribution mirrors and users.

See also https://reproducible-builds.org/ on that topic.

There are plenty affected packages out there
https://github.com/pytries/datrie/blob/master/setup.py#L10
https://github.com/jonashaag/bjoern/blob/master/setup.py#L6
https://github.com/scipy/scipy/blob/master/scipy/sparse/linalg/dsolve/setup.py#L28

--
components: Library (Lib)
messages: 294381
nosy: bmwiedemann
priority: normal
severity: normal
status: open
title: glob returns results in undeterministic order
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



[issue28845] Clean up known issues for AIX

2017-05-24 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!  I'm going to decline backporting this; let's just focus 
on the future for this.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7, 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



[issue30461] glob returns results in undeterministic order

2017-05-24 Thread Bernhard M. Wiedemann

Changes by Bernhard M. Wiedemann :


--
pull_requests: +1877

___
Python tracker 

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



[issue30436] importlib.find_spec raises AttributeError when parent is not a package/module

2017-05-24 Thread Brett Cannon

Brett Cannon added the comment:

Here is why Python does when importing a module that lacks __path__:

>>> import importlib
>>> del importlib.__path__
>>> import importlib.util
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'importlib.util'; 'importlib' is not a 
package

So yes, we should change find_spec() to raise ModuleNotFoundError to match 
(although only in Python 3.7 since this is a breaking change).

--
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open
title: importlib.find_spec raises AttributeError/ModuleNotFoundError when 
parent is not a package/module -> importlib.find_spec raises AttributeError 
when parent is not a package/module
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue9938] Documentation for argparse interactive use

2017-05-24 Thread Sourav Singh

Sourav Singh added the comment:

I would like to send a patch for the issue. How do I start

--
nosy: +Sourav Singh

___
Python tracker 

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



[issue20265] Bring Windows docs up to date

2017-05-24 Thread Sourav Singh

Sourav Singh added the comment:

The issue is beileve is fixed now.

--
nosy: +Sourav Singh

___
Python tracker 

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



[issue18859] README.valgrind should mention --with-valgrind

2017-05-24 Thread Sourav Singh

Sourav Singh added the comment:

Is the issue fixed?

--
nosy: +Sourav Singh

___
Python tracker 

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



[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-05-24 Thread Sourav Singh

Sourav Singh added the comment:

@Martin I would like to take a stab at the issue. How do I start?

--
nosy: +Sourav Singh

___
Python tracker 

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



[issue30462] urllib does not support NO_PROXY environment variable containing domain with asterisk

2017-05-24 Thread Jiri Hnidek

New submission from Jiri Hnidek:

Module urllib contains method proxy_bypass_environment(domain_name). This 
method check if domain_name should be excluded from proxying. The domain_name 
is checked against environment variable no_proxy or NO_PROXY. This variable 
contains comma separated list of domain names/domains. Domains can be specified 
in following variants:

 - domain.com
 - .domain.com
 - *.domain.com

Method proxy_bypass_environment support first two variants, but it doesn't 
support variant with asterisk at beginning of domain. The last variant is not 
anything unusual; e.g.: 
https://www.gnu.org/software/emacs/manual/html_node/url/Proxies.html

--
components: Library (Lib)
messages: 294388
nosy: Jiri Hnidek
priority: normal
severity: normal
status: open
title: urllib does not support NO_PROXY environment variable containing domain 
with asterisk
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



[issue30463] Add __slots__ to ABC convenience class

2017-05-24 Thread Aaron Hall

New submission from Aaron Hall:

We have __slots__ with other ABC's, see http://bugs.python.org/issue11333 and 
http://bugs.python.org/issue21421.

There are no downsides to having empty slots on a non-instantiable class, but 
it does give the option of denying __dict__ creation for subclassers. 

The possibility of breaking is for someone using __slots__ but relying on 
__dict__ creation in a subclass - they will have to explicitly add "__dict__" 
to __slots__. Since we have added __slots__ to other ABC's, 

I will provide a PR soon on this. Diff should look like this (in Lib/abc.py):

class ABC(metaclass=ABCMeta):
"""Helper class that provides a standard way to create an ABC using
inheritance.
"""
- pass
+ __slots__ = ()

(I also want to add a test for this, and ensure other ABC's also have this if 
they don't.)

--
messages: 294389
nosy: Aaron Hall
priority: normal
severity: normal
status: open
title: Add __slots__ to ABC convenience class

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-05-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'll apply to 3.6 the same patch as for 3.5 tomorrow.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue12345] Add math.tau

2017-05-24 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +1878

___
Python tracker 

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



[issue30461] glob returns results in undeterministic order

2017-05-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks as a duplicate of issue21748. That behavior was explicitly 
documented in issue25615.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28647] python --help: -u is misdocumented as binary mode

2017-05-24 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
pull_requests: +1879

___
Python tracker 

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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread Zachary Ware

Zachary Ware added the comment:


New changeset a2a9984a278d2ee945e91ce13e000e571794fc24 by Zachary Ware in 
branch '3.6':
[3.6] bpo-30160: Clarify intended usage of wfile (gh-1300) (GH-1793)
https://github.com/python/cpython/commit/a2a9984a278d2ee945e91ce13e000e571794fc24


--
nosy: +zach.ware

___
Python tracker 

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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread Zachary Ware

Zachary Ware added the comment:


New changeset aa27f0e94f4d9c5ef589984dc2b32d856e8e038f by Zachary Ware in 
branch '3.5':
[3.5] bpo-30160: Clarify intended usage of wfile (gh-1300) (GH-1792)
https://github.com/python/cpython/commit/aa27f0e94f4d9c5ef589984dc2b32d856e8e038f


--

___
Python tracker 

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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread Zachary Ware

Zachary Ware added the comment:

Backported.  Thanks for the patch, Mike!

--
resolution:  -> fixed
stage: backport needed -> 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



[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-05-24 Thread Mike

Mike added the comment:

My pleasure. And thank you for backporting on my behalf :)

--

___
Python tracker 

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



[issue28647] python --help: -u is misdocumented as binary mode

2017-05-24 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
pull_requests: +1880

___
Python tracker 

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



[issue30445] test_traceback fails in coverage run

2017-05-24 Thread Zachary Ware

New submission from Zachary Ware:


New changeset 3480ef9dd3177be8c0d71a74853dca6e5b11fbe1 by Zachary Ware 
(codedragon) in branch 'master':
 bpo-30445: Allow appended output in RecursionError message
https://github.com/python/cpython/commit/3480ef9dd3177be8c0d71a74853dca6e5b11fbe1


--

___
Python tracker 

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



[issue30445] test_traceback fails in coverage run

2017-05-24 Thread Zachary Ware

Zachary Ware added the comment:

Merged, thanks for the patch!

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



[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

2017-05-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The environ class could have its own lock and then the __iter__ method could be 
rewritten as follows:

def __iter__(self):
with self._lock:
keys = list(self._data)
for key in keys:
yield self.decodekey(key)

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-05-24 Thread Mark Shannon

Mark Shannon added the comment:

If all you need is that

with foo:
   pass

guarantees that either both or neither of __enter__ and __exit__ are called, 
for C context managers, and only C context managers, then the fix is trivial.

To protect Python code would need a custom context manager wrapper

with ProtectsAgainstInterrupt(user_ctx_mngr()):
do_stuff()

ProtectsAgainstInterrupt would need to be implemented in C and install a custom 
signal handler.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-05-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Can you expand on which exceptions you are getting in the feeder thread?

--
nosy: +pitrou

___
Python tracker 

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-05-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue28647] python --help: -u is misdocumented as binary mode

2017-05-24 Thread Armin Rigo

Changes by Armin Rigo :


--
nosy:  -arigo

___
Python tracker 

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-05-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Nevermind, I saw the PR and the test case.

--

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-05-24 Thread Mark Shannon

Mark Shannon added the comment:

Nathaniel,

Do you have any way to reliably test for this failure mode?

--

___
Python tracker 

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



[issue30464] gammavariate has a wrong comment

2017-05-24 Thread Leonardo De Marchi

New submission from Leonardo De Marchi:

The gammavariate function in random.py has a wrong comment.

It says that when alpha is one it's equivalent to call expovariate(1).

We can see that is not true (see graphs) and it should be expovariate(1/beta). 
It's not a big deal but it can cause confusion.

--
files: unnamed.png
messages: 294403
nosy: leodema
priority: normal
severity: normal
status: open
title: gammavariate has a wrong comment
Added file: http://bugs.python.org/file46895/unnamed.png

___
Python tracker 

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



[issue30404] Make stdout and stderr truly unbuffered when using -u option

2017-05-24 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +1881

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-05-24 Thread Nathaniel Smith

Nathaniel Smith added the comment:

> If all you need is that with foo: pass guarantees that either both or neither 
> of __enter__ and __exit__ are called, for C context managers, and only C 
> context managers, then the fix is trivial.

It would be nice to have it for 'async with foo: pass' as well, which is a 
little less trivial because the 'await' dance is inlined into the bytecode (see 
the initial post in this bug), but basically yes.

> Do you have any way to reliably test for this failure mode?

Unfortunately no, I haven't implemented one. Let's see, though...

The test I wrote for issue30039 demonstrates one way to trigger a signal on a 
precise bytecode, by writing some code in C that calls raise(SIGNALNUMBER), and 
then calling it immediately before the bytecode where we want the signal to be 
raised (simulating the situation where the signal happens to arrive while the C 
function is running -- note that raise() is convenient because unlike kill() it 
works cross-platform, even on Windows).

This might be sufficient for testing the 'async with' version; it looks like an 
__await__ method or iterator implemented in C and calling raise() would deliver 
a signal at a point that should be protected but isn't.

The tricky case is plain 'with'. We can write something like:

with lock:
raise_signal()

and this gives bytecode like:

  1   0 LOAD_NAME0 (lock)
  2 SETUP_WITH  12 (to 16)
  4 POP_TOP

  2   6 LOAD_NAME1 (raise_signal)
  8 CALL_FUNCTION0
 10 POP_TOP
 12 POP_BLOCK
 14 LOAD_CONST   0 (None)
>>   16 WITH_CLEANUP_START

So the problem is that at offset 8 is where we can run arbitrary code, but the 
race condition is if a signal arrives between offsets 12 and 16.

One possibility would be to set up a chain of Py_AddPendingCall handlers, 
something like:

int chain1(void* _) {
Py_AddPendingCall(chain2, 0);
return 0;
}
int chain2(void* _) {
Py_AddPendingCall(chain3, 0);
return 0;
}
int chain3(void* _) {
raise(SIGINT);
return 0;
}

(or to reduce brittleness, maybe use the void* to hold an int controlling the 
length of the chain, which would make it easy to run tests with chains of 
length 1, 2, 3, ...)

..except consulting ceval.c I see that currently this won't work, because 
it looks like if you call Py_AddPendingCall from inside a pending call 
callback, then Py_MakePendingCalls will execute the newly added callback 
immediately after the first one returns. It could be made to work by having 
Py_MakePendingCalls do a first pass to check the current length of the queue, 
and then use that as the bound on how many calls it makes.

--

___
Python tracker 

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



[issue29851] Have importlib.reload() raise ModuleNotFoundError when a spec can't be found

2017-05-24 Thread Brett Cannon

Brett Cannon added the comment:


New changeset 94987826e89e8a89c20f081e18be33fc840e6203 by Brett Cannon (Garvit 
Khatri) in branch 'master':
bpo-29851: Have importlib.reload() raise ImportError if the module's spec is 
not found (GH-972)
https://github.com/python/cpython/commit/94987826e89e8a89c20f081e18be33fc840e6203


--

___
Python tracker 

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



[issue29851] Have importlib.reload() raise ModuleNotFoundError when a spec can't be found

2017-05-24 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

2017-05-24 Thread Osvaldo Santana Neto

Osvaldo Santana Neto added the comment:

This patch implements a lock protection (as suggested by Antoine) using 
`_thread.allocate_lock()` module (instead of `threading.Lock()`) due to the 
fact that CPython interpreter already imports `_thread` module during its 
bootstrap process.

--
Added file: 
http://bugs.python.org/file46896/fix_os_environ_iter_issue_low_level_thread_lock.diff

___
Python tracker 

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



  1   2   >