[issue37227] Wrong parse long argument

2019-06-12 Thread paul j3


Change by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue37216] "Using Python on a Macintosh" chapter of "Python Setup and Usage" doc is out-of-date

2019-06-12 Thread Ned Deily


Ned Deily  added the comment:

Thanks for contributing the PRs!

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



[issue37216] "Using Python on a Macintosh" chapter of "Python Setup and Usage" doc is out-of-date

2019-06-12 Thread Ned Deily


Ned Deily  added the comment:


New changeset 905e19a9bf9afd6439ea44fc6a4f3c8631750d6d by Ned Deily (Makdon) in 
branch 'master':
bpo-37216: update version to 3.9 in mac using document (GH-13966)
https://github.com/python/cpython/commit/905e19a9bf9afd6439ea44fc6a4f3c8631750d6d


--

___
Python tracker 

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



[issue37136] Travis CI: Documentation tests fails with Sphinx 2.1

2019-06-12 Thread Ned Deily


Ned Deily  added the comment:

The problem with the duplicate `.. module:: email.message` was fixed about 10 
days ago with PR 13742 and backports; the fix adds a :noindex: to the duplicate 
entry.  I'm guessing that people seeing this problem had upgraded to Sphinx 2.1 
but had not recently done a rebase of their feature branch to pick up that fix.

--
nosy: +ned.deily
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37198] _parse_localename fail to parse 'en_IL'

2019-06-12 Thread Eryk Sun


Eryk Sun  added the comment:

Windows prefers locale names based on RFC 4646 language tags, which use a 
hyphen instead of an underscore (e.g. "en-UK"). This name format doesn't 
include an encoding. The C runtime (not the Windows API) makes one exception to 
support ".utf8" and ".utf-8" (e.g. "en-UK.utf8"). If UTF-8 is not specified, 
setlocale implicitly uses the ANSI codepage of the given locale (which is not 
to be confused with the ANSI codepage of the system locale).

As noted in this issue, _parse_localename currently fails if there's no 
encoding. hodai's PR 14027 addresses this case by looking for underscore in the 
name. In Windows, it should also look for hyphen. Also, instead of using None 
for the encoding in this case, in Windows we can look it up via 
___lc_codepage_func [1]. This could be added as _locale._lc_codepage_func.

[1] 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/lc-codepage-func?view=vs-2019

--
nosy: +eryksun

___
Python tracker 

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



[issue37257] obmalloc: stop simple arena thrashing

2019-06-12 Thread Tim Peters


Change by Tim Peters :


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



[issue37257] obmalloc: stop simple arena thrashing

2019-06-12 Thread Tim Peters


Tim Peters  added the comment:


New changeset d1c85a27ea9fe70163cad3443d5e534d94f08284 by Tim Peters in branch 
'master':
bpo-37257:  obmalloc:  stop simple arena thrashing (#14039)
https://github.com/python/cpython/commit/d1c85a27ea9fe70163cad3443d5e534d94f08284


--

___
Python tracker 

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



[issue37248] support conversion of `func(**{} if a else b)`

2019-06-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

https://bugs.python.org/issue36541 already tracks it. So can this be closed as 
a duplicate?

--

___
Python tracker 

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



[issue37259] Missing Doc/whatsnew/3.9.rst file

2019-06-12 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report.  Fixed in PR 14040 
(3a2883c313be3aff34c61a42e586f8507ba5945f) in master.

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

___
Python tracker 

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



[issue37257] obmalloc: stop simple arena thrashing

2019-06-12 Thread Tim Peters


Change by Tim Peters :


--
keywords: +patch
pull_requests: +13903
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/14039

___
Python tracker 

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



[issue37261] test_io leaks references on AMD64 Fedora Rawhide Refleaks 3.8

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

gdb traceback on "del self.unraisable":

(gdb) where
#0  _PyErr_WriteUnraisableDefaultHook (
args=(, ValueError('flush of closed file',), 
, None, <_io.BufferedWriter at remote 
0x7fffe9bcb890>)) at Python/errors.c:1294
#1  0x005726ec in sys_unraisablehook (module=, 
unraisable=(, ValueError('flush of closed file',), 
, None, <_io.BufferedWriter at remote 
0x7fffe9bcb890>)) at ./Python/sysmodule.c:702
#2  0x00435741 in _PyMethodDef_RawFastCallKeywords (method=0x7bb2e0 
, self=, 
args=0x7ffd1d00, 
nargs=1, kwnames=0x0) at Objects/call.c:650
#3  0x004359f4 in _PyCFunction_Vectorcall (func=, args=0x7ffd1d00, 
nargsf=1, kwnames=0x0) at Objects/call.c:737
#4  0x00534666 in _PyObject_Vectorcall (callable=, args=0x7ffd1d00, 
nargsf=1, kwnames=0x0) at ./Include/cpython/abstract.h:127
#5  0x005346b1 in _PyObject_FastCall (func=, args=0x7ffd1d00, 
nargs=1)
at ./Include/cpython/abstract.h:147
#6  0x00536da4 in _PyErr_WriteUnraisableMsg (err_msg_str=0x0, 
obj=<_io.BufferedWriter at remote 0x7fffe9bcb890>) at Python/errors.c:1379
#7  0x00536ee6 in PyErr_WriteUnraisable (obj=<_io.BufferedWriter at 
remote 0x7fffe9bcb890>) at Python/errors.c:1425


#8  0x005eb97d in iobase_finalize (self=<_io.BufferedWriter at remote 
0x7fffe9bcb890>) at ./Modules/_io/iobase.c:299
#9  0x00479fd2 in PyObject_CallFinalizer (self=<_io.BufferedWriter at 
remote 0x7fffe9bcb890>) at Objects/object.c:307
#10 0x0047a044 in PyObject_CallFinalizerFromDealloc 
(self=<_io.BufferedWriter at remote 0x7fffe9bcb890>) at Objects/object.c:325
#11 0x005eb9e0 in _PyIOBase_finalize (self=<_io.BufferedWriter at 
remote 0x7fffe9bcb890>) at ./Modules/_io/iobase.c:320


