[issue32722] Mislabeling of a dict comprehension as a generator expression in the tutorial

2018-01-31 Thread Xiang Zhang

Xiang Zhang  added the comment:

I treat it as an enhancement so only merge it into 3.8. Thanks Soothsayer for 
the report and Stéphane for the patch!

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



[issue32722] Mislabeling of a dict comprehension as a generator expression in the tutorial

2018-01-31 Thread Xiang Zhang

Xiang Zhang  added the comment:


New changeset ab328756d7fd969ee4882458b07892dff135013c by Xiang Zhang (Stéphane 
Wirtel) in branch 'master':
bpo-32722: Remove useless example in the Classes tutorial (#5446)
https://github.com/python/cpython/commit/ab328756d7fd969ee4882458b07892dff135013c


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-01-31 Thread Yang Yu

New submission from Yang Yu :

https://docs.python.org/3/library/collections.html#collections.deque

rotate() works the same as rotate(1). The documentation did not mention the 
default for n.

--
assignee: docs@python
components: Documentation
messages: 311403
nosy: docs@python, yuy
priority: normal
severity: normal
status: open
title: collections.deque rotate(n=1) default value not documented
type: behavior
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



[issue32738] CDLL : Can't find module

2018-01-31 Thread twinkim2

Change by twinkim2 :


--
title: CDLL : Can't fine module -> CDLL : Can't find module

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Nick Coghlan

Nick Coghlan  added the comment:

A useful heuristic is that if something is named with CapWords, then class-like 
*usage* is explicitly supported (inheritance, isinstance checks, etc).

If it's named with snake_case or wordsruntogether, then calling it is OK, but 
you may run into quirky behaviour in class-style usage (e.g. it may not be a 
class at all in some implementations, or it may not be friendly to subclassing 
even when it is a full class).

So for something like this, snake_case is appropriate - you're meant to just 
use it, not subclass it. The fact that it's a type instance is an 
implementation detail.

(In other cases like contextlib.contextmanager we've made that implementation 
details status completely explicit in the code by having the public API be a 
wrapper function that returns an instance of a private class)

--

___
Python tracker 

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



[issue31368] Add os.preadv() and os.pwritev()

2018-01-31 Thread YoSTEALTH

Change by YoSTEALTH :


--
pull_requests: +5293

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-01-31 Thread Steve Dower

Steve Dower  added the comment:

Nice. Think you can turn that into a pull request on GitHub?

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-01-31 Thread Ma Lin

Ma Lin  added the comment:

Base on Kamil's code, a little improvements.


if hasattr(sys, 'getwindowsversion'):
WIN_MAJOR, _, WIN_BUILD, *_ = sys.getwindowsversion()
if WIN_MAJOR == 10:
if WIN_BUILD >= 15063:# Windows 10 1703
pass
elif WIN_BUILD >= 14393:  # Windows 10 1607
del socket.TCP_KEEPCNT
else:
del socket.TCP_KEEPCNT
del socket.TCP_FASTOPEN
elif WIN_MAJOR < 10:
del socket.TCP_KEEPCNT
del socket.TCP_FASTOPEN


Windows 10 versions:
https://technet.microsoft.com/en-us/windows/release-info.aspx

--
nosy: +Ma Lin

___
Python tracker 

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



[issue32476] Add concat functionality to ElementTree xpath find

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:

Sorry, I think this qualifies as a new feature and thus needs to go in 3.8.  
Plus it should get a wider review from those with ET experience.  Perhaps 
@scoder would be willing go take a look.

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



[issue32738] CDLL : Can't fine module

2018-01-31 Thread twinkim2

New submission from twinkim2 :

I just try to import ./so created by c language.
However , if some c function library is added in c souce code such as "fopen" 
and "sscanf" related with stdio , runtime error is happend like as below.
==
Traceback (most recent call last):  File "D:\python_test\c_library_test.py", 
line 8, in 
adder = CDLL('./_adder.so')
  File 
"C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", 
line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] can't fine Module.
===
Please give your guide to fix this issue.

--
components: ctypes
messages: 311398
nosy: twinkim2
priority: normal
severity: normal
status: open
title: CDLL : Can't fine module
type: behavior
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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread YoSTEALTH

YoSTEALTH  added the comment:

Actually i don't remember the last time where i saw anyone call a function 
using a "with" statement. This is very sloppy, sure PEP8 isn't ironclad but 
this is going to lead to confusion and we might have another case of datetime 
model (where you don't know whats what!!!).

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

YoSTEALTH: I think this is one of those cases where the fact of it being a 
class is incidental; it's used the same as if it were a function, and just 
happens to be implemented as a class (the docs actually describe it in terms of 
a function). PEP8 guidance on CapWords for class names isn't ironclad, 
particularly when being a class is more implementation detail than design goal.

--

___
Python tracker 

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



[issue32737] str.format not producing strings for nan argument in accordance with documentation

2018-01-31 Thread D. Michael Parrish

D. Michael Parrish  added the comment:

Thank you so much for that reply. Maybe with that I can push for an upgrade.

--

___
Python tracker 

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



[issue32737] str.format not producing strings for nan argument in accordance with documentation

2018-01-31 Thread Zachary Ware

Zachary Ware  added the comment:

I think you need to clarify with whoever is restricting your Python version 
which version you can actually use: Python 3.0.1 has been out of support for 
the better part of 10 years now and hardly anybody ever actually used that 
particular version (aside from me :))

