[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-14 Thread Ned Deily

Change by Ned Deily :


--
pull_requests: +5876

___
Python tracker 

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



[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-14 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the fix, Nathan.  Yury has already committed the fix for 3.6.5 and 
for 3.7.0.  I've just pushed PR 6112 and PR 6113 to forward port to the master 
branch (for 3.8) and to re-enable the failing tests on 3.7 and master.  Once 
they are merged, I think we can close this.

--
priority: release blocker -> 
versions: +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



[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-14 Thread Nathan Henrie

Nathan Henrie  added the comment:

Awesome, I'm really excited to have contributed something, no matter how small.

--

___
Python tracker 

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



[issue32987] tokenize.py parses unicode identifiers incorrectly

2018-03-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This issue and issue12486 doesn't have any common except that both are related 
to the tokenize module.

There are two bugs: a too narrow definition of \w in the re module (see  
issue12731 and issue1693050) and a too narrow definition of Name in the 
tokenize module.


>>> allchars = list(map(chr, range(0x11)))
>>> start = [c for c in allchars if c.isidentifier()]
>>> cont = [c for c in allchars if ('a'+c).isidentifier()]
>>> import re, regex, unicodedata

>>> for c in regex.findall(r'\W', ''.join(start)): print('%r  U+%04X  %s' % (c, 
>>> ord(c), unicodedata.name(c, '?')))
... 
'℘'  U+2118  SCRIPT CAPITAL P
'℮'  U+212E  ESTIMATED SYMBOL
>>> for c in regex.findall(r'\W', ''.join(cont)): print('%r  U+%04X  %s' % (c, 
>>> ord(c), unicodedata.name(c, '?')))
... 
'·'  U+00B7  MIDDLE DOT
'·'  U+0387  GREEK ANO TELEIA
'፩'  U+1369  ETHIOPIC DIGIT ONE
'፪'  U+136A  ETHIOPIC DIGIT TWO
'፫'  U+136B  ETHIOPIC DIGIT THREE
'፬'  U+136C  ETHIOPIC DIGIT FOUR
'፭'  U+136D  ETHIOPIC DIGIT FIVE
'፮'  U+136E  ETHIOPIC DIGIT SIX
'፯'  U+136F  ETHIOPIC DIGIT SEVEN
'፰'  U+1370  ETHIOPIC DIGIT EIGHT
'፱'  U+1371  ETHIOPIC DIGIT NINE
'᧚'  U+19DA  NEW TAI LUE THAM DIGIT ONE
'℘'  U+2118  SCRIPT CAPITAL P
'℮'  U+212E  ESTIMATED SYMBOL
>>> for c in re.findall(r'\W', ''.join(start)): print('%r  U+%04X  %s' % (c, 
>>> ord(c), unicodedata.name(c, '?')))
... 
'ᢅ'  U+1885  MONGOLIAN LETTER ALI GALI BALUDA
'ᢆ'  U+1886  MONGOLIAN LETTER ALI GALI THREE BALUDA
'℘'  U+2118  SCRIPT CAPITAL P
'℮'  U+212E  ESTIMATED SYMBOL
>>> for c in re.findall(r'\W', ''.join(cont)): print('%r  U+%04X  %s' % (c, 
>>> ord(c), unicodedata.name(c, '?')))
... 
'·'  U+00B7  MIDDLE DOT
'̀'  U+0300  COMBINING GRAVE ACCENT
'́'  U+0301  COMBINING ACUTE ACCENT
'̂'  U+0302  COMBINING CIRCUMFLEX ACCENT
'̃'  U+0303  COMBINING TILDE
...
[total 2177 characters]

The second bug can be solved by adding 14 more characters in the pattern for 
Name.

Name = r'[\w\xb7\u0387\u1369-\u1371\u19da\u2118\u212e]+'

or

Name = r'[\w\u2118\u212e][\w\xb7\u0387\u1369-\u1371\u19da\u2118\u212e]*'

But first the issue with \w should be resolved (if we don't want to add 2177 
characters).

The other solution is implementing property support in re (issue12734).

--

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

https://github.com/python/cpython/commit/b4d1e1f7c1af6ae33f0e371576c8bcafedb099db
 (the first attempted fix for bpo-20891) is the last commit where the draft 
test case patch applies cleanly.

That still segfaults, so I'll jump all the way back to 3.7.0a1, rework the 
patch to apply there, and see if pre-init use of these APIs were still working 
back then.

--

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

After reworking the patch to backport the pre-initialization embedding tests to 
3.7.0a1, they *both* failed, as that was before Victor fixed Py_DecodeLocale to 
work prior to initialization again.

As a result, I tried 
https://github.com/python/cpython/commit/43605e6bfa8d49612df4a38460d063d6ba781906
 in November, after the initial merge of the PEP 432 working branch, but just 
before the start of Victor's follow on refactoring to really take advantage of 
the new internal structures: double failure there as well.

https://github.com/python/cpython/commit/f5ea83f4864232fecc042ff0d1c2401807b19280
 is the next point I checked (just before Eric's September changes to global 
state management), and it looks like we have a new chief suspect, as applying 
the attached "earlier-tree" version of the patch at this point in the history 
gives two passing test cases :)

Next I'll work out a git bisect run based on those two start and end commits 
and the "earlier-tree" patch, and attempt to narrow the failure down to a 
specific commit (probably tomorrow).


(Even without that bisect run though, the warnoptions changes in 
https://github.com/python/cpython/commit/2ebc5ce42a8a9e047e790aefbf9a94811569b2b6#diff-f38879f4833a6b6847e556b9a07bf4ed
 are now looking *very* suspicious)

--
Added file: 
https://bugs.python.org/file47485/bpo-33042-earlier-tree-test-case.diff

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-14 Thread STINNER Victor

STINNER Victor  added the comment:

I suggest to revert my changes on PySys_AddWarnOption*() and "just" re-use the 
code from Python 3.6.

Previously, I made the code more complex since I had to expose a private 
function to add manually warning options. But later, the code changed again, so 
the private function is gone.

--

___
Python tracker 

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



[issue27984] singledispatch register should typecheck its argument

2018-03-14 Thread Xiang Zhang

Xiang Zhang  added the comment:

Revising the patch, register() is fixed by feature in #32227. So I will only 
fix dispatch() in 3.7 and 3.8, the whole patch to 3.6.

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



[issue27984] singledispatch register should typecheck its argument

2018-03-14 Thread Xiang Zhang

Change by Xiang Zhang :


--
pull_requests: +5877

___
Python tracker 

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



[issue27984] singledispatch register should typecheck its argument

2018-03-14 Thread Xiang Zhang

Change by Xiang Zhang :


--
pull_requests: +5878

___
Python tracker 

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



[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Vlad Shcherbina

New submission from Vlad Shcherbina :

from typing import *

def f(arg: str = None):
pass
print(get_type_hints(f))

# {'arg': typing.Union[str, NoneType]}
# as expected


class T(NamedTuple):
field: str = None
print(get_type_hints(T))

# {'field': }
# but it should be
# {'field': typing.Union[str, NoneType]}
# for consistency

--
components: Library (Lib)
messages: 313819
nosy: vlad
priority: normal
severity: normal
status: open
title: typing.NamedTuple does not deduce Optional[] from using None as default 
field value
type: behavior
versions: 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



[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Vlad Shcherbina

Vlad Shcherbina  added the comment:

If the maintainers agree that it's desirable to automatically deduce 
optionality, I'll implement it.

--

___
Python tracker 

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




[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Thanks for the report and pull request. Do you happen to know if setuptools is 
also affected?

If yes, the problem will need to be reported & fixed there as well (otherwise 
the maintainer metadata will still be missing for many publishers), if no, then 
using it instead of plain distutils is a potential workaround in advance of the 
distutils fix rolling it.

--

___
Python tracker 

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



[issue5441] Convenience API for timeit.main

2018-03-14 Thread Jeremy Metz

Jeremy Metz  added the comment:

Don't understand how #6422 addresses this - would also like to see a more 
convenient API for timing; at present CLI gives a nice formatted output, and 
timeit.timeit gives just the raw timing in seconds. 

Would be easy to implement by simply refactoring main() in to the command line 
parsing component (first ~ 50 lines from 
https://github.com/python/cpython/blob/master/Lib/timeit.py#L256 to 
~https://github.com/python/cpython/blob/master/Lib/timeit.py#L312 ) and actual 
timing and printing component, which could then be called via API. 

Am happy to work this up if this can be reopened...?

--
nosy: +Jeremy Metz

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

While I haven't definitely narrowed it down yet, I suspect it isn't your 
changes that are the problem: since the reported crash relates to attempting to 
access a not-yet-created thread state, `warnoptions` and `_xoptions` likely 
need to become C level globals again for 3.7 (along with anything needed to 
create list and Unicode objects).

We can then transfer them from there into Eric's new runtime state objects in 
_PyRuntime_Initialize (or potentially _Py_InitializeCore).

--

___
Python tracker 

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



[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-14 Thread Paul Ganssle

Paul Ganssle  added the comment:

@ncoghlan Yes, setuptools is affected. I've reported it there as well: 
https://github.com/pypa/setuptools/issues/1288

I have patches for both distutils and setuptools prepared. The distutils patch 
is more controversial because this is apparently the documented behavior of PEP 
314's Metadata Version 1.1, and distutils doesn't really have support for any 
of the *other* features of Version 1.2. You can see the concern (mostly on my 
side, frankly) on the PR, GH PR #6106.

--

___
Python tracker 

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



[issue5441] Convenience API for timeit.main

2018-03-14 Thread Jeremy Metz

Jeremy Metz  added the comment:

More specifically, #6422 also mentions at least in part this functionality, but 
the main focus there seems to be the autorange function. 

Propose splitting these two by reopening this use.

--

___
Python tracker 

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



[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-14 Thread Éric Araujo

Éric Araujo  added the comment:

I think that the proposed change is a good thing in itself, but if distutils 
only supports metadata 1.1 then it should comply with that spec.

I expect most projects to be using setuptools these days (to support wheels for 
one thing), so keeping distutils unchanged and fixing setuptools may be the 
best path.

--

___
Python tracker 

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



[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-14 Thread Paul Ganssle

Paul Ganssle  added the comment:

One thing that's unclear to me is whether PKG-INFO metadata spec should be 
considered exhaustive or whether you can add additional fields and still be 
considered compliant with the spec. If the latter is true, I think there's some 
case to be made for populating Maintainer: and Maintainer-Email: even in a 
purely Metadata-Version: 1.1 PKG-INFO file.

--

___
Python tracker 

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



[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Ned Deily

Change by Ned Deily :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

This is actually an intended behaviour. Moreover, the implicit optionality of 
arguments that default to `None` is deprecated and will be removed in one of 
the future versions. (Note that since typing module is still provisional, this 
will likely happen without any additional notice.)

--

___
Python tracker 

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



[issue25054] Capturing start of line '^'

2018-03-14 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue1647489] zero-length match confuses re.finditer()

2018-03-14 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32885] Tools/scripts/pathfix.py leaves bunch of ~ suffixed files around with no opt-out

2018-03-14 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset a954919788f2130076e4f9dd91e9eccf69540f7a by Christian Heimes 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ 
(GH-5772) (#6104)
https://github.com/python/cpython/commit/a954919788f2130076e4f9dd91e9eccf69540f7a


--

___
Python tracker 

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



[issue32885] Tools/scripts/pathfix.py leaves bunch of ~ suffixed files around with no opt-out

2018-03-14 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 6e65e4462692cbf4461c307a411af7cf40a1ca4a by Christian Heimes 
(Miss Islington (bot)) in branch '3.7':
[3.7] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ 
(GH-5772) (#6103)
https://github.com/python/cpython/commit/6e65e4462692cbf4461c307a411af7cf40a1ca4a


--

___
Python tracker 

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



[issue27910] Doc/library/traceback.rst — references to tuples should be replaced with new FrameSummary object

2018-03-14 Thread Tomas Orsava

Change by Tomas Orsava :


--
pull_requests: +5879
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



[issue27910] Doc/library/traceback.rst — references to tuples should be replaced with new FrameSummary object

2018-03-14 Thread Tomas Orsava

Tomas Orsava  added the comment:

Hey Cheryl,
here is the pull request: https://github.com/python/cpython/pull/6116

--

___
Python tracker 

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



[issue26450] make html fails on OSX

2018-03-14 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

With the new instructions for building the docs via `make venv` and then `make 
html`, I believe this issue can be closed.

--
nosy: +csabella
resolution: not a bug -> 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



[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-03-14 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks for the PR (and apologies for being slow to look at it). I think we want 
to use the operator_fallbacks approach for both __rfloordiv__ and __floordiv__ 
(and similarly for __rmod__ and __mod__), else we'll get inconsistent results:

>>> Fraction(3) // 5.0  # get float, as expected
0.0
>>> 3.0 // Fraction(5)  # expect a float, get an integer
0

Please could you make that change and add a couple more tests that cover this 
case?

--

___
Python tracker 

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



[issue33057] logging.Manager.logRecordFactory is never used

2018-03-14 Thread Ben Feinstein

Ben Feinstein  added the comment:

Here is a code that demonstrate the bug:

```python
import logging

class LogRecordTypeFilter(logging.Filter):
def __init__(self, cls):
self.cls = cls

def filter(self, record):
t = type(record)
if t is not self.cls:
msg = 'Unexpected LogRecord type %s, expected %s' % (t, self.cls)
raise TypeError(msg)
return True

class MyLogRecord(logging.LogRecord):
pass

manager = logging.Manager(None)
manager.setLogRecordFactory(MyLogRecord)
logger = manager.getLogger('some_logger')
logger.addFilter(LogRecordTypeFilter(MyLogRecord))

try:
logger.error('bpo-33057')
except TypeError as e:
print(e)  # output: Unexpected LogRecord type , 
expected 
```

--

___
Python tracker 

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



[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Guido van Rossum

Guido van Rossum  added the comment:

This bug report can be closed.

--

___
Python tracker 

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



[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
resolution:  -> not a bug
stage:  -> resolved

___
Python tracker 

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



[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
status: open -> closed

___
Python tracker 

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



[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-14 Thread Zackery Spytz

Change by Zackery Spytz :


--
pull_requests: +5880

___
Python tracker 

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



[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-14 Thread Zackery Spytz

Zackery Spytz  added the comment:

Commit 4484f9dca9149da135bbae035f10a50d20d1cbbb causes GCC 7.2.0 to emit a 
warning.

cpython/Modules/mmapmodule.c: In function ‘new_mmap_object’:
cpython/Modules/mmapmodule.c:1126:18: warning: ‘fstat_result’ may be used 
uninitialized in this function [-Wmaybe-uninitialized]
 if (fd != -1 && fstat_result == 0 && S_ISREG(status.st_mode)) {

A PR is attached.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset d6e140466142018ddbb7541185348be2b833a2ce by Antoine Pitrou 
(Zackery Spytz) in branch 'master':
bpo-33021: Fix GCC 7 warning (-Wmaybe-uninitialized) in mmapmodule.c (#6117)
https://github.com/python/cpython/commit/d6e140466142018ddbb7541185348be2b833a2ce


--

___
Python tracker 

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



[issue31974] Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra

2018-03-14 Thread Ned Deily

Ned Deily  added the comment:

Update: for Python 3.6.5 and 3.7.0, there are new python.org 10.9+ installer 
variants that come with a built-in Tcl/Tk 8.6.8.  They are currently both 
available in testing pre-releases (3.6.5rc1 and 3.7.0b2):

https://www.python.org/download/pre-releases/

--

___
Python tracker 

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



[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

With Benjamin we've decided that this wouldn't happen in 2.7.  Performance 
improvements don't warrant a backport.

Thank you Nir for reporting and posting the patches!

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2018-03-14 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5881

___
Python tracker 

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



[issue33036] test_selectors.PollSelectorTestCase failing on macOS 10.13.3

2018-03-14 Thread Nathan Henrie

Nathan Henrie  added the comment:

Hmmm, still failing for me. I wonder if it's something specific to my machine.

```
git reset --hard 3.6 && make clean && git pull && ./configure --with-pydebug && 
make -j && ./python.exe -m unittest -v 
test.test_selectors.PollSelectorTestCase.test_above_fd_setsize
```

Related:

- https://bugs.python.org/issue18963
- https://bugs.python.org/issue21901

--

___
Python tracker 

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



[issue33076] Trying to cleanly terminate a threaded Queue at exit of program raises an "EOFError"

2018-03-14 Thread Adrien

New submission from Adrien :

Hi.

I use a worker Thread to which I communicate trough a multiprocessing Queue. I 
would like to properly close this daemon thread when my program terminates, so 
I registered a "stop()" function using "atexit.register()".

However, this raises an "EOFError" because the multiprocessing module uses 
"atexit.register()" too and closes the Queue internal pipe connections before 
that my thread ends.

After scratching inside the multiprocessing module, I tried to summarize my 
understanding of the problem here: https://stackoverflow.com/a/49244528/2291710

I joined a demonstration script that triggers the bug with (at least) Python 
3.5/3.6 on both Windows and Linux.

The issue is fixable by forcing multiprocessing "atexit.register()" before mine 
with "import multiprocessing.queues", but this means I would rely on an 
implementation detail, and others dynamic calls made to "atexit.register()" 
(like one I saw in multiprocessing "get_logger()" for example) could break it 
again.
I first thought that "atexit.register()" could accept an optional "priority" 
argument, but every developers would probably want to be first. Could a subtle 
change be made however to guarantee that registered functions are executed 
before Python internal ones? As for now, the atexit statement "The assumption 
is that lower level modules will normally be imported before higher level 
modules and thus must be cleaned up later" is not quite true.

I do not know what to do with it, from what I know there is no way to achieve 
an automatic yet clean closure of such worker, so I would like to know if some 
kind of fix is possible for a future version of Python.

Thanks for your time.

--
components: Library (Lib)
files: bug.py
messages: 313841
nosy: Delgan
priority: normal
severity: normal
status: open
title: Trying to cleanly terminate a threaded Queue at exit of program raises 
an "EOFError"
type: behavior
versions: Python 3.5, Python 3.6
Added file: https://bugs.python.org/file47486/bug.py

___
Python tracker 

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



[issue27984] singledispatch register should typecheck its argument

2018-03-14 Thread Łukasz Langa

Łukasz Langa  added the comment:

I'm sorry that you wasted your time on those pull requests, Xiang but:
- we cannot accept any new features for 3.6 and 3.7 anymore;
- the problem described in this issue is fixed, as you noticed yourself, by 
#32227.

The wrapper returned by the `@register` decorator is calling `dispatch()` with 
the first argument's `__class__`. It can only ever be invalid if somebody 
deliberately wrote something invalid to the object's `__class__`. It's 
extremely unlikely.

We should not slow down *calling* of all generic functions on the basis that 
somebody might pass a non-type straigh to `dispatch()`.

Cheryl, thanks for your help triaging the bug tracker! It might be a good idea 
to confirm with people on old issues whether moving the patch to a pull request 
is indeed the missing part of it getting merged. In this case it wasn't, I hope 
Xiang won't feel bad about me rejecting his pull requests after you pinged him 
for them.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> singledispatch support for type annotations

___
Python tracker 

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



[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-14 Thread Евгений Махмудов

New submission from Евгений Махмудов :

Overwriting of default values not working, and used default value of base 
class. Unittest file if attachment described a problem.

--
components: Library (Lib)
files: python_test.py
messages: 313843
nosy: Евгений Махмудов
priority: normal
severity: normal
status: open
title: typing: Unexpected result with value of instance of class inherited from 
typing.NamedTuple
type: behavior
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47487/python_test.py

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2018-03-14 Thread Xiang Zhang

Change by Xiang Zhang :


--
pull_requests: +5882
stage:  -> patch review

___
Python tracker 

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



[issue33036] test_selectors.PollSelectorTestCase failing on macOS 10.13.3

2018-03-14 Thread Ned Deily

Ned Deily  added the comment:

I'm not sure what to suggest other than taking a close look at and 
instrumenting that part of test_selectors.  One thing you could try is seeing 
what the call to resource.getrlimit(resource.RLIMIT_NOFILE) is returning.  You 
can also look at the values for your system's kernel by using the sysctl 
utility; see man sysctl.  For example, on my system:

>>> resource.getrlimit(resource.RLIMIT_NOFILE)
(7168, 9223372036854775807)

$ sysctl kern.maxfilesperproc
kern.maxfilesperproc: 36864

That may or may not be relevant.

Long shot: are you running under an account that does not have administrator 
privs?

--

___
Python tracker 

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



[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-14 Thread Ned Deily

Change by Ned Deily :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2018-03-14 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue27984] singledispatch register should typecheck its argument

2018-03-14 Thread Xiang Zhang

Xiang Zhang  added the comment:

It's all right.

--

___
Python tracker 

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



[issue9712] tokenize yield an ERRORTOKEN if the identifier starts with a non-ascii char

2018-03-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Joshua opened #24194 as a duplicate of this because he could not reopen this.  
I am leaving it open as the superseder for this as Serhiy has already added two 
dependencies there, and because this seems to be a duplicate in turn of 
#1693050 (which I will close along with #32987).

--
nosy: +terry.reedy
superseder:  -> tokenize yield an ERRORTOKEN if an identifier uses 
Other_ID_Start or Other_ID_Continue

___
Python tracker 

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



[issue9712] tokenize yield an ERRORTOKEN if the identifier starts with a non-ascii char

2018-03-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Actually, #1693050 and #12731, about \w, are duplicates.

--

___
Python tracker 

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



[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-14 Thread Guido van Rossum

Guido van Rossum  added the comment:

Thanks Евгений Махмудов for the report!

The crux is this:

class A(NamedTuple):
value: bool = True

class B(A):
value: bool = False

B(True).value  # Expected True, but is False
B(True)[0]  # True as expected

If we add NamedTuple to B's bases or make its metaclass NamedTupleMeta, it 
works as expected.

Introspecting the classes a bit more suggests a cause: the class variable 
A.value is a , but B.value is just False, and adding the extra 
base class or metaclass corrects this.

Ivan, you can probably tell what's wrong from this.  Maybe it's hard to fix, 
because NamedTuple doesn't appear in A.__mro__?  (IIRC there was a question 
about that somewhere recently too?)

--

___
Python tracker 

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



[issue12731] python lib re uses obsolete sense of \w in full violation of UTS#18 RL1.2a

2018-03-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Whatever I may have said before, I favor supporting the Unicode standard for 
\w, which is related to the standard for identifiers.

This is one of 2 issues about \w being defined too narrowly.  I am somewhat 
arbitrarily closing #1693050 as a duplicate of this (fewer digits ;-).

There are 3 issues about tokenize.tokenize failing on valid identifiers, 
defined as \w sequences whose first char is an identifier itself (and therefore 
a start char).  In msg313814 of #32987, Serhiy indicates which start and 
continue identifier characters are matched by \W for re and regex.  I am 
leaving #24194 open as the tokenizer name issue.

--
stage: needs patch -> test needed
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 2.7, Python 3.3, Python 
3.4

___
Python tracker 

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



[issue1693050] \w not helpful for non-Roman scripts

2018-03-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Whatever I may have said before, I favor supporting the Unicode standard for 
\w, which is related to the standard for identifiers.

This is one of 2 issues about \w being defined too narrowly.  I am somewhat 
arbitrarily closing this as a duplicate of #12731 (fewer digits ;-).

There are 3 issues about tokenize.tokenize failing on valid identifiers, 
defined as \w sequences whose first char is an identifier itself (and therefore 
a start char).  In msg313814 of #32987, Serhiy indicates which start and 
continue identifier characters are matched by \W for re and regex.  I am 
leaving #24194 open as the tokenizer name issue.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> tokenize yield an ERRORTOKEN if an identifier uses 
Other_ID_Start or Other_ID_Continue

___
Python tracker 

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



[issue24194] tokenize fails on some Other_ID_Start or Other_ID_Continue

2018-03-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I closed #1693050 as a duplicate of #12731 (the /w issue).  I left #9712 closed 
and closed #32987 and marked both as duplicates of this.

In msg313814 of the latter, Serhiy indicates which start and continue 
identifier characters are currently matched by \W for re and regex.  He gives 
there a fix for this that he says requires the /w issue to be fixed. It is 
similar to the posted patch.  He says that without \w fixed, another 2000+ 
chars need to be added.  Perhaps the v0 patch needs more tests (I don't know.)

He also says that re support for properties, #12734,  would make things even 
better.

Three of the characters in the patch are too obscure for Firefox on Window2 and 
print as boxes.  Some others I do not recognize.  And I could not type any of 
them.  I thought we had a policy of using \u or \U escapes even in tests to 
avoid such problems.  (I notice that there are already non-ascii chars in the 
context.)

--
nosy: +terry.reedy
title: tokenize yield an ERRORTOKEN if an identifier uses Other_ID_Start or 
Other_ID_Continue -> tokenize fails on some Other_ID_Start or Other_ID_Continue
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue32987] tokenize.py parses unicode identifiers incorrectly

2018-03-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

#24194 is about tokenize failing, including on middle dot.  There is another 
tokenize name issue, already closed.  I referenced Serhiy's analysis there and 
on the two \w issues, and closed one of them.

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> tokenize fails on some Other_ID_Start or Other_ID_Continue

___
Python tracker 

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



[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-14 Thread Eric V. Smith

Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue33057] logging.Manager.logRecordFactory is never used

2018-03-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

The logRecordFactory attribute was added but never used and is part of an 
internal API (the Manager isn't documented, on purpose). Why do you need a 
manager-specific factory?

--

___
Python tracker 

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



[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-03-14 Thread Elias Zamaria

Elias Zamaria  added the comment:

Mark, what you described (operator_fallbacks for both __rfloordiv__ and 
__floordiv__, and for both __rmod__ and __mod__) was my initial approach. But 
that broke one test (which floor-divides 1.0 by 1/10 and expects the result to 
be an integer). I thought about fixing it, to make the behavior more 
consistent, but I thought that was a bit risky.

Just now, I tried the change again, as you suggested, but I fixed the test to 
expect a result of 10.0 (a float) instead of 10 (an integer). I got a strange 
result from that test, saying the result was 9.0.

It seems like this is caused by rounding error, since operator_fallbacks 
converts both numbers to floats if one of them is a float, and 1/10 can't be 
represented exactly as a float, so it gets rounded to slightly more than 1/10:

>>> float(Fraction(1, 10)).as_integer_ratio()
(3602879701896397, 36028797018963968)
>>> Decimal.from_float(float(Fraction(1, 10)))
Decimal('0.155511151231257827021181583404541015625')

So yes, I can make that change, but I'm not sure if it would be a good idea. Do 
you have any thoughts?

--

___
Python tracker 

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



[issue33078] Queue with maxsize can lead to deadlocks

2018-03-14 Thread Thomas Moreau

New submission from Thomas Moreau :

The fix for the Queue._feeder does not properly handle the size of the Queue. 
This can lead to a situation where the Queue is considered as Full when it is 
empty. Here is a reproducing script:

```
import multiprocessing as mp

q = mp.Queue(1)


class FailPickle():
def __reduce__(self):
raise ValueError()

q.put(FailPickle())
print("Queue is full:", q.full())
q.put(0)
print(f"Got result: {q.get()}")
```

--
components: Library (Lib)
messages: 313855
nosy: davin, pitrou, tomMoral
priority: normal
severity: normal
status: open
title: Queue with maxsize can lead to deadlocks
type: behavior
versions: Python 2.7, 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



[issue33078] Queue with maxsize can lead to deadlocks

2018-03-14 Thread Thomas Moreau

Change by Thomas Moreau :


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

___
Python tracker 

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