#12 0x005f27d3 in buffered_dealloc (self=0x7fffe9bcb890) at 
./Modules/_io/bufferedio.c:387
#13 0x0047ebff in _Py_Dealloc (op=<_io.BufferedWriter at remote 
0x7fffe9bcb890>) at Objects/object.c:2213
#14 0x005f210a in _Py_DECREF (filename=0x71eef3 
"./Modules/_io/bufferedio.c", lineno=2138, op=<_io.BufferedWriter at remote 
0x7fffe9bcb890>)
at ./Include/object.h:478
#15 0x005f716a in bufferedrwpair_dealloc (self=0x7fffe9a90d70) at 
./Modules/_io/bufferedio.c:2138


#16 0x0047ebff in _Py_Dealloc (op=<_io.BufferedRWPair at remote 
0x7fffe9a90d70>) at Objects/object.c:2213
#17 0x0048d1b6 in _Py_DECREF (filename=0x69fe40 "./Include/object.h", 
lineno=541, op=<_io.BufferedRWPair at remote 0x7fffe9a90d70>)
at ./Include/object.h:478
#18 0x0048d1e2 in _Py_XDECREF (op=<_io.BufferedRWPair at remote 
0x7fffe9a90d70>) at ./Include/object.h:541

# del UnraisableHookArgs

#19 0x0048d569 in structseq_dealloc (obj=0x7fffe9ad1360) at 
Objects/structseq.c:85
#20 0x0047ebff in _Py_Dealloc (
op=(, ValueError('flush of closed file',), 
, None, <_io.BufferedRWPair at remote 
0x7fffe9a90d70>))
at Objects/object.c:2213
#21 0x00463be6 in _Py_DECREF (filename=0x696dc9 "Objects/dictobject.c", 
lineno=1585, 
op=(, ValueError('flush of closed file',), 
, None, <_io.BufferedRWPair at remote 
0x7fffe9a90d70>))
at ./Include/object.h:478
#22 0x00468428 in delitem_common (mp=0x7fffe9b17950, 
hash=-822296730167156087, ix=0, 
old_value=(, ValueError('flush of closed file',), 
, None, <_io.BufferedRWPair at remote 
0x7fffe9a90d70>)) at Objects/dictobject.c:1585
#23 0x00468663 in _PyDict_DelItem_KnownHash (op={'_old_hook': }, 
key='unraisable', hash=-822296730167156087) at Objects/dictobject.c:1637
#24 0x004684e5 in PyDict_DelItem (op={'_old_hook': }, key='unraisable')
at Objects/dictobject.c:1603

# del self.unraisable

#25 0x0046ef21 in _PyObjectDict_SetItem (tp=0xa58830, 
dictptr=0x7fffe9a8ad30, key='unraisable', value=0x0) at 
Objects/dictobject.c:4614

--

___
Python tracker 

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



[issue37261] test_io leaks references on AMD64 Fedora Rawhide Refleaks 3.8

2019-06-12 Thread STINNER Victor


New submission from STINNER Victor :

test_io leaks references on AMD64 Fedora Rawhide Refleaks 3.8:
https://buildbot.python.org/all/#/builders/229/builds/10

test_io leaked [23208, 23204, 23208] references, sum=69620
test_io leaked [7657, 7655, 7657] memory blocks, sum=22969


The issue has been introduced by my change:

commit c15a682603a47f5aef5025f6a2e3babb699273d6
Author: Victor Stinner 
Date:   Thu Jun 13 00:23:49 2019 +0200

bpo-37223: test_io: silence destructor errors (GH-14031)

* bpo-18748: Fix _pyio.IOBase destructor (closed case) (GH-13952)

_pyio.IOBase destructor now does nothing if getting the closed
attribute fails to better mimick _io.IOBase finalizer.

(cherry picked from commit 4f6f7c5a611905fb6b81671547f268c226bc646a)

* bpo-37223: test_io: silence destructor errors (GH-13954)

Implement also MockNonBlockWriterIO.seek() method.

(cherry picked from commit b589cef9c4dada2fb84ce0fae5040ecf16d9d5ef)

* bpo-37223, test_io: silence last 'Exception ignored in:' (GH-14029)

Use catch_unraisable_exception() to ignore 'Exception ignored in:'
error when the internal BufferedWriter of the BufferedRWPair is
destroyed. The C implementation doesn't give access to the
internal BufferedWriter, so just ignore the warning instead.

(cherry picked from commit 913fa1c8245d1cde6edb4254f4fb965cc91786ef)


It seems like the root issue is the usage of catch_unraisable_exception() in 
test_io.

class catch_unraisable_exception:
def __init__(self):
self.unraisable = None
self._old_hook = None

def _hook(self, unraisable):
self.unraisable = unraisable

def __enter__(self):
self._old_hook = sys.unraisablehook
sys.unraisablehook = self._hook
return self

def __exit__(self, *exc_info):
# Clear the unraisable exception to explicitly break a reference cycle
del self.unraisable
sys.unraisablehook = self._old_hook

*Sometimes* "del self.unraisable" of __exit__() triggers a new unraisable 
exception which calls again the _hook() method which sets again the unraisable 
attribute.

catch_unraisable_exception resurects _io.BufferedWriter objects, and then "del 
self.unraisable" calls again their finalizer: iobase_finalize() is called 
again, and iobase_finalize() calls PyErr_WriteUnraisable() on close() failure.

--
messages: 345449
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_io leaks references on AMD64 Fedora Rawhide Refleaks 3.8
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



[issue35462] test_imaplib.test_enable_UTF8_True_append() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

I only saw the issue once, 6 months ago. I close the issue.

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



[issue35385] time module: why not using tzname from the glibc?

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

This issue isn't really a bug. The current code just works. I close the issue.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue35425] test_eintr fails randomly on AMD64 FreeBSD 10-STABLE Non-Debug 3.7: TypeError: 'int' object is not callable

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see this issue recently, so I close it.

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



[issue37260] shutil.rmtree() FileNotFoundError race condition