I have confirmed that Python 3.6 (the oldest version which would receive a fix 
for this at this point) behaves as expected:

In [1]: '{0:f}'.format(float('nan'))
Out[1]: 'nan'

In [2]: '{0:F}'.format(float('nan'))
Out[2]: 'NAN'

In [3]: '{0:g}'.format(float('nan'))
Out[3]: 'nan'

In [4]: '{0:G}'.format(float('nan'))
Out[4]: 'NAN'

In [5]: '{0:.2f}'.format(float('nan'))
Out[5]: 'nan'

--
nosy: +zach.ware
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32737] str.format not producing strings for nan argument in accordance with documentation

2018-01-31 Thread D. Michael Parrish

New submission from D. Michael Parrish :

>>> version_info
(3, 0, 1, 'final', 0)
# I know this is an older version---stuck with it at work.
# I did not see this issue in the tracker (380 results for nan).
# Perhaps there is better documentation for how to use the issue
# tracker. Many of the links on the Dealing with Bugs page---
# https://docs.python.org/3/bugs.html#contributing-to-python
# ---are not helpful, e.g., 'contribute' just links back the same
# page.
#
# There are similar problems with inf and -inf
>>> isnan(float('nan'))
True
>>> repr(float('nan'))
'nan'
>>> '{0:f}'.format(float('nan'))
'-1.#IND00'
>>> '{0:F}'.format(float('nan'))
'-1.#IND00'
>>> '{0:g}'.format(float('nan'))
'-1.#IND'
>>> '{0:G}'.format(float('nan'))
'-1.#IND'
>>> '{0:.2f}'.format(float('nan'))
'-1.#J'

# c.f. https://docs.python.org/3/library/string.html#formatspec

--
assignee: docs@python
components: Documentation
messages: 311393
nosy: ana, docs@python
priority: normal
severity: normal
status: open
title: str.format not producing strings for nan argument in accordance with 
documentation
type: behavior

___
Python tracker 

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



[issue32734] Asyncio Lock safety issue (unlimited acquire)

2018-01-31 Thread Bar Harel

Bar Harel  added the comment:

Alright. Fixed, added tests, news and acks.
Besides PR5466, we'll need another one for the 3.6 branch.

--

___
Python tracker 

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



[issue32736] random.triangular yields unexpected distribution when args mixed

2018-01-31 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Sorry, while appreciate the sentiment and how well you articulated it, I'm 
going to decline this one for the reasons listed in the original discussion at 
https://bugs.python.org/issue13355 and because it is important to keep this 
code fast and light (so that large numbers of random variates can be created).  
Also, for your own code, it is trivially easy to wrap the existing function 
with your own error checking.  Lastly, the ship for 2.7 sailed many years ago.  

Note, almost note of the random functions can defend themselves are incorrect 
argument order.  And who knows, there may be legitimate use cases for having 
the midpoint not between the low and high.

--
nosy: +rhettinger
resolution:  -> rejected
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



[issue32734] Asyncio Lock safety issue (unlimited acquire)

2018-01-31 Thread Bar Harel

Change by Bar Harel :


--
keywords: +patch
pull_requests: +5292
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



[issue32726] macOS installer and framework enhancements and changes for 3.7.0

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:


New changeset 7fdefac8e8fdca29b329b27e6e50f3b265bd8900 by Ned Deily in branch 
'3.7':
bpo-32726: Build macOS 10.9+ installer with private copy of Tcl/Tk 8.6
https://github.com/python/cpython/commit/7fdefac8e8fdca29b329b27e6e50f3b265bd8900


--

___
Python tracker 

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



[issue32726] macOS installer and framework enhancements and changes for 3.7.0

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:


New changeset 1ca2ffdc532622ef001418585c146e6b0f31027f by Ned Deily in branch 
'master':
bpo-32726: Build macOS 10.9+ installer with private copy of Tcl/Tk 8.6
https://github.com/python/cpython/commit/1ca2ffdc532622ef001418585c146e6b0f31027f


--

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:


New changeset 57750be4ad3fa2cfd3473b5be1f1e1a5d0fa9f50 by Ned Deily (Bernhard 
M. Wiedemann) in branch '3.7':
bpo-30693: zip+tarfile: sort directory listing (#2263)
https://github.com/python/cpython/commit/57750be4ad3fa2cfd3473b5be1f1e1a5d0fa9f50


--

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:


New changeset 86fdad093b863db7ef6a3a00c9cff724c09442e7 by Ned Deily (Xiang 
Zhang) in branch '3.7':
bpo-32583: Fix possible crashing in builtin Unicode decoders (#5325)
https://github.com/python/cpython/commit/86fdad093b863db7ef6a3a00c9cff724c09442e7


--
nosy: +ned.deily

___
Python tracker 

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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:


New changeset 70e304252af34dfde3d89c9a1aa48c0c4af17dd3 by Ned Deily (Cheryl 
Sabella) in branch '3.7':
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
https://github.com/python/cpython/commit/70e304252af34dfde3d89c9a1aa48c0c4af17dd3


--
nosy: +ned.deily

___
Python tracker 

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



[issue32727] smtplib's SMTP.send_message behaves differently with from_addr and to_addrs

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:


New changeset 209108bd6997258948d13f48f2b5a2f1220c1a35 by Ned Deily (Stéphane 
Wirtel) in branch '3.7':
bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and 
to_addrs (#5451)
https://github.com/python/cpython/commit/209108bd6997258948d13f48f2b5a2f1220c1a35


--
nosy: +ned.deily

___
Python tracker 

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



[issue27428] Document WindowsRegistryFinder inherits from MetaPathFinder

2018-01-31 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-01-31 Thread INADA Naoki

INADA Naoki  added the comment:

ML meant mailing list.
There is guide for it.
http://devguide.python.org/communication/

If you really want this new API, you can search previous discussion and post 
new mail with summary of the previous discussion.

--

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-01-31 Thread Elias Zamaria

Elias Zamaria  added the comment:

INADA, what is ML? How do I restart the discussion?

--

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-01-31 Thread INADA Naoki

INADA Naoki  added the comment:

PEP should be accepted before review and merge.
So what you can do is restart discussion on ML again.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread STINNER Victor

STINNER Victor  added the comment:

@Cheryl: I concur with Mariatta, good catch, thanks!

--
nosy: +vstinner

___
Python tracker 

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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread Mariatta Wijaya

Change by Mariatta Wijaya :


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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread Mariatta Wijaya

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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 581ce25e1ffa374e62547ef266b6326bee0c54e5 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464) 
(GH-5465)
https://github.com/python/cpython/commit/581ce25e1ffa374e62547ef266b6326bee0c54e5


--

___
Python tracker 

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



[issue20984] 'Add/Remove Programs' dialog missing entries for 32-bit CPython 'current user only' installations on 64-bit Windows

2018-01-31 Thread Steve Dower

Change by Steve Dower :


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



[issue32730] Allow py launcher to launch other registered Pythons

2018-01-31 Thread Steve Dower

Steve Dower  added the comment:

Yep, this was part of the plan. Just hasn't happened yet (it probably requires 
a significant rewrite of the launcher which nobody has volunteered to do or 
found the time for).

I thought I had another open bug on this too... if someone finds it, feel free 
to dup this one.

--

___
Python tracker 

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



[issue32736] random.triangular yields unexpected distribution when args mixed

2018-01-31 Thread Edward Preble

New submission from Edward Preble :

The random.triangular function produces an unexpected distribution result 
(instead of an error or warning message) when the order of the 3 arguments are 
mixed up.

Python notebook with demo of issue here:
https://github.com/epreble/random_triangular_distribution_issue

Cases 1-4 are OK
1. random.triangular(low, high, mode) (Docs specified usage)
2. random.triangular(high, low, mode)
3. random.triangular(low, high)
4. random.triangular(high, low)

Incorrect argument input (e.g. numpy style) yields distributions that are NOT 
3-value-triangular and the output is also from different ranges than expected:

Incorrect arguments (first one is numpy.random.triangular style)
6. random.triangular(low, mode, high) 
or:
7. random.triangular(high, mode, low)

Raising errors was discouraged in prior discussion 
(https://bugs.python.org/issue13355) due to back compatibility concerns. 
However, I would argue that output of an incorrect distribution without a 
warning is a problem that -should- be broken, even in old code.

A possible solution, that might not break the old code (I haven't looked at all 
the edge cases):

If 3 arguments provided, need to be sure the mode is arg3:
If arg1 < arg2 < arg3, this is definitely wrong since the mode is definitely in 
the middle (wrong position).
If arg1 > arg2 > arg3, this is definitely wrong since the mode is definitely in 
the middle (wrong position).

Those tests would not break the old use cases, since the signs of the tests 
switch between arg1/arg2/arg3:
  low, high, mode (would be arg1 < arg2 > arg3)
  high, low, mode (would be arg1 > arg2 < arg3)

Not positive how all the <=, >= combos work out with these tests.

--
components: Library (Lib)
messages: 311377
nosy: eddieprebs
priority: normal
severity: normal
status: open
title: random.triangular yields unexpected distribution when args mixed
type: behavior
versions: Python 2.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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset b299393cc372f3ecbef4304f8eaa4c7838e975ca by Mariatta (Cheryl 
Sabella) in branch 'master':
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
https://github.com/python/cpython/commit/b299393cc372f3ecbef4304f8eaa4c7838e975ca


--

___
Python tracker 

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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5291

___
Python tracker 

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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Good catch!

I checked my presentation slides (where this example comes from).
It appeared that I meant it as %b, so the output should have been `Jan` instead 
of `January`.

But no strong preference, the idea is to demonstrate how to use the specifier, 
so %B works too.

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



[issue32727] smtplib's SMTP.send_message behaves differently with from_addr and to_addrs

2018-01-31 Thread R. David Murray

R. David Murray  added the comment:

Thanks, Stéphane.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue32689] shutil.move raises AttributeError if first argument is a pathlib.Path object and destination is a directory

2018-01-31 Thread Emily Morehouse

Emily Morehouse  added the comment:

Ah, you're right. That was a typo when I was redacting my full path. The path 
object remains unchanged even though the directory has moved. 

Should have been:

>>> import os, pathlib, shutil
>>> os.mkdir('test1')
>>> os.mkdir('test2')
>>> path = pathlib.Path('test1')
>>> path.absolute()
PosixPath('/Users/e/Development/OSS/cpython/test1')
>>> shutil.move(path, 'test2')
'test2/test1'
>>> path.absolute()
PosixPath('/Users/e/Development/OSS/cpython/test1')

test1 is now actually at '/Users/e/Development/OSS/cpython/test2/test1'

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread YoSTEALTH

YoSTEALTH  added the comment:

ps, maybe a better name "DisabledZone" ?

--

___
Python tracker 

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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +5290
stage:  -> patch review

___
Python tracker 

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



[issue32735] Typo in f-string example in docs

2018-01-31 Thread Cheryl Sabella

New submission from Cheryl Sabella :

On the lexical analysis doc page, in f-strings example, the following example 
isn't quite right:

>>> f"{today:%b %d, %Y}"  # using date format specifier
'January 27, 2017'

Submitting a patch shortly to use %B instead of %b.

--
assignee: docs@python
components: Documentation
messages: 311371
nosy: csabella, docs@python
priority: normal
severity: normal
status: open
title: Typo in f-string example in docs
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



[issue32727] smtplib's SMTP.send_message behaves differently with from_addr and to_addrs

2018-01-31 Thread R. David Murray

R. David Murray  added the comment:


New changeset 85a92d00bd278022cc00fda6b124c06f614c5ebb by R. David Murray (Miss 
Islington (bot)) in branch '3.6':
bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and 
to_addrs (GH-5451) (#5455)
https://github.com/python/cpython/commit/85a92d00bd278022cc00fda6b124c06f614c5ebb


--

___
Python tracker 

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



[issue32733] test_coroutines is failed when run with -We

2018-01-31 Thread Yury Selivanov

Yury Selivanov  added the comment:

Or to use assertWarnsRegex

--

___
Python tracker 

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



[issue32733] test_coroutines is failed when run with -We

2018-01-31 Thread Yury Selivanov

Yury Selivanov  added the comment:

I think assertWarns just handles it. Maybe the test should be converted to use 
it?

--

___
Python tracker 

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



[issue32733] test_coroutines is failed when run with -We

2018-01-31 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Ok, yeah, that's a test that a warning is emitted, which fails when the warning 
is converted into an error instead. Need to normalize the warnings filter 
settings inside that test, I guess.

How does this not cause the same problem for every other test that uses 
assertWarns though?

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread YoSTEALTH

YoSTEALTH  added the comment:

Since "ensure_disabled" is a class 
https://docs.python.org/3.7/library/gc.html#gc.ensure_disabled it should be 
"EnsureDisabled" according to 
https://www.python.org/dev/peps/pep-0008/#class-names

--
nosy: +YoSTEALTH

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-01-31 Thread Elias Zamaria

Elias Zamaria  added the comment:

What else needs to be done with this issue? Can someone merge my pull request?

--

___
Python tracker 

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



[issue18876] Problems with files opened in append mode with io module

2018-01-31 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I believe Erik opened #20082 for the BufferedWriter bug, so I think this issue 
can be closed as Resolved?

--
nosy: +csabella

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:

> Agree that this is invisible enough that no release note is warranted.

OK

> Can I go ahead and do a reversion on the master branch or I should I wait a 
> day or so?

Please hold off for the moment until the 3.7 branch is announced.  It will make 
life easier for me.  Thanks!

--

___
Python tracker 

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



[issue32734] Asyncio Lock safety issue (unlimited acquire)

2018-01-31 Thread Yury Selivanov

Change by Yury Selivanov :


--
priority: normal -> high
stage:  -> needs patch
type: security -> behavior
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Agree that this is invisible enough that no release note is warranted.

Can I go ahead and do a reversion on the master branch or I should I wait a day 
or so?

--
assignee: lisroach -> rhettinger

___
Python tracker 

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



[issue32734] Asyncio Lock safety issue (unlimited acquire)

2018-01-31 Thread Bar Harel

New submission from Bar Harel :

Hey guys,

I found a pretty dangerous bug that allows acquiring locks in asyncio without 
them being free.

This happens due to double release (calling _wake_up_first) from both release 
and acquire in case of cancellation.

The example I've uploaded exploits it by acquiring 4 times, which grooms the 
loop's _ready queue, cancelling the second acquire to add the cancellation to 
the _ready queue, and releasing once to add the next waiter (number 3) to the 
_ready queue. Next event loop step causes the cancellation to run first, 
skipping the queued waiter (due to .done check being true) and waking the next 
waiter in line (number 4). Then both number 3 and number 4 run together on the 
same Lock.

I'm not at home so it's hard for me to code but the simple way of fixing it is 
by adding this line - "if self._locked: yield from self.acquire()" after the 
"yield from fut" (quite minimal overhead and only if bug happens, so no harm) 
or by slightly restructuring the code and the checks regarding cancelled 
futures.

I can later on post the restructured code but I think the simple if statement 
is a pretty fine and efficient fix.

--
components: asyncio
files: bug.py
messages: 311361
nosy: asvetlov, bar.harel, yselivanov
priority: normal
severity: normal
status: open
title: Asyncio Lock safety issue (unlimited acquire)
type: security
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47419/bug.py

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Ned Deily

Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg311359

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:

(If anyone downstream is having problems with test aborts, a workaround until 
b2 is to simply skip test_gc by adding -x test_gc, like:

python3.7 -m test -We -x test_gc

)

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:

(If anyone downstream is having problems with test aborts, a workaround until 
b2 is to simply skip test_gc by adding -x test_gc, like:

python3.7 -m test -We -x test_gc".
)

--

___
Python tracker 

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



[issue32731] getpass.getuser() raises an unspecified exceptions (ImportError, OSError, etc)

2018-01-31 Thread Yaron de Leeuw

Yaron de Leeuw  added the comment:

What kind of exception did you have in mind? As the 'someone' you mentioned, I 
can contribute this.

btw, os.getuid() on windows raises an attribute error, so we need to check that 
too.

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:

OK, it sounds like we have enough of a consensus to remove it for 3.7.0b2.  
Unfortunately, 3.7.0b1 is already finished.  We are not going to do an 
emergency brown bag b2 just for this.  We could add a warning note to the 
release notice that is about to got out but OTOH the feature isn't very visible 
and the documentation for it will disappear from the docs web site once the 
revert is made (and please wait for the imminent announcement of the 3.7 branch 
to do that).

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I also think this should be reverted if that is still possible.  I didn't put 
in sufficient review effort at the outset.  No need to publish embarrassing 
code, especially for such a minor feature.

--

___
Python tracker 

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



[issue32733] test_coroutines is failed when run with -We

2018-01-31 Thread Yury Selivanov

Yury Selivanov  added the comment:

Nathaniel, this seems to be related to coro-origin-tracking.

--
nosy: +njs

___
Python tracker 

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



[issue32732] LoggingAdapter ignores extra kwargs of Logger#log()

2018-01-31 Thread Cyril Martin

New submission from Cyril Martin :

- LoggerAdapter processes only extra kwargs given during its __init__
So extra kwargs, given to Logger#log are ignored when we configure a 
LoggerAdapter (same for: debug, info, warning etc).
- I expect extras are merged. More precisely, I expect local extra override the 
ones given in __init__

--
components: Library (Lib)
messages: 311353
nosy: mcoolive
priority: normal
pull_requests: 5289
severity: normal
status: open
title: LoggingAdapter ignores extra kwargs of Logger#log()
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



[issue32733] test_coroutines is failed when run with -We

2018-01-31 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

$ ./python -We -m test test_coroutines
Run tests sequentially
0:00:00 load avg: 0.29 [1/1] test_coroutines
Exception ignored in: .corofn at 
0x7fc5fc692cb8>
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/warnings.py", line 511, in 
_warn_unawaited_coroutine
warn(msg, category=RuntimeWarning, stacklevel=2, source=coro)
RuntimeWarning: coroutine 
'OriginTrackingTest.test_origin_tracking_warning..corofn' was never 
awaited
test test_coroutines failed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_coroutines.py", line 2167, in 
test_origin_tracking_warning
msg = check(0, f"coroutine '{corofn.__qualname__}' was never awaited")
  File "/home/serhiy/py/cpython/Lib/test/test_coroutines.py", line 2161, in 
check
self.assertTrue(len(wlist) == 1)
AssertionError: False is not true

test_coroutines failed

1 test failed:
test_coroutines

Total duration: 371 ms
Tests result: FAILURE

This isn't release blocker, because the test is failed, not crashed, and seems 
this is just a test issue.

--
components: Tests
messages: 311354
nosy: serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: test_coroutines is failed when run with -We
type: behavior
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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Yury Selivanov

Yury Selivanov  added the comment:

> But, more importantly, this is a new feature so it doesn't break any existing 
> code.

I imagine you're almost done with the beta-1 release, Ned, so I'd hate to 
create more work for you here.  Let's release beta-1 as is.

> and in that time we need to decide what the proper actions for 3.7 (fix, 
> reimplement, remove) and for 3.8.

I have a different opinion on this though.  The committed PR is 
**fundamentally** broken (releases GIL for Python code, refleaks, SIGABRT, 
nonsensical test) and the feature itself is very questionable.  As soon as 3.7 
branch appears, I'll revert the commit from 3.7 and from master.

If we want this feature to be kept in 3.7beta2, someone should write a **new** 
patch from scratch.  But I strongly suggest to first discuss it on python-dev, 
because as is, not only the commit is broken, the proposed API is broken too 
from my standpoint.

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Ned Deily

Ned Deily  added the comment:

> 2. The merged PR crashes on debug build of CPython.

Actually, for me, it only crashes on a debug build when using -We with tests, 
an option I don't normally use, otherwise, I would have noticed it before.  
And, as noted, few downstream users use debug builds.

But, more importantly, this is a new feature so it doesn't break any existing 
code.  If that is the case, I think we don't need to expedite a release; it can 
wait four weeks for 3.7.0b2 and in that time we need to decide what the proper 
actions for 3.7 (fix, reimplement, remove) and for 3.8.

Please chime in now if you strongly disagree.  In any case, thanks all for your 
efforts on this!

--

___
Python tracker 

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



[issue32731] getpass.getuser() raises an unspecified exceptions (ImportError, OSError, etc)

2018-01-31 Thread Yaron de Leeuw

Change by Yaron de Leeuw :


--
nosy: +jarondl

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I concur with Yury.

--

___
Python tracker 

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



[issue32731] getpass.getuser() raises an unspecified exceptions (ImportError, OSError, etc)

2018-01-31 Thread Gregory P. Smith

New submission from Gregory P. Smith :

This has been true since Python 1.x.  getpass.getuser() is documented as 
"raising an exception" but doesn't specify what exception.

On Windows when the environment variables it looks at are not set, an 
ImportError (!) escapes due to "import pwd" failing.  It could just a easily 
allow an exception from the following pwd.getpwuid(os.getuid())[0] call to 
escape on systems when pwd exists.

None of these are actually helpful to the caller as they are left having to 
catch a bare Exception around a getpass.getuser() call to take another course 
of action.  I filed this as I just saw someone suggesting code that 
specifically catches ImportError on getpass.getuser().

It is too late to change the exception type coming out in 2.7 or 3.6, but 
cleaning up this underspecified behavior to be a meaningful exception for 3.7 
seems reasonable.

--
components: Library (Lib)
messages: 311349
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: getpass.getuser() raises an unspecified exceptions (ImportError, 
OSError, etc)
type: behavior
versions: Python 2.7, 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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Yury Selivanov

Yury Selivanov  added the comment:

A few thoughts:

1. The merged PR releases GIL for any Python code run in `with 
gc.ensure_disabled()`.  This is just plain wrong.

2. The merged PR crashes on debug build of CPython.

3. I don't actually understand this feature.  Our GC is not per OS thread, 
which means that inside `with gc.ensure_disabled()` the GC can become suddenly 
**enabled**, if another thread enables it.  This API is just misleading (maybe 
the name of the new context manager is bad—it cannot ensure anything).  There's 
even a unittest that tests this!

4. This new API can be trivially implemented in pure Python:

   @contextmanager
   def disable_gc():
   gc.disable()
   try:
   yield
   finally:
   gc.enable()

5. While such pure Python version shares the problem discussed in (3), the 
currently committed C implementation doesn't fix them either.

IMO this entire issue needs to be properly debated on python-ideas first and 
the PR should be reverted from beta-1.  If the latter is not possible, OK, 
let's revert it for beta-2 and for 3.8.

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I don't understand why PyGILState_Ensure() and PyGILState_Release() are used at 
all. I think it is better to revert PR 4224 until we understood this code.

Currently the code contains a bug which leads to a crash in some circumstances. 
Since several third-party projects try to support warning-free code, this can 
prevent running tests with 3.7.

--

___
Python tracker 

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



[issue32689] shutil.move raises AttributeError if first argument is a pathlib.Path object and destination is a directory

2018-01-31 Thread Chih-Hsuan Yen

Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue25988] collections.abc.Indexable

2018-01-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset c66f9f8d3909f588c251957d499599a1680e2320 by Serhiy Storchaka in 
branch 'master':
bpo-25988: Emit a warning when use or import ABCs from 'collections'. (#5460)
https://github.com/python/cpython/commit/c66f9f8d3909f588c251957d499599a1680e2320


--

___
Python tracker 

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



[issue29780] Interpreter hang on self._epoll.poll(timeout, max_ev)

2018-01-31 Thread Niko Fink

Niko Fink  added the comment:

I recently had a similar issue, a MWE can be found here (and also attached):
https://gist.github.com/N-Coder/89b1be8e5cfb83b1b03ade8485676982
As soon as `loop.stop` in loop_stop_problem.py:44 is called in a non-threadsafe 
way from another thread, i.e. without loop.call_soon_threadsafe, the loop seems 
to hang in `self._epoll.poll(timeout, max_ev)`.
This can be seen when comparing the two outputs in threadunsafe_loop_stop.log 
(without loop.call_soon_threadsafe) and call_soon_threadsafe_loop_stop.log 
(with loop.call_soon_threadsafe). Please note the time difference after 
"Waiting for loop join".
The loop seems to hang until the (seemingly random) epoll timeout occurs, or 
the next pending events needs to be processed (which might take quite some 
time).

There is also no explicit note about this behavior in the doc of the function 
(https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.AbstractEventLoop.stop),
 only a small note in the doc of AbstractEventLoop, informing you about the 
non-thread-safety of the whole class.
Also, other methods like `call_at` use `BaseEventLoop._check_thread` 
(https://github.com/python/cpython/blob/3.6/Lib/asyncio/base_events.py#L549) to 
check for violations when running in debug mode. Unfortunately, `stop` doesn't 
make those checks.
All this together makes this bug very hard to find.

So, i'd vote for adding a short `if self._debug: self._check_thread()` to the 
`stop` method.

--
nosy: +NCode
Added file: https://bugs.python.org/file47418/loop_stop_problem.zip

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Yury Selivanov

Yury Selivanov  added the comment:

> The style issues and missing error checks are easy to address.  We're at 
> 3.7beta1 stage, it is normal to have issues to be cleaned up in a beta 
> release.


I don't understand the code. Please take a look in my PR.

--

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-31 Thread Xavier G. Domingo

Change by Xavier G. Domingo :


--
nosy: +xgdomingo

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I would not remove this.  It is a new feature, leave it in for 3.7.

The style issues and missing error checks are easy to address.  We're at 
3.7beta1 stage, it is normal to have issues to be cleaned up in a beta release.

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Yury Selivanov

Yury Selivanov  added the comment:

IMO this needs to be pulled from 3.7.  Ned?

--

___
Python tracker 

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



[issue25988] collections.abc.Indexable

2018-01-31 Thread Guido van Rossum

Guido van Rossum  added the comment:

Good idea, Victor, and thanks for the PR, Serhiy!

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Yury Selivanov

Yury Selivanov  added the comment:

Just noting here: the original PR was a little bit under-reviewed: return 
values of C functions were not checked, and the code style was very far from 
PEP 7.

--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5288

___
Python tracker 

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



[issue32072] Issues with binary plists

2018-01-31 Thread Larry Hastings

Larry Hastings  added the comment:

Thank you for the fix!  I just wish I knew what plists were ;-)

--

___
Python tracker 

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



[issue32730] Allow py launcher to launch other registered Pythons

2018-01-31 Thread Peter Suter

New submission from Peter Suter :

For example Anaconda Python is registered under 
HKEY_LOCAL_MACHINE\Software\Python\ContinuumAnalytics\Anaconda36-64\ as 
described in PEP 514 "Python registration in the Windows registry" .

The py launcher from PEP 397 however ignores that and only considers 
HKEY_LOCAL_MACHINE\Software\Python\PythonCore\ registrations.

There seems to be no mechanism to register Anaconda Python with the py 
launcher. Anaconda considers this a bug in the Python launcher. 
https://github.com/ContinuumIO/anaconda-issues/issues/149#issuecomment-361922640

Shouldn't this be possible? Maybe via py.ini [defaults]?

--
components: Windows
messages: 311338
nosy: paul.moore, petsu...@gmail.com, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Allow py launcher to launch other registered Pythons
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, 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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Actually raising an exception in PyErr_WarnEx() is not an error, but a standard 
behavior with corresponding configuration.

For now running tests with -We in debug build crashes.

$ ./python -We -m test test_gc
Run tests sequentially
0:00:00 load avg: 0.33 [1/1] test_gc
Fatal Python error: a function returned a result with an error set
RuntimeWarning: Garbage collector enabled while another thread is inside 
gc.ensure_enabled

The above exception was the direct cause of the following exception:

SystemError:  returned a result with an error set

Thread 0x7fb1b1773700 (most recent call first):
  File "/home/serhiy/py/cpython/Lib/test/test_gc.py", line 1050 in 
disabling_thread
  File "/home/serhiy/py/cpython/Lib/threading.py", line 865 in run
  File "/home/serhiy/py/cpython/Lib/threading.py", line 917 in _bootstrap_inner
  File "/home/serhiy/py/cpython/Lib/threading.py", line 885 in _bootstrap

Current thread 0x7fb1b824f040 (most recent call first):
  File "/home/serhiy/py/cpython/Lib/test/test_gc.py", line 1061 in 
test_ensure_disabled_thread
  File "/home/serhiy/py/cpython/Lib/test/support/__init__.py", line 2083 in 
decorator
  File "/home/serhiy/py/cpython/Lib/unittest/case.py", line 615 in run
  File "/home/serhiy/py/cpython/Lib/unittest/case.py", line 663 in __call__
  File "/home/serhiy/py/cpython/Lib/unittest/suite.py", line 122 in run
  File "/home/serhiy/py/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/home/serhiy/py/cpython/Lib/unittest/suite.py", line 122 in run
  File "/home/serhiy/py/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/home/serhiy/py/cpython/Lib/test/support/__init__.py", line 1760 in run
  File "/home/serhiy/py/cpython/Lib/test/support/__init__.py", line 1861 in 
_run_suite
  File "/home/serhiy/py/cpython/Lib/test/support/__init__.py", line 1951 in 
run_unittest
  File "/home/serhiy/py/cpython/Lib/test/test_gc.py", line 1088 in test_main
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/runtest.py", line 176 in 
runtest_inner
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/runtest.py", line 140 in 
runtest
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/main.py", line 379 in 
run_tests_sequential
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/main.py", line 458 in 
run_tests
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/main.py", line 536 in _main
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/main.py", line 510 in main
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/main.py", line 585 in main
  File "/home/serhiy/py/cpython/Lib/test/__main__.py", line 2 in 
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 85 in _run_code
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 193 in _run_module_as_main
Aborted (core dumped)

--
nosy: +ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue32072] Issues with binary plists

2018-01-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thanks Larry.

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



[issue25988] collections.abc.Indexable

2018-01-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Can't we use the new shiny PEP 562 here to actually emit a warning when 
> collections.Iterable is used instead of collections.abc.Iterable?

PR 5460 implements this.

It exposes issues in third-party packages. urllib3 and pyparsing directly use 
or import ABCs from 'collections'. request and pip are indirectly affected. If 
not add these warnings in 3.7 we can break the world in 3.8.

--

___
Python tracker 

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



[issue25988] collections.abc.Indexable

2018-01-31 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +5287

___
Python tracker 

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



[issue32723] codecs.open silently ignores argument errors

2018-01-31 Thread Xiang Zhang

Xiang Zhang  added the comment:

Honestly speaking I am not interested in Python3. I think codecs.open will be 
deprecated one day in Python3 and Victor has raised it long ago. See #8796.

And in Python2, codecs.open is still in use. errors could still function when 
you are writing, encoding, just as the example I give. So now if encoding is 
not given, the builtin open is used, no matter errors is given or not. Is it 
reasonable to change the logic to either encoding or errors is given, we don't 
use the builtin open but the StreamReaderWriter wrapper?

--

___
Python tracker 

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



[issue32729] socket error handling needed

2018-01-31 Thread yang

yang  added the comment:

In the lib/socket.py 

Inside of readinto function, 576 line 
needed None type check or something

--

___
Python tracker 

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



[issue32729] socket error handling needed

2018-01-31 Thread yang

Change by yang :


--
keywords: +patch
pull_requests: +5286
stage:  -> patch review

___
Python tracker 

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



[issue32729] socket error handling needed

2018-01-31 Thread yang

yang  added the comment:

If socket error occurred I think it is a timeout error or something. but It's 
not error raising correctly but IndexError which is not correct error MSG.

It will be fixed or None type check needed.

--
resolution:  -> fixed

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-01-31 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

@lisroach A possible test for this is repeat `test_ensure_disabled_thread` with 
warnings as errors:

```python
warnings.filterwarnings('error')
```

and then checking for a `RuntimeWarning` exception instead of the warning. I 
think this will work because without the changes in this PR, this proposed test 
will produce this error:

```python

==
ERROR: test_ensure_disabled_thread (Lib.test.test_gc.GCTogglingTests)
--
RuntimeWarning: Garbage collector enabled while another thread is inside 
gc.ensure_enabled

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/pgalindo3/cpython/Lib/test/support/__init__.py", line 2083, in 
decorator
return func(*args)
  File "/home/pgalindo3/cpython/Lib/test/test_gc.py", line 1063, in 
test_ensure_disabled_thread
inside_status_after_thread = gc.isenabled()
SystemError:  returned a result with an error se

```

Another posible test is checking that SystemError is not raised / in stderr.

--

___
Python tracker 

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



[issue29209] Remove old-deprecated ElementTree features

2018-01-31 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Serhiy,

Did you want to revive this for 3.8?

--
nosy: +csabella

___
Python tracker 

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



[issue15795] Zipfile.extractall does not preserve file permissions

2018-01-31 Thread ABR

Change by ABR :


--
nosy:  -arobert

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-31 Thread Xiang Zhang

Change 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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-31 Thread Xiang Zhang

Xiang Zhang  added the comment:


New changeset ea94fce6960d90fffeeda131e31024617912d231 by Xiang Zhang in branch 
'3.6':
[3.6] bpo-32583: Fix possible crashing in builtin Unicode decoders (GH-5325) 
(#5459)
https://github.com/python/cpython/commit/ea94fce6960d90fffeeda131e31024617912d231


--

___
Python tracker 

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



[issue15795] Zipfile.extractall does not preserve file permissions

2018-01-31 Thread Étienne Dupuis

Étienne Dupuis  added the comment:

A workaround is provided here: 
https://stackoverflow.com/questions/39296101/python-zipfile-removes-execute-permissions-from-binaries

--
nosy: +Étienne Dupuis

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-31 Thread Xiang Zhang

Change by Xiang Zhang :


--
pull_requests: +5285

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-31 Thread Xiang Zhang

Xiang Zhang  added the comment:


New changeset 2c7fd46e11333ef5e5cce34212f7d087694f3658 by Xiang Zhang in branch 
'master':
bpo-32583: Fix possible crashing in builtin Unicode decoders (#5325)
https://github.com/python/cpython/commit/2c7fd46e11333ef5e5cce34212f7d087694f3658


--

___
Python tracker 

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



[issue20984] 'Add/Remove Programs' dialog missing entries for 32-bit CPython 'current user only' installations on 64-bit Windows

2018-01-31 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Based on Steve's last comment on this issue, should this be closed as 'Out of 
Date'?

--
nosy: +csabella

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-01-31 Thread Bernhard M. Wiedemann

Bernhard M. Wiedemann  added the comment:

@Serhiy IMHO, just because we fix one problem, we do not have to fix all other 
problems at the same time. You can still open a pull-request for the others, 
but I know too little about those to test them.
And having commits pending for 7 months is not exactly energizing either.

For my use-case I just needed a trivial 1 line fix in tarfile.py and already 
ended up with a diffstat of
 7 files changed, 39 insertions(+), 6 deletions(-)

--

___
Python tracker 

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



  1   2   >