2019-06-12 Thread Jeffrey Kintscher


New submission from Jeffrey Kintscher :

shutil.rmtree() is susceptible to a race condition that can needlessly raise 
OSError:

1. os.scandir() returns the list of entries in a directory
2. while iterating over the list, another thread or process deletes one or more 
of the entries not yet iterated
3. os.unlink() or stat() raises OSError for the already deleted entry

It should check for and ignore, at a minimum, FileNotFoundError because we were 
going to delete the entry anyways.  For comparison, the 'rm -r' shell command 
handles this race condition by ignoring entries deleted from under it.

I will submit a PR when I work out some test cases to include.

--
components: Library (Lib)
messages: 345445
nosy: Jeffrey.Kintscher, giampaolo.rodola, tarek
priority: normal
severity: normal
status: open
title: shutil.rmtree() FileNotFoundError race condition
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue36631] test_urllib2net: test_ftp_no_timeout() killed after a timeout of 15 min

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

I only saw this issue once, two months ago, so I close it.

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



[issue37136] Travis CI: Documentation tests fails with Sphinx 2.1

2019-06-12 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

One of Guido's mentees (I don't know her bpo account name) also ran into this:

https://python.zulipchat.com/#narrow/stream/116742-core.2Fhelp/topic/Weird.20sphinx.20error

Some analysis shows that we do have a bug in the docs – the sphinx '.. 
module::' directive is only supposed to be used once per module, because it 
means "this is the canonical documentation for this module, that should be 
linked to whenever anyone mentions this module".

But we have two documents that use '.. module:: email.message':
  Doc/library/email.message.rst
  Doc/library/email.compat32-message.rst

I don't know enough about the email module to know what the right fix is, so 
I'll CC the email-interest-area folks too... maybe email.compat32-message.rst 
should be using '.. currentmodule:: email.message' instead of '.. module::'?

It's not clear why this error is appearing and disappearing for different 
people. The sphinx 2.1 release did make some changes in this area:

  
https://github.com/sphinx-doc/sphinx/commit/259be8716ad4b2332aa4d7693d73400eb06fa7d7

but that doesn't explain why it appears and disappears randomly.

Probably not worth tracking down though, given that we can just fix the 
underlying problem.

--
nosy: +barry, gvanrossum, maxking, njs, r.david.murray
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue37191] Python.h contains intermingled declarations

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

Petr Viktorin fixed the issue, thanks ;-)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

___
Python tracker 

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



[issue37154] test_utf8_mode: test_env_var() fails on AMD64 Fedora Rawhide Clang Installed 3.7

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like test_utf8_mode has a bug, but sadly I'm no longer able to 
reproduce it and so I cannot test my fix:

diff --git a/Lib/test/test_utf8_mode.py b/Lib/test/test_utf8_mode.py
index bdb93457cf..c22b95d54d 100644
--- a/Lib/test/test_utf8_mode.py
+++ b/Lib/test/test_utf8_mode.py
@@ -22,6 +22,16 @@ class UTF8ModeTests(unittest.TestCase):
 }
 
 def posix_locale(self):
+try:
+import _testinternalcapi
+except ImportError:
+pass
+else:
+pre_config = _testinternalcapi.get_configs()["pre_config"]
+if pre_config["coerce_c_locale"] > 0:
+# C locale has been coerced
+return True
+
 loc = locale.setlocale(locale.LC_CTYPE, None)
 return (loc in POSIX_LOCALES)
 

I close the issue. Reopen it if you are able to reproduce the bug.

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f9445a391e6a91103fbe88bff4d3adc07f526c73 by Victor Stinner in 
branch '3.8':
[3.8] bpo-37253: Document PyCompilerFlags.cf_feature_version (GH-14019) 
(GH-14038)
https://github.com/python/cpython/commit/f9445a391e6a91103fbe88bff4d3adc07f526c73


--

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread miss-islington


miss-islington  added the comment:


New changeset 92e836c7dcaf74f7b8617250414224d24d1eb1f2 by Miss Islington (bot) 
in branch '3.8':
bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)
https://github.com/python/cpython/commit/92e836c7dcaf74f7b8617250414224d24d1eb1f2


--
nosy: +miss-islington

___
Python tracker 

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



[issue37258] Logging cache not cleared properly when setting level

2019-06-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue37248] support conversion of `func(**{} if a else b)`

2019-06-12 Thread Shen Han


Shen Han  added the comment:

This PR https://github.com/python/cpython/pull/12703 solves this problem. But 
haven't been merged.

--

___
Python tracker 

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



[issue37248] support conversion of `func(**{} if a else b)`

2019-06-12 Thread Shen Han


Shen Han  added the comment:

The 2to3 tool cannot convert the following code:
 1. `func(**{} if a else b)`
 2. `func(*[] if a else b)`

I think that problem is rooted the outdated Grammar.txt.

--

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

Many PyRun_xxx() functions of the public C API accept a "PyCompilerFlags* 
flags" parameter. So yeah, I documented the new cf_feature_version. 
PyCompilerFlags structure is kind of public ;-)

--

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13902
pull_request: https://github.com/python/cpython/pull/14038

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13901
pull_request: https://github.com/python/cpython/pull/14037

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a04ea4f92ccbe20ffdbb5fa9b6bb93ee8da50f5d by Victor Stinner in 
branch 'master':
bpo-37253: Fix typo in PyCompilerFlags doc (GH-14036)
https://github.com/python/cpython/commit/a04ea4f92ccbe20ffdbb5fa9b6bb93ee8da50f5d


--

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 37d66d7d4bc7dbac9809d69966a774ebb32563be by Victor Stinner in 
branch 'master':
bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)
https://github.com/python/cpython/commit/37d66d7d4bc7dbac9809d69966a774ebb32563be


--

___
Python tracker 

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



[issue37259] Missing Doc/whatsnew/3.9.rst file

2019-06-12 Thread STINNER Victor


New submission from STINNER Victor :

There is no Doc/whatsnew/3.9.rst file yet. How should new features of Python 
3.9 be documented?

Does someone know how to create a template for this file?

--
assignee: docs@python
components: Documentation
messages: 345433
nosy: docs@python, lukasz.langa, ned.deily, vstinner
priority: normal
severity: normal
status: open
title: Missing Doc/whatsnew/3.9.rst file
versions: Python 3.9

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13900
pull_request: https://github.com/python/cpython/pull/14036

___
Python tracker 

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



[issue37111] Logging - Inconsistent behaviour when handling unicode

2019-06-12 Thread Inada Naoki

Inada Naoki  added the comment:

> What logging does when UnicodeEncodeError is happened?

Hm, it seems logging does best job, show enough information to stderr.

But sometime, Python is embedded in web servers and there is no stderr.  
pythonw.exe may not have stderr too

I still feel backslashreplace is better default error handler.  But it's not 
strong opinion and it shouldn't block this issue.  Go ahead.


$ cat x.py
import logging

logging.basicConfig(filename="mylog.txt")
msg = "hello, はろー"
logging.error(msg)

$ LC_ALL=en_US.US-ASCII python3 x.py
--- Logging error ---
Traceback (most recent call last):
  File 
"/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py",
 line 1037, in emit
stream.write(msg + self.terminator)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 18-20: 
ordinal not in range(128)
Call stack:
  File "x.py", line 5, in 
logging.error(msg)
Message: 'hello, \u306f\u308d\u30fc'
Arguments: ()

--

___
Python tracker 

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



[issue36422] tempfile.TemporaryDirectory() removes entire directory tree even if it's a mount-point

2019-06-12 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +giampaolo.rodola, tarek

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2c9b498759f4fc74da82a0a96d059d666fa73f16 by Victor Stinner in 
branch 'master':
bpo-37253: Document PyCompilerFlags.cf_feature_version (GH-14019)
https://github.com/python/cpython/commit/2c9b498759f4fc74da82a0a96d059d666fa73f16


--

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13899
pull_request: https://github.com/python/cpython/pull/14035

___
Python tracker 

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



[issue36779] time.tzname returns empty string on Windows if default codepage is a Unicode codepage

2019-06-12 Thread Paul Monson


Change by Paul Monson :


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



[issue37111] Logging - Inconsistent behaviour when handling unicode

2019-06-12 Thread Inada Naoki


Inada Naoki  added the comment:

> I've left it as is using the same rationale as I guess open() has at the 
> moment - "Errors should never pass silently. Unless explicitly silenced".

But open() is general purpose, and logging is for logging.

Note that stderr uses 'backslashreplace', even when 
PYTHONIOENCODING=ascii:strict is used.

And if we don't log something due to encoding error, doesn't it mean "errors 
may ignored completely silently by default"?
What logging does when UnicodeEncodeError is happened?

--

___
Python tracker 

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



[issue36402] threading._shutdown() race condition: test_threading test_threads_join_2() fails randomly

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue36402] threading._shutdown() race condition: test_threading test_threads_join_2() fails randomly

2019-06-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13897
pull_request: https://github.com/python/cpython/pull/14033

___
Python tracker 

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



[issue36402] threading._shutdown() race condition: test_threading test_threads_join_2() fails randomly

2019-06-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13898
pull_request: https://github.com/python/cpython/pull/14034

___
Python tracker 

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



[issue36402] threading._shutdown() race condition: test_threading test_threads_join_2() fails randomly

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 468e5fec8a2f534f1685d59da3ca4fad425c38dd by Victor Stinner in 
branch 'master':
bpo-36402: Fix threading._shutdown() race condition (GH-13948)
https://github.com/python/cpython/commit/468e5fec8a2f534f1685d59da3ca4fad425c38dd


--

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

I closed the issue. I consider that the initial issue has been fixed and all 
related issues have been fixed as well:

* Python 3.8 now logs close() exception in file finalizer in development mode 
(-X dev) and debug mode (./configure --with-pydebug)
* I added sys.unraisablehook to Python 3.8 which allows to decide how these 
unraisable exceptions are handled
* Tests no longer log any "unraisable exception" in file finalizers (test_io 
and test_urllib have been fixed)
* regrtest now marks a test as ENV_CHANGED if it logs an unraisable exception 
(like the close() exception)

--

For Python 3.7, there is no known workaround.

It seems like Python 2.7 in debug mode logs an error:

$ python2.7-dbg bug.py 
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor

--

___
Python tracker 

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



[issue29982] tempfile.TemporaryDirectory fails to delete itself

2019-06-12 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +Jeffrey.Kintscher

___
Python tracker 

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



[issue37247] swap distutils build_ext and build_py commands to allow proper SWIG extension installation

2019-06-12 Thread Jeroen van den Hout


Jeroen van den Hout  added the comment:

I'm sorry, I read your comment completely wrong, so please disregard my 
previous comment.

I would argue the sequence doesn't really matter that much for non SWIG 
packages, since those will install correctly no matter if the extensions are 
built and copied first or not. In the non-SWIG case they are truly independent 
commands. It is only in the SWIG packages that they become dependent on each 
other.

On top of that I see more and more questions on stack exchange and other forums 
asking why their SWIG builds fail to install correctly, implying that more and 
more developers are using this awesome feature and start to rely on it.

--

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


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



[issue36779] time.tzname returns empty string on Windows if default codepage is a Unicode codepage

2019-06-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13896
pull_request: https://github.com/python/cpython/pull/14032

___
Python tracker 

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



[issue36779] time.tzname returns empty string on Windows if default codepage is a Unicode codepage

2019-06-12 Thread miss-islington

miss-islington  added the comment:


New changeset b4c7defe58695a6670a8fdeaef67a638bbb47e42 by Miss Islington (bot) 
(Paul Monson) in branch 'master':
bpo-36779: time.tzname returns empty string on Windows if default cod… 
(GH-13073)
https://github.com/python/cpython/commit/b4c7defe58695a6670a8fdeaef67a638bbb47e42


--
nosy: +miss-islington

___
Python tracker 

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



[issue37069] regrtest: log unraisable exceptions and uncaught thread exceptions

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 95f61c8b1619e736bd5e29a0da0183234634b6e8 by Victor Stinner in 
branch 'master':
bpo-37069: regrtest uses sys.unraisablehook (GH-13759)
https://github.com/python/cpython/commit/95f61c8b1619e736bd5e29a0da0183234634b6e8


--

___
Python tracker 

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



[issue37130] pathlib does not handle '..' directory

2019-06-12 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I'm sorry, but I don't understand the issue here.

Instead of posting isolated snippets, could you explain what are you trying to 
do?

--

___
Python tracker 

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



[issue37223] test_io logs Exception ignored in: warnings

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, all errors have been fixed in 3.8 and master. I close the issue.

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c15a682603a47f5aef5025f6a2e3babb699273d6 by Victor Stinner in 
branch '3.8':
bpo-37223: test_io: silence destructor errors (GH-14031)
https://github.com/python/cpython/commit/c15a682603a47f5aef5025f6a2e3babb699273d6


--

___
Python tracker 

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



[issue37223] test_io logs Exception ignored in: warnings

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c15a682603a47f5aef5025f6a2e3babb699273d6 by Victor Stinner in 
branch '3.8':
bpo-37223: test_io: silence destructor errors (GH-14031)
https://github.com/python/cpython/commit/c15a682603a47f5aef5025f6a2e3babb699273d6


--

___
Python tracker 

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



[issue30754] textwrap.dedent mishandles empty lines

2019-06-12 Thread Julian Berman


Julian Berman  added the comment:

I still disagree :) but docs are better than nothing.

On Wed, Jun 12, 2019, 18:05 Guido van Rossum  wrote:

>
> Change by Guido van Rossum :
>
>
> --
> nosy: +gvanrossum
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue37241] Item Count Error in Shelf

2019-06-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

After fixing a missing import (import urllib.request), this is what I get:

$ /usr/local/bin/python3.6 pbr37241_Jesse_Bacon.py 
Fetching nvdcve-1.0-2019.json.gz
Storing Gzipped File
Loading JSON Content
4275 records
4275 unique records
Creating Shelve: cve_2019.shelf
Assembling Big Dictionary of 2019 Data in shelve
shelve reports 4275 unique records
Extracting data by keys from shelve
4275 extracted records
Number of missing records 0
data match

Are you seeing failures?

This is on a python3.6 that I compiled from source on an old Fedora box.

What OS are you using?

--

___
Python tracker 

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-06-12 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 3.9

___
Python tracker 

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



[issue36689] docs: os.path.commonpath raises ValueError for different drives

2019-06-12 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-06-12 Thread Tal Einat


Tal Einat  added the comment:

In reference to previous discussion here about the effect of toggling line 
numbers on future opened windows: IMO toggling shouldn't affect future windows; 
those should behave according to the configured default state. The default 
state should be changed only by editing the config (whether via the config 
dialog or by editing the config files.)

--

___
Python tracker 

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



[issue30754] textwrap.dedent mishandles empty lines

2019-06-12 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue37223] test_io logs Exception ignored in: warnings

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13895
pull_request: https://github.com/python/cpython/pull/14031

___
Python tracker 

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-06-12 Thread Tal Einat


Tal Einat  added the comment:

Please see updated PR, GH-14030.

It's not 100% ready yet. At this point the goal is to have some people try it 
and give feedback. So please, give it a go and let me know what you think!

--
nosy: +taleinat

___
Python tracker 

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-06-12 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +13894
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/14030

___
Python tracker 

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



[issue37223] test_io logs Exception ignored in: warnings

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 913fa1c8245d1cde6edb4254f4fb965cc91786ef by Victor Stinner in 
branch 'master':
bpo-37223, test_io: silence last 'Exception ignored in:' (GH-14029)
https://github.com/python/cpython/commit/913fa1c8245d1cde6edb4254f4fb965cc91786ef


--

___
Python tracker 

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



[issue37224] test__xxsubinterpreters failed on AMD64 Windows8.1 Refleaks 3.8

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

Failure on AppVeyor on my PR 14029 (which is unrelated):

test_subinterpreter (test.test__xxsubinterpreters.IsRunningTests) ... Exception 
in thread Thread-8:
Traceback (most recent call last):
  File "C:\projects\cpython\lib\threading.py", line 923, in _bootstrap_inner
self.run()
  File "C:\projects\cpython\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
  File "C:\projects\cpython\lib\test\test__xxsubinterpreters.py", line 51, in 
run
interpreters.run_string(interp, dedent(f"""
RuntimeError: unrecognized interpreter ID 46
FAIL


FAIL: test_subinterpreter (test.test__xxsubinterpreters.IsRunningTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test__xxsubinterpreters.py", line 492, in 
test_subinterpreter
self.assertTrue(interpreters.is_running(interp))
AssertionError: False is not true


test__xxsubinterpreters passed when run again.

--

___
Python tracker 

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



[issue37258] Logging cache not cleared properly when setting level

2019-06-12 Thread David Wang


New submission from David Wang :

If you call setLevel() on a subclass of logging.Logger, it does not reset the 
cache for that logger. This mean that if you make some logging calls, then call 
setLevel(), the logger still acts like it still has its old level. See the 
attached python file for a reference.

Currently, the user has to call logger._cache.clear() to manually clear the 
cache after calling setLevel(). To fix this in Python, we would have to change 
Logger.setLevel() in /logging/__init__.py to have the following code
```
self.level = _checkLevel(level)
self.manager._clear_cache()
self._cache.clear()
```

Note the following:
- I made sure the subclass has a handler attached so setLevel() should work
- This bug does not occur if you use logging.getLogger(). This is because 
logging.getLogger() returns the root logger, and the cache clear specifically 
targets the root logger's cache to be cleared. It occurs when the logger is 
specifically subclassed from logging.getLoggerClass()
- The cache was added in Python 3.7, so this bug is specific to this version of 
python.

--
components: Library (Lib)
files: test.py
messages: 345414
nosy: David Wang
priority: normal
severity: normal
status: open
title: Logging cache not cleared properly when setting level
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48416/test.py

___
Python tracker 

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



[issue37223] test_io logs Exception ignored in: warnings

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13893
pull_request: https://github.com/python/cpython/pull/14029

___
Python tracker 

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



[issue37111] Logging - Inconsistent behaviour when handling unicode

2019-06-12 Thread Vinay Sajip


Vinay Sajip  added the comment:

> On the other hand, couldn't we use different default error handler?
"replace" or "backslashescape" seems better default error handler for the 
logging.

I've left it as is using the same rationale as I guess open() has at the moment 
- "Errors should never pass silently. Unless explicitly silenced".

--

___
Python tracker 

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



[issue37241] Item Count Error in Shelf

2019-06-12 Thread Jesse Bacon


Jesse Bacon  added the comment:

Eric,

The interpreter said something about passing a negative value when I converted 
the db.keys to a list.  I have attached a script in txt format and a Jupyter 
notebook for further analysis.  I apologize for posting images,  I just saw 
your note.  I'll go ahead and look at the shelve source while you determine if 
this information is sufficient. Thank you for your time.

--

___
Python tracker 

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



[issue37241] Item Count Error in Shelf

2019-06-12 Thread Jesse Bacon


Change by Jesse Bacon :


Added file: https://bugs.python.org/file48415/pbr37241_Jesse_Bacon.py.txt

___
Python tracker 

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



[issue37241] Item Count Error in Shelf

2019-06-12 Thread Jesse Bacon


Change by Jesse Bacon :


Added file: https://bugs.python.org/file48414/Python Proof.ipynb

___
Python tracker 

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



[issue30754] textwrap.dedent mishandles empty lines

2019-06-12 Thread sushma


sushma  added the comment:

I'm going to try and contribute this documentation fix.

--
nosy: +syadlapalli

___
Python tracker 

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



[issue37257] obmalloc: stop simple arena thrashing

2019-06-12 Thread Tim Peters


Change by Tim Peters :


--
type:  -> performance

___
Python tracker 

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



[issue37223] test_io logs Exception ignored in: warnings

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13892
pull_request: https://github.com/python/cpython/pull/14028

___
Python tracker 

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



[issue36689] docs: os.path.commonpath raises ValueError for different drives

2019-06-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

Flagging as Windows issue.

--
components: +Windows
nosy: +gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue37250] C files generated by Cython set tp_print to NULL: PyTypeObject.tp_print removed, replaced with tp_vectorcall_offset

2019-06-12 Thread Steve Dower


Steve Dower  added the comment:

> Any solution that we apply in Cython will require users to regenerate their 
> .c sources with a new Cython version in order to make it compile in Py3.8. 
> The main decision point in this ticket is: should they need to or not?

Considering Cython had a bug when it generated those sources (directly using a 
reserved field), then yes, users should have to regenerate with a fixed version.

> My point is that it makes no sense to justify bpo-37221 with the goal of not 
> breaking Cython modules, when at the same time another change (the one 
> discussed here) has already broken them.

I agree. Here's my distinction:

bpo-37221 breaks any user who correctly followed the documentation: 
https://docs.python.org/3.7/c-api/code.html#c.PyCode_New

This issue breaks users who did not follow the documentation: 
https://docs.python.org/3.7/c-api/typeobj.html#c.PyTypeObject.tp_print

--

___
Python tracker 

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



[issue37198] _parse_localename fail to parse 'en_IL'

2019-06-12 Thread hodai goldman


Change by hodai goldman :


--
keywords: +patch
pull_requests: +13891
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14027

___
Python tracker 

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



[issue37247] swap distutils build_ext and build_py commands to allow proper SWIG extension installation

2019-06-12 Thread Jeroen van den Hout


Jeroen van den Hout  added the comment:

Well, if I look at the source code build_ext explicitly calls for SWIG to 
handle interface files. Also, in case of commands like 'pip install ', 
the build sequence is predefined anyways, unless you explicitly define your own 
sequence in a custom command, in which case you are already tempering with 
default behavior.

That's why I argue that building and copying SWIG generated files correctly 
should be the default behavior.

--

___
Python tracker 

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



[issue37257] obmalloc: stop simple arena thrashing

2019-06-12 Thread Tim Peters


New submission from Tim Peters :

Scenario:  all arenas are fully used.  A program then runs a loop like:

while whatever:
p = malloc(n)
...
free(p)

At the top, a new arena has to be created, and a single object is taken out of 
a single pool.  At the bottom, that object is freed, so the arena is empty 
again, and so is returned to the system.  Which cycle continues so long as the 
loop runs.  Very expensive.

This is "something like" what happens in practice, and has been reported 
anecdotally for years, but I've never been clear on _exactly_ what programs 
were doing in such cases.  Neil S pointed out this recent report here:

https://mail.python.org/pipermail/python-dev/2019-February/156529.html

Which may or may not be relevant.  Inada?

The "fix" proposed there:

-if (nf == ao->ntotalpools) {
+if (nf == ao->ntotalpools && ao != usable_arenas) {

doesn't appeal to me, because it can lead to states where obmalloc never 
returns empty arenas, no matter how many pile up.  For example, picture a 
thousand arenas each with just one used pool.  The head of the arena list 
becomes free, so is left alone, but moves to the end of the list (which is 
sorted by number of free pools).  Then the new head of the list becomes free, 
and ditto.  On & on.  We're left with a list containing a thousand wholly 
unused arenas.

So I suggest instead:

+if (nf == ao->ntotalpools && ao->nextarena != NULL) {

That is, instead of exempting the head of the list, exempt the tail of the 
list.  In the example above, the first 999 arenas are returned to the system, 
but the last one remains in the list for reuse.  In general, the change would 
allow for at most one empty arena in the list.

We can't in general predict the future, but this would be enough to stop the 
thrashing in the specific scenario given at the top, with no apparent serious 
failure modes (potentially "wasting" one arena is minor).

--
assignee: tim.peters
components: Interpreter Core
messages: 345407
nosy: inada.naoki, nascheme, tim.peters
priority: normal
severity: normal
stage: test needed
status: open
title: obmalloc:  stop simple arena thrashing
versions: Python 3.9

___
Python tracker 

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



[issue37130] pathlib does not handle '..' directory

2019-06-12 Thread N.P. Khelili


N.P. Khelili  added the comment:

@Brett: Honestly I don't think it is the best way. But fact is:

nono@ACER ~ % cd /

nono@ACER / % python
Python 3.7.3 (default, Mar 26 2019, 21:43:19) 
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> from pathlib import Path
>>> Path('.') == Path('/')
False

In my humble and *very personal* opinion, this result could be understood in 
the case of
a PurePath (or some kind of system call free) object. But that is not what 
people expect
in the case of a 'normal' path...

I also think that one day we may see the rise of a new Os that wouldn't use . 
and  ..
The first Unix used 'd' for directory and 'dd' for directory's directory !
Those were hand-made links in a file system that otherwise had no concept of 
hierarchy...

I think each flavour should have a special_dirs variable (fact that linux and 
MsWin share
the same being an accident). And that the concept of a system-call free path 
implementation,
is fragile.

--

___
Python tracker 

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



[issue37250] C files generated by Cython set tp_print to NULL: PyTypeObject.tp_print removed, replaced with tp_vectorcall_offset

2019-06-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

(I forgot to state the obvious third option, which is: don't do anything and 
leave everything as it is now in beta-1.)

--

___
Python tracker 

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



[issue26140] inspect.iscoroutinefunction raises TypeError when checks Mock of function or coroutinefunction

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue37256] urllib.request.Request documentation erroneously refers to the "final two"

2019-06-12 Thread Alan De Smet


Alan De Smet  added the comment:

Oops, used to GitHub/GitLab, where Markdown is fair game. Sorry about that. :-)

--

___
Python tracker 

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



[issue37256] urllib.request.Request documentation erroneously refers to the "final two"

2019-06-12 Thread Alan De Smet


New submission from Alan De Smet :

In Doc/library/urllib.request.rst, in the documentation for the class 
`Request`, it says

```
   The final two arguments are only of interest for correct handling
   of third-party HTTP cookies:
```

However, three arguments follow, not two, and the last is not necessarily 
related to third-party cookie handling.

I believe replacing "final" with "next" will correct the sentence:

```
   The next two arguments are only of interest for correct handling
   of third-party HTTP cookies:
```

Verified present in the source releases for CPython 3.5.7, 3.6.8, 3.7.3, 
3.8.0b1. It is _not_ present in 2.7.16 (as the third parameter didn't yet 
exist, so the existing phrasing is correct.)

--
assignee: docs@python
components: Documentation
messages: 345403
nosy: Alan De Smet, docs@python
priority: normal
severity: normal
status: open
title: urllib.request.Request documentation erroneously refers to the "final 
two"
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37250] C files generated by Cython set tp_print to NULL: PyTypeObject.tp_print removed, replaced with tp_vectorcall_offset

2019-06-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

> they can equally easily zero out the entire structure and ignore it without 
> changing behavior on any Python 3.x.

Any solution that we apply in Cython will require users to regenerate their .c 
sources with a new Cython version in order to make it compile in Py3.8. The 
main decision point in this ticket is: should they need to or not? Everything 
else is just minor technicalities. (I didn't bring up this topic, but the 
question is up on the table now.)


> I have no problem changing the names of deprecated/reserved fields in 
> PyTypeObject between releases. Source compatibility guarantees do not extend 
> that far.

Fair enough, and I'm ok with letting CPython move forward cleanly and break 
things that are easily fixed on user side.

My point is that it makes no sense to justify bpo-37221 with the goal of not 
breaking Cython modules, when at the same time another change (the one 
discussed here) has already broken them. Either we find a striking 
justification for bpo-37221 that *excludes* Cython generated modules, or we 
take back *both* changes and restore full source code compatibility. Everything 
in between is just causing useless code churn and annoyance on all sides.

--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-12 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Traditionally on Unix, sockets are represented by file descriptors. File 
descriptors are small integers. (POSIX actually mandates the "small" part: 
whenever a new fd is created, the OS has to assign it the smallest integer 
value that's not already being used.)

So when select was designed, they decided to be "clever" and use a bitmask to 
represent the FD sets. If all your fds have values less than 64, then you can 
use a single 64-bit integer to represent any arbitrary subset of them, sweet, 
it's super efficient. It's also extremely weird. No other API cares about the 
actual integer value of an fd, they're just opaque tokens. Select is almost 
unique in being O(highest fd value).

Of course this microoptimization stopped making sense decades ago, so poll() 
was added. The big innovation with poll() is that it takes an array of 
descriptors like a normal function, instead of this wacky bitmask thing. So its 
O(number of fds), and it doesn't matter whether you're checking fd #1 or fd 
#1000.

EXCEPT windows has a totally different history. On Windows, sockets are 
represented as handles. And handles are just like fds, EXCEPT that handles are 
allowed to have arbitrary values; they didn't copy POSIX's weird (and 
expensive) rule about alwaysv using the smallest possible integer.

So when Windows went to implement select(), the bitmask optimization never made 
any sense at all – even if you only have 1 socket, its handle might be, like, 
0x9f57be3a or something. So you'd need a bitmask with 2**32 entries, which is 
silly.

So on Windows, select() is secretly poll(). They copied the FD_* macros for 
compatibility, but fd_set is really just an array of opaque values + an 
explicit length, and you can pass in as many or as few as you want.

I know this is mostly rehashing conclusions that are in the thread already but 
I thought it might make more sense to have it laid out all together.

--
nosy: +njs

___
Python tracker 

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



[issue37236] fix test_complex for Windows arm64

2019-06-12 Thread miss-islington


miss-islington  added the comment:


New changeset f72886a066ba7d3a3aa077cfc3cad2ca0b2cdbf6 by Miss Islington (bot) 
in branch '3.8':
bpo-37236: pragma optimize off for _Py_c_quot on Windows arm64 (GH-13983)
https://github.com/python/cpython/commit/f72886a066ba7d3a3aa077cfc3cad2ca0b2cdbf6


--
nosy: +miss-islington

___
Python tracker 

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



[issue26140] inspect.iscoroutinefunction raises TypeError when checks Mock of function or coroutinefunction

2019-06-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +lisroach, xtreak
versions: +Python 3.8, Python 3.9 -Python 3.5

___
Python tracker 

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



[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-06-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I will wait for a couple of days for suggestions and will raise a PR to check 
for __code__ to be a CodeType. Thanks.

--

___
Python tracker 

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



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

It's fine to document the current state. I don't think you should spend any 
time *changing* the API to "future-proof" it.

I am hoping that larger changes to the compiler implementation will happen 
before Python 4, which will make the whole API moot (including the "parser" 
module, which should be deprecated ASAP). The compiler is excluded from the ABI 
for a reason.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2019-06-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I guess the inconsistency in original report is fixed with issue28703 where 
both inspect.iscoroutinefunction and asyncio.iscoroutinefunction return False 
for Mock(). The fix is available from 3.5.3 . There is also async support for 
mock added in 3.8 with issue26467. I am closing this as part of triaging. Feel 
free to reopen this if I am missing something. Thanks.

# Python 3.5

python3.5
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> from unittest.mock import *
>>> asyncio.iscoroutinefunction(Mock())


# Master

./python.exe
Python 3.9.0a0 (heads/master:daf6262751, Jun 12 2019, 23:12:37)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from unittest.mock import Mock
>>> import asyncio, inspect
>>> inspect.iscoroutinefunction(Mock())
False
>>> asyncio.iscoroutinefunction(Mock())
False

--
nosy: +xtreak
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37236] fix test_complex for Windows arm64

2019-06-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13890
pull_request: https://github.com/python/cpython/pull/14024

___
Python tracker 

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



[issue37236] fix test_complex for Windows arm64

2019-06-12 Thread Steve Dower


Steve Dower  added the comment:


New changeset ff6bb0aa95259413f359d42410526ff0b4dccfb7 by Steve Dower (Paul 
Monson) in branch 'master':
bpo-37236: pragma optimize off for _Py_c_quot on Windows arm64 (GH-13983)
https://github.com/python/cpython/commit/ff6bb0aa95259413f359d42410526ff0b4dccfb7


--

___
Python tracker 

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



[issue37130] pathlib does not handle '..' directory

2019-06-12 Thread Brett Cannon


Brett Cannon  added the comment:

@Antoine: was there a design reason behind setting 'name' to '' when a Path 
objects was initialized with '.'? Is it to implicitly represent the current 
directory?

@N.P.: we will have to think through the implications of this as I don't know 
if normalizing to 'name' being '' is the best way to resolve this inconsistency.

--
nosy: +pitrou

___
Python tracker 

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



[issue37140] ctypes change made clang fail to build

2019-06-12 Thread Paul Monson


Paul Monson  added the comment:

I did some reading about parameter passing and it's still not clear to me 
whether https://bugs.python.org/issue37140 is a bug in CPython or whether the 
clang bindings were relying on incorrect parameter passing behavior to work.

The change in https://github.com/python/cpython/pull/13796 restores the 
previous behavior where Windows and non-Windows builds pass structs differently.

--

___
Python tracker 

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



[issue37225] Document BaseException constructor

2019-06-12 Thread Brett Cannon


Brett Cannon  added the comment:

Fair enough. I've changed the title to point out only BaseException needs its 
constructor documented as every other extension inherits from it and so its 
cascades down.

--
resolution: not a bug -> 
status: closed -> open
title: Signatures of Exceptions not documented -> Document BaseException 
constructor
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



[issue37239] Add headless development preset layout

2019-06-12 Thread Paul Monson


Change by Paul Monson :


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



[issue37239] Add headless development preset layout

2019-06-12 Thread Paul Monson


Paul Monson  added the comment:

Thanks for the feedback Steve

Looking at the differences between the change I proposed and the nuget package 
I agree that "--preset-nuget --include-..." is a better approach.

Closing this issue and the pull request.

--

___
Python tracker 

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



[issue37201] fix test_distutils failures for Windows ARM64

2019-06-12 Thread miss-islington


miss-islington  added the comment:


New changeset bb3e8a68b2554b2bd94cf0cd9a0311f4561c1a25 by Miss Islington (bot) 
in branch '3.8':
bpo-37201: fix test_distutils failures for Windows ARM64 (GH-13902)
https://github.com/python/cpython/commit/bb3e8a68b2554b2bd94cf0cd9a0311f4561c1a25


--
nosy: +miss-islington

___
Python tracker 

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



[issue37239] Add headless development preset layout

2019-06-12 Thread Steve Dower


Steve Dower  added the comment:

In fact, any reason you can't use "--preset-nuget --include-..."? to add in 
whatever else you need? They are designed to compose like this deliberately.

--

___
Python tracker 

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



[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

2019-06-12 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Lukasz, please don't rush.
Applied PR makes asyncio more stable, not worse.

I see the only way to make it perfect: get rid of weak refs entirely.
Otherwise there is always a chance to catch GC run and set element deletion on 
iteration over the set. Sorry, that's how weakrefs work.

There is such possibility: call asyncio._unregister_task() explicitly when the 
task is done (finished with success or failure or cancelled).
By this, we can replace weakset with a regular set.

The only requirement is that task should call this _unregister_task() method.
No public API change is needed.

At the time of work on 3.7, Yuri and I considered this implementation but 
rejected it because there was a (very low) chance that somebody may implement 
own task, register custom task factory and don't call _unregister_task().

I never see a code that implements asyncio task from scratch, people always 
reuse existing asyncio.Task.

So, maybe the idea is not such bad. It can be implemented easily. I'm 
volunteered to make a PR with the proposal demonstration in a day or two, 
depending on my free time.

--

___
Python tracker 

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



  1   2   3   >