[issue36597] Travis CI: doctest failure

2019-04-11 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue27860] Improvements to ipaddress module

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12701

___
Python tracker 

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



[issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses

2019-04-11 Thread Michal


Michal  added the comment:

I would like to fix this problem if nobody is against that. I stumbled upon the 
very same thing recently and I think it would be a nice opportunity to 
contribute.

--
nosy: +mic4ael

___
Python tracker 

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



[issue13282] the table of contents in epub file is too long

2019-04-11 Thread Ben Creasy


Ben Creasy  added the comment:

Not sure if this is filed elsewhere, but the contents on the page at 
https://docs.python.org/3/contents.html could really use a collapse button, and 
could start automatically collapsed. The first half of the page is "What's new" 
for the past few Python versions and the Changelog.

I looked around for an issue in the upstream tracker and didn't see one 
https://github.com/sphinx-doc/sphinx/issues - I don't know much about Sphinx 
but it seems like it should be possible with a bit of Javascript and CSS.

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

Well, same problem with Sphinx 1.8.5. No idea why the job started to fail.

--

___
Python tracker 

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



[issue36416] bytes.rpartition bug in online documentation

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset efc48701496ef020e896fc6a91af3c0c612ac69a by Inada Naoki 
(pewscorner) in branch 'master':
bpo-36416: Correct bytes.rpartition documentation (GH-12543)
https://github.com/python/cpython/commit/efc48701496ef020e896fc6a91af3c0c612ac69a


--
nosy: +inada.naoki

___
Python tracker 

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



[issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file

2019-04-11 Thread Carl Harris


Change by Carl Harris :


--
nosy: +hitbox

___
Python tracker 

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



[issue36580] unittest.mock does not understand dataclasses

2019-04-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Below is a even more simpler reproducer without dataclasses. 'name' is not 
listed as a class attribute in dir(Person) since it's not defined with a value 
but 'age' is with zero. Python seems to not to list something not defined with 
a value in declaration as a class attribute in dir().  Hence 'name' is not 
copied when Person is used as spec. spec only does attribute access validation. 
autospeccing [0] can be used for signature validation. The fields for 
dataclasses are defined in __dataclass_fields__ but I am not sure of special 
casing copying __dataclass_fields__ fields along with dir for dataclasses when 
normal Python doesn't list them as class attributes. If needed I would like 
dir(dataclass) to be changed to include __dataclass_fields__. I would propose 
closing as not a bug.

# ../backups/dataclass_dir.py

from unittest.mock import Mock

class Person:
name: str
age: int = 0

def foo(self):
pass

person_mock = Mock(spec=Person)
print(dir(Person))
print(dir(person_mock))
person_mock.foo
print("age" in dir(person_mock))
print("name" in dir(person_mock))

$ cpython git:(master) ./python.exe ../backups/dataclass_dir.py
['__annotations__', '__class__', '__delattr__', '__dict__', '__dir__', 
'__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', 
'__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', 
'__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
'__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'age', 'foo']

['__annotations__', '__class__', '__delattr__', '__dict__', '__dir__', 
'__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', 
'__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', 
'__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
'__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'age', 
'assert_any_call', 'assert_called', 'assert_called_once', 
'assert_called_once_with', 'assert_called_with', 'assert_has_calls', 
'assert_not_called', 'attach_mock', 'call_args', 'call_args_list', 
'call_count', 'called', 'configure_mock', 'foo', 'method_calls', 
'mock_add_spec', 'mock_calls', 'reset_mock', 'return_value', 'side_effect']
True
False


[0] https://docs.python.org/3/library/unittest.mock.html#autospeccing

--

___
Python tracker 

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



[issue13282] the table of contents in epub file is too long

2019-04-11 Thread Ben Creasy


Change by Ben Creasy :


--
nosy: +jcrben

___
Python tracker 

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



[issue33722] Document builtins in mock_open

2019-04-11 Thread Jay Crotts


Change by Jay Crotts :


--
resolution:  -> rejected
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



[issue36598] mock side_effect should be checked for iterable not callable

2019-04-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I am not sure if the snippets you are referring to are from testing-cabal/mock 
repo which could be different from master branch. Current code is at [0]

if effect is not None:
if _is_exception(effect):
raise effect
elif not _callable(effect):
result = next(effect)
if _is_exception(result):
raise result
else:
result = effect(*args, **kwargs)

if result is not DEFAULT:
return result

> This works correctly for iterables (such as lists) that are not defined as 
> generators.
However, if one defined a generator as a function this would not work.

This does seem to work for generator function as below. Sorry, maybe I am 
getting it wrong with respect to terminologies and understanding the issue. Can 
you add a short script around what you are expecting?

$ cat ../backups/bpo36598.py
from unittest.mock import patch

def gen(i):
while i < 5:
yield i
i += 1

def foo():
return 1

with patch('__main__.foo', side_effect=gen(0)):
for _ in range(2):
print(foo())
for _ in range(2):
print(foo())
$ ./python.exe ../backups/bpo36598.py
0
1
2
3

[0] 
https://github.com/python/cpython/blob/a9bd8925c7fa50dd3cfab125b824ec192133ef49/Lib/unittest/mock.py#L1043

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

> As far as reading your first report, this is happen only in your local
environment.

See the beginning of my first message, the doctest prevents me to merge a PR. 
But I tested on the master branch without my change, and I get the same issue 
locally, and the issues seems to be unrelated to my change.

"""
On my https://github.com/python/cpython/pull/12770 the doctest job of Travis CI 
failed with:

https://travis-ci.org/python/cpython/jobs/518572326
"""

--

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for netstat

2019-04-11 Thread Michael Felt


Change by Michael Felt :


--
pull_requests: +12704

___
Python tracker 

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



[issue36600] re-enable test in nntplib

2019-04-11 Thread Marcin Niemira


New submission from Marcin Niemira :

Disabled test in not failing anymore.

```./python -m test -u all -v test_nntplib -m test_article_head_body
== CPython 3.8.0a3+ 
(heads/feature/pep-572-improvement-in-smtplib-dirty:f4efa312d1, Apr 8 2019, 
21:0) [GCC 7.3.0]
== Linux-4.15.0-46-generic-x86_64-with-glibc2.26 little-endian
== cwd: /home/n0npax/workspace/cpython/build/test_python_15162
== CPU count: 4
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 1.13 [1/1] test_nntplib
test_article_head_body (test.test_nntplib.NetworkedNNTPTests) ... ok
test_article_head_body (test.test_nntplib.NetworkedNNTP_SSLTests) ... ok

--

Ran 2 tests in 7.172s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 7 sec 282 ms
Tests result: SUCCESS
```

--
messages: 339955
nosy: Marcin Niemira
priority: normal
severity: normal
status: open
title: re-enable test in nntplib

___
Python tracker 

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



[issue36601] signals can be caught by any thread

2019-04-11 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Also note that the documentation of the signal module already has the correct 
wording:

Python signal handlers are always executed in the main Python thread, even if 
the signal was received in another thread.

--

___
Python tracker 

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



[issue1583] Patch for signal.set_wakeup_fd

2019-04-11 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> signalmodule.c has a hack to limit it to the main thread.

The Python signal handler always runs in the main thread, but the signal can be 
caught by any thread. In other words, trip_signal() can be run by any thread.

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

> See the beginning of my first message, the doctest prevents me to merge a PR.


You did not show travis build link which failed other than "obj dead or 
exiting" error.
Don't all other errors happened only on your environment?  If no, please link 
to travis build link.

As far as I can confirm now, only "obj dead or exiting" error is problem in 
Travis.


> But I tested on the master branch without my change, and I get the same issue 
> locally, and the issues seems to be unrelated to my change.

I suspect your environment (locale and venv used to run doctest), not your 
changes.

> """
> On my https://github.com/python/cpython/pull/12770 the doctest job of Travis 
> CI failed with:
> 
> https://travis-ci.org/python/cpython/jobs/518572326
> """

Only "obj dead or exiting" happened in the job.

--
nosy:  -xtreak

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12703

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12705

___
Python tracker 

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



[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-11 Thread Anders Hovmöller

Anders Hovmöller  added the comment:

Just as a comparison, sed does the 3.6 thing:

> echo foo | sed 's/\(.*\)/x\1y/g'
xfooy

--

___
Python tracker 

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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pitrou

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

On Thu, Apr 11, 2019 at 5:19 PM STINNER Victor  wrote:
> Really? When I click on https://travis-ci.org/python/cpython/jobs/518572326 
> (the second link of my first message), I still see:
>
> """
> Warning, treated as error:
> **
> File "library/unittest.mock-examples.rst", line ?, in default
> Failed example:
> m.one().two().three()
> Expected:
> 
> Got:
> obj dead or exiting
> 
> Makefile:44: recipe for target 'build' failed
> make[1]: *** [build] Error 2
> """
>
> This error comes from Travis CI.

It is "obj dead or exiting" error.  I didn't say it is caused by your
environment.
It is only error happened in Travis.

>
> > I suspect your environment (locale and venv used to run doctest), not your 
> > changes.
>
> You can ignore the date failure, but how is the following error related to my 
> environment?
>
> """
> File "library/collections.rst", line 914, in default
> Failed example:
> p._asdict()
> Expected:
> {'x': 11, 'y': 22}
> Got:
> OrderedDict([('x', 11), ('y', 22)])

namedtuple._asdict() changed to return dict instead of OrderedDict.
If your venv is created before the change, this error can be happened.

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

I think PR-12776 fixed "obj dead or exiting" error.
https://travis-ci.org/python/cpython/jobs/518656385

--

___
Python tracker 

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



[issue36599] weakref document says dict order is unstable

2019-04-11 Thread Inada Naoki

New submission from Inada Naoki :

https://docs.python.org/3/library/doctest.html#warnings

"For example, when printing a dict, Python doesn’t guarantee that the key-value 
pairs will be printed in any particular order,"

This example should be rewritten with set.

--
assignee: docs@python
components: Documentation
messages: 339952
nosy: docs@python, inada.naoki
priority: normal
severity: normal
status: open
title: weakref document says dict order is unstable
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



[issue36575] Use _PyTime_GetPerfCounter() in lsprof

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


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



[issue1583] Patch for signal.set_wakeup_fd

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

Please don't discuss on closed issues. Either reopen the issue or open a new 
issue.

--
nosy: +vstinner

___
Python tracker 

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



[issue36560] test_functools leaks randomly 1 memory block

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

Patch making check on memory block leaks stricter:

diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py
index 235d6bfd3a..dfadabdef6 100644
--- a/Lib/test/libregrtest/refleak.py
+++ b/Lib/test/libregrtest/refleak.py
@@ -130,7 +130,7 @@ def dash_R(ns, the_module, test_name, test_func):
 failed = False
 for deltas, item_name, checker in [
 (rc_deltas, 'references', check_rc_deltas),
-(alloc_deltas, 'memory blocks', check_rc_deltas),
+(alloc_deltas, 'memory blocks', check_fd_deltas),
 (fd_deltas, 'file descriptors', check_fd_deltas)
 ]:
 # ignore warmup runs


Using this patch, at least the following tests fail:

* test_asyncio
* test_code
* test_collections
* test_contextlib
* test_contextlib_async
* test_ctypes
* test_functools
* test_multiprocessing_forkserver
* test_multiprocessing_spawn
* test_regrtest
* test_statistics
* test_typing
* test_xml_etree_c

I didn't analyze why yet. I guess that they are not real memory leaks, but more 
minor issue in the code checking for memory leaks. Sadly, it seems like such 
small glitch can cause a whole Refleak buildbot worker to fail :-(

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

> It seems it is caused by non English locale.

Right, but why did it start to fail since yesterday?


> You may run doctest with existing Python, not Python 3.8.

I used the command from the .travis.yml job: "... make -C Doc/ PYTHON=../python 
"...". It explicitly picks the Python it just compiled.

Why would we like to check the doctests using a random Python version, whereas 
it's Python 3.8 documentation?

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 57b1a2862a99677f09614e9e456d36aae9ddd87c by Inada Naoki in branch 
'master':
bpo-36597: fix random doctest failure (GH-12776)
https://github.com/python/cpython/commit/57b1a2862a99677f09614e9e456d36aae9ddd87c


--

___
Python tracker 

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



[issue35070] test_posix fails on macOS 10.14 Mojave

2019-04-11 Thread Dave Page


Dave Page  added the comment:

I'm seeing what appears to my uneducated eyes to be the same failure on Mojave, 
on a brand new machine which is entirely standalone:

12:16:00 0:00:07 load avg: 4.24 [133/416/1] test_posix failed
12:16:00 test test_posix failed -- Traceback (most recent call last):
12:16:00   File 
"/Users/jenkins/workspace/python-macos-build/Python-3.7.2/Lib/test/test_posix.py",
 line 1026, in test_getgrouplist
12:16:00 self.assertIn(group, posix.getgrouplist(user, group))
12:16:00 OSError: [Errno 25] Inappropriate ioctl for device
12:16:00 0:00:07 load avg: 4.24 [134/416/1] test_ast passed

System info:

pgabf-macos2:Python-3.7.2 jenkins$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

pgabf-macos2:Python-3.7.2 jenkins$ system_profiler SPSoftwareDataType
Software:

System Software Overview:

  System Version: macOS 10.14.3 (18D42)
  Kernel Version: Darwin 18.2.0
  Boot Volume: Macintosh HD
  Boot Mode: Normal
  Computer Name: pgabf-macos2
  User Name: Jenkins (jenkins)
  Secure Virtual Memory: Enabled
  System Integrity Protection: Enabled
  Time since boot: 10 days 1:30

Happy to provide any additional info or try out patches if anyone wants.

--
nosy: +Dave Page

___
Python tracker 

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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread SilentGhost


SilentGhost  added the comment:

Is the behaviour you're proposing any different from using Path.rglob('*')?

--
nosy: +SilentGhost

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a release blocker to not forget it. I disabled the Travis 
CI doctest job to repair the CI, but we have to investigate why it started to 
fail yesterday.

--
nosy: +lukasz.langa
priority: normal -> release blocker

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

8 hours ago, the job still passed at the top of the the master branch (commit 
a9bd8925c7fa50dd3cfab125b824ec192133ef49):

https://travis-ci.org/python/cpython/jobs/518281237

"Successfully installed Jinja2-2.10.1 MarkupSafe-1.1.1 Pygments-2.3.1 
Sphinx-2.0.1 alabaster-0.7.12 babel-2.6.0 blurb-1.0.7 certifi-2019.3.9 
chardet-3.0.4 docutils-0.14 idna-2.8 imagesize-1.1.0 packaging-19.0 
pyparsing-2.4.0 python-docs-theme-2018.7 pytz-2019.1 requests-2.21.0 six-1.12.0 
snowballstemmer-1.2.1 sphinxcontrib-applehelp-1.0.1 sphinxcontrib-devhelp-1.0.1 
sphinxcontrib-htmlhelp-1.0.1 sphinxcontrib-jsmath-1.0.1 
sphinxcontrib-qthelp-1.0.2 sphinxcontrib-serializinghtml-1.1.3 urllib3-1.24.1"
...
PATH=./venv/bin:$PATH sphinx-build -b doctest -d build/doctrees -D 
latex_elements.papersize= -q -W -j4 -W . build/doctest 
...
The command "xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W -j4" 
doctest" exited with 0.

---

6 hours ago, it failed:

https://travis-ci.org/python/cpython/jobs/518572326

Successfully installed Jinja2-2.10.1 MarkupSafe-1.1.1 Pygments-2.3.1 
Sphinx-2.0.1 alabaster-0.7.12 babel-2.6.0 blurb-1.0.7 certifi-2019.3.9 
chardet-3.0.4 docutils-0.14 idna-2.8 imagesize-1.1.0 packaging-19.0 
pyparsing-2.4.0 python-docs-theme-2018.7 pytz-2019.1 requests-2.21.0 six-1.12.0 
snowballstemmer-1.2.1 sphinxcontrib-applehelp-1.0.1 sphinxcontrib-devhelp-1.0.1 
sphinxcontrib-htmlhelp-1.0.1 sphinxcontrib-jsmath-1.0.1 
sphinxcontrib-qthelp-1.0.2 sphinxcontrib-serializinghtml-1.1.3 urllib3-1.24.1

Warning, treated as error: (...)

--

In the 2 builds, pip installed the the same Python modules versions.

I compared the raw logs of the 2 builds. In short, they are the same.

Maybe the job already failed previously, but only randomly?

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

> > It seems it is caused by non English locale.
>
> Right, but why did it start to fail since yesterday?

Is it an error start to fail since yesterday?
As far as reading your first report, this is happen only in your local
environment.

> > You may run doctest with existing Python, not Python 3.8.
>
> I used the command from the .travis.yml job: "... make -C Doc/ 
> PYTHON=../python "...". It explicitly picks the Python it just compiled.

This error is in your environment too.  Maybe you re-used old venv?

>
> Why would we like to check the doctests using a random Python version, 
> whereas it's Python 3.8 documentation?
>

Because it "doctest".  Python behavior (repr) can be changed.
Python 3.8 replaces some OrderedDict usage with regular dict.

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset adff01e81d291c698581eadd693caa43ae5c78ac by Victor Stinner in 
branch 'master':
bpo-36597: Disable Travis CI doctest job (GH-12775)
https://github.com/python/cpython/commit/adff01e81d291c698581eadd693caa43ae5c78ac


--

___
Python tracker 

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



[issue36416] bytes.rpartition bug in online documentation

2019-04-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12708

___
Python tracker 

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



[issue36575] Use _PyTime_GetPerfCounter() in lsprof

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 536a35b3f14888999f1ffa5be7239d0c26b73d7a by Inada Naoki in branch 
'master':
bpo-36575: lsprof: Use _PyTime_GetPerfCounter() (GH-8378)
https://github.com/python/cpython/commit/536a35b3f14888999f1ffa5be7239d0c26b73d7a


--

___
Python tracker 

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



[issue36593] Trace function interferes with MagicMock isinstance?

2019-04-11 Thread Ned Batchelder


Ned Batchelder  added the comment:

BTW, this started as a bug against coverage.py: 
https://github.com/nedbat/coveragepy/issues/795

There are some more details there, including the fact that it must be a Python 
trace function; a C trace function seems not to cause the problem.

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset ac31da8f3710f9f9b8dbb4c36b2108fb1e5b4a48 by Inada Naoki in branch 
'3.7':
bpo-36597: fix random doctest failure (GH-12778)
https://github.com/python/cpython/commit/ac31da8f3710f9f9b8dbb4c36b2108fb1e5b4a48


--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

Currently, I'm using the following patch to try to detect bpo-33803 bug using 
my GC object debugger. It's still a work-in-progress.

diff --git a/Lib/site.py b/Lib/site.py
index ad1146332b..e184080b19 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -638,3 +638,8 @@ def _script():

 if __name__ == '__main__':
 _script()
+
+if 'dev' in sys._xoptions:
+import gc
+gc.enable_object_debugger(100)
+#gc.set_threshold(5)
diff --git a/Python/hamt.c b/Python/hamt.c
index 67af04c437..67da8ec22c 100644
--- a/Python/hamt.c
+++ b/Python/hamt.c
@@ -2478,8 +2478,10 @@ hamt_alloc(void)
 if (o == NULL) {
 return NULL;
 }
+#if 0
 o->h_count = 0;
 o->h_root = NULL;
+#endif
 o->h_weakreflist = NULL;
 PyObject_GC_Track(o);
 return o;

--

___
Python tracker 

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



[issue34652] never enable lchmod on Linux

2019-04-11 Thread Joshua Root


Joshua Root  added the comment:

The follow-up fix (AC_CHECK_FUNC -> AC_CHECK_FUNCS) still needs to be 
backported to 2.7. Currently the lack of it causes lchmod to be disabled on all 
platforms, not just Linux.

--
nosy: +jmr

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

On Thu, Apr 11, 2019 at 11:49 AM STINNER Victor  wrote:
>
> File "library/unittest.mock-examples.rst", line ?, in default
> Failed example:
> m.one().two().three()
> Expected:
> 
> Got:
> obj dead or exiting
> 

I'm not sure where "obj is dead or exiting" came from.

> File "library/datetime.rst", line 686, in default
> Failed example:
> d.strftime("%A %d. %B %Y")
> Expected:
> 'Monday 11. March 2002'
> Got:
> 'lundi 11. mars 2002'

It seems it is caused by non English locale.

> File "library/collections.rst", line 914, in default
> Failed example:
> p._asdict()
> Expected:
> {'x': 11, 'y': 22}
> Got:
> OrderedDict([('x', 11), ('y', 22)])

You may run doctest with existing Python, not Python 3.8.

> File "library/unittest.mock.rst", line ?, in default
> Failed example:
> mock.call_args.args
> Expected:
> (3, 4)
> Got:
> args

I'm not sure about this.
-- 
Inada Naoki  

--
nosy: +inada.naoki

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2b00db68554422ec37faba2a80179a0172df6349 by Victor Stinner in 
branch 'master':
bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)
https://github.com/python/cpython/commit/2b00db68554422ec37faba2a80179a0172df6349


--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12707

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset b3c92c6ae923ffb2b9ac5f80b28ecd689de48662 by Inada Naoki in branch 
'master':
bpo-36597: fix weakref example code (GH-12779)
https://github.com/python/cpython/commit/b3c92c6ae923ffb2b9ac5f80b28ecd689de48662


--

___
Python tracker 

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



[issue36599] doctest document says dict order is unstable

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


--
title: weakref document says dict order is unstable -> doctest document says 
dict order is unstable

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


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



[issue36601] signals can be caught by any thread

2019-04-11 Thread Jeroen Demeyer


New submission from Jeroen Demeyer :

Because of some discussion that is happening on #1583 I noticed this bit of 
code in the OS-level signal handler (set by the C function sigaction() or 
signal()):

static void
signal_handler(int sig_num)
{
/* See NOTES section above */
if (getpid() == main_pid)
{
trip_signal(sig_num);
}

The check getpid() == main_pid is claimed to check for the main *thread* but in 
fact it's checking the process ID, which is the same for all threads. So as far 
as I can tell, this condition is always true.

This code essentially goes back to 1994 (commit bb4ba12242), so it may have 
been true at that time that threads were implemented as processes and that 
getpid() returned a different value for different threads.

Note that this code refers to receiving a signal from the OS. In Python, it's 
always handled (by the function registered by signal.signal) by the main 
thread. But the current behaviour actually makes sense, so we should just 
remove the superfluous check and fix the comments in the code.

--
messages: 339958
nosy: Rhamphoryncus, jdemeyer
priority: normal
severity: normal
status: open
title: signals can be caught by any thread

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12709

___
Python tracker 

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



[issue36600] re-enable test in nntplib

2019-04-11 Thread Marcin Niemira


Change by Marcin Niemira :


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

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

"Object dead or exiting" is a less frequent random error with doctest. I am not 
sure from where it occurs but occurs for different tests at different times and 
is overlooked in Travis since the next runs are fine.

Sample old builds : 

https://travis-ci.org/python/cpython/jobs/517606752
https://travis-ci.org/python/cpython/jobs/510847596

--
nosy: +xtreak

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

https://github.com/python/cpython/blob/master/Doc/library/weakref.rst#finalizer-objects

>>> obj = Object()
>>> weakref.finalize(obj, print, "obj dead or exiting")  #doctest:+ELLIPSIS

>>> exit()   #doctest:+SKIP
obj dead or exiting

Note that "#doctest:+SKIP".  print("obj dead or exiting") is called after 
weakref test.
This may caused random doctest fail.

--

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12706

___
Python tracker 

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



[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-11 Thread Anders Hovmöller

Anders Hovmöller  added the comment:

This was a really bad idea in my opinion. We just found this and we have no way 
to know how this will impact production. It's really absurd that 

re.sub('(.*)', r'foo', 'asd')

is "foo" in python 1 to 3.6 but 'foofoo' in python 3.7.

--
nosy: +Anders.Hovmöller

___
Python tracker 

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



[issue36416] bytes.rpartition bug in online documentation

2019-04-11 Thread miss-islington


miss-islington  added the comment:


New changeset 04b114eede82c7ffd7b3d9b40e8bf707780b022b by Miss Islington (bot) 
in branch '3.7':
bpo-36416: Correct bytes.rpartition documentation (GH-12543)
https://github.com/python/cpython/commit/04b114eede82c7ffd7b3d9b40e8bf707780b022b


--
nosy: +miss-islington

___
Python tracker 

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



[issue36416] bytes.rpartition bug in online documentation

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


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



[issue34060] regrtest: log "CPU usage" on Windows

2019-04-11 Thread STINNER Victor


Change by STINNER Victor :


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



[issue36601] signals can be caught by any thread

2019-04-11 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4c409beb4c360a73d054f37807d3daad58d1b567 by Victor Stinner in 
branch 'master':
bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)
https://github.com/python/cpython/commit/4c409beb4c360a73d054f37807d3daad58d1b567


--

___
Python tracker 

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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue36597] Travis CI: doctest failure

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

> You did not show travis build link which failed other than "obj dead or 
> exiting" error.

Really? When I click on https://travis-ci.org/python/cpython/jobs/518572326 
(the second link of my first message), I still see:

"""
Warning, treated as error:
**
File "library/unittest.mock-examples.rst", line ?, in default
Failed example:
m.one().two().three()
Expected:

Got:
obj dead or exiting

Makefile:44: recipe for target 'build' failed
make[1]: *** [build] Error 2
"""

This error comes from Travis CI.

> I suspect your environment (locale and venv used to run doctest), not your 
> changes.

You can ignore the date failure, but how is the following error related to my 
environment?

"""
File "library/collections.rst", line 914, in default
Failed example:
p._asdict()
Expected:
{'x': 11, 'y': 22}
Got:
OrderedDict([('x', 11), ('y', 22)])
"""

I used the same commands than .travis.yml. If we are unable to get the same 
environment than in Travis CI, we have a big problem.

I agree to ignore the locale, this is a lower priority issue.

--

___
Python tracker 

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



[issue36469] Stuck during interpreter exit, attempting to take the GIL

2019-04-11 Thread Remy Noel


Remy Noel  added the comment:

@eric.snow Unless you confirm there is no way to figure out which thread is/was 
holding the GIL from a debugging session on the running process, I'll get rid 
of it at the end of the week.

Should i close the ticket then or will you do it ?

Thanks.

--

___
Python tracker 

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



[issue32949] Simplify "with"-related opcodes

2019-04-11 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Laurie Opperman


New submission from Laurie Opperman :

Currently, 'pathlib.Path.iterdir' can only list the contents of the instance 
directory. It is common to also want the contents of subdirectories recursively.

The proposal is for 'pathlib.Path.iterdir' to have an argument 'recursive' 
which when 'True' will cause 'iterdir' to yield contents of subdirectories 
recursively.

This would be trivial to implement as 'iterdir' can simply yield from 
subdirectories' 'iterdir'.

A decision would have to be made whether to continue to yield the 
subdirectories, or skip them. Another decision would be for whether each path 
should be resolved before checking if it is a directory to be recursed into.

--
components: Library (Lib)
messages: 339959
nosy: Epic_Wink
priority: normal
severity: normal
status: open
title: Recursive directory list with pathlib.Path.iterdir
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue36593] Trace function interferes with MagicMock isinstance?

2019-04-11 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

I think I got to this. See issue12370 (Use of super overwrites use of __class__ 
in class namespace) . msg138712 suggests a workaround to alias super at the 
module level. unittest.mock has the below line and NonCallableMock has 
__class__ defined as a property which is not set when set trace is used since 
the linked commit in 3.7.2 uses super() is somehow executed by settrace since 
it's in __delattr__ and not in a code path executed by user code?

Looking at the unittest.mock code super is not used anywhere but _safe_super is 
used which I hope is for this reason. So this is not a case with MagicMock only 
but rather a case with anything that inherits from NonCallableMock i.e. Mock, 
MagicMock etc. This is not a problem with import being made before the trace is 
set as you mentioned so set trace does something that exposes this issue

https://github.com/python/cpython/blob/536a35b3f14888999f1ffa5be7239d0c26b73d7a/Lib/unittest/mock.py#L48

# Workaround for issue #12370
# Without this, the __class__ properties wouldn't be set correctly
_safe_super = super

Sample program in issue12370. Add set trace SuperClass with using super() fails 
and passes without set trace for super(). Whereas SafeSuperClass that uses 
_safe_super (module level alias to super) passes both cases irrespective of 
usage of set trace. Nick coughlan added a message so that unittest.mock should 
use _safe_super in https://bugs.python.org/issue12370#msg161704

import sys

_safe_super = super

def trace(frame, event, arg):
return trace

if len(sys.argv) > 1:
sys.settrace(trace)

class SuperClass(object):

def __init__(self):
super().__init__()

@property
def __class__(self):
return int

class SafeSuperClass(object):

def __init__(self):
_safe_super(SafeSuperClass, self).__init__()

@property
def __class__(self):
return int

print(isinstance(SuperClass(), int))
print(isinstance(SafeSuperClass(), int))


Running above code with trace and without trace

➜  cpython git:(master) ✗ ./python.exe /tmp/buz.py
True
True
➜  cpython git:(master) ✗ ./python.exe /tmp/buz.py 1
False
True


There is a test for the above in Lib/test/test_super.py at 
https://github.com/python/cpython/blob/4c409beb4c360a73d054f37807d3daad58d1b567/Lib/test/test_super.py#L87

Add a trace as below in test_super.py at the top and the test case fails

import sys

def trace(frame, event, arg):
return trace

sys.settrace(trace)


➜  cpython git:(master) ✗ ./python.exe Lib/test/test_super.py
F
==
FAIL: test_various___class___pathologies (__main__.TestSuper)
--
Traceback (most recent call last):
  File "Lib/test/test_super.py", line 100, in test_various___class___pathologies
self.assertEqual(x.__class__, 413)
AssertionError: .X'> != 413

--
Ran 21 tests in 0.058s

FAILED (failures=1)


The patch for this issue would be to use _safe_super instead of super() or to 
fallback to object() in the previous case that doesn't seemed to have suffered 
from this case. I can try to make a PR with tests. Added Michael for 
confirmation.


diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 8684f1dfa5..0e77f0e489 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -739,7 +739,7 @@ class NonCallableMock(Base):

 obj = self._mock_children.get(name, _missing)
 if name in self.__dict__:
-super().__delattr__(name)
+_safe_super(NonCallableMock, self).__delattr__(name)
 elif obj is _deleted:
 raise AttributeError(name)
 if obj is not _missing:

--
nosy: +michael.foord

___
Python tracker 

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



[issue36588] change sys.platform() to just "aix" for AIX

2019-04-11 Thread Michael Felt


Change by Michael Felt :


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

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

I'm using Mojave.  I don't have regression.

$ /usr/local/bin/python2 x.py  # Homebrew python@2
1.681729

$ /usr/bin/python x.py  # System python2
1.891549

Could someone using High Sierra or Sierra test it?

x.py is test script in https://bugs.python.org/issue32616#msg310395

--

___
Python tracker 

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



[issue16712] collections.abc.Sequence should not provide __reversed__

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

I close this issue because Reversible ABC was added.

It's sad that Sequnce.__reversed__ is just makes reversed() slow without any 
benefit.

But removing it without breaking backward compatibility is not easy for now.

--
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue18697] Unify arguments names in Unicode object C API documentation

2019-04-11 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



[issue2281] Enhanced cPython profiler with high-resolution timer

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

I think https://bugs.python.org/issue36575 fixed this.

--
nosy: +inada.naoki
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-04-11 Thread STINNER Victor


Change by STINNER Victor :


--
title: libgcc_s.so.1 must be installed for pthread_cancel to work -> io.IOBase 
destructor silence I/O error on close() by default

___
Python tracker 

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



[issue36604] Add recipe to itertools

2019-04-11 Thread Bjorn Madsen


New submission from Bjorn Madsen :

I would like to add a recipe to the itertools documentation (if it belongs 
there?)

The recipe presents a method to generate set(powerset([iterable])) in a 
fraction of the runtime. I thought others might find this method helpful and 
pushed it to github under MIT license.

The recipe is available with test here: 
https://github.com/root-11/python_recipes

--
components: Extension Modules
messages: 339984
nosy: Bjorn.Madsen
priority: normal
severity: normal
status: open
title: Add recipe to itertools
type: enhancement

___
Python tracker 

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



[issue32451] python -m venv activation issue when using cygwin on windows

2019-04-11 Thread Andrew Stanton


Andrew Stanton  added the comment:

I dont think this is a Cygwin only problem, as this is happening to me when 
running WSL (Windows subsystem for Linux). I can run Scripts\Activate.ps1 from 
powershell, Scripts\activate.bat from cmd, but running scripts/activate from 
wsl reports this same error.

--
nosy: +astanton1978

___
Python tracker 

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



[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2019-04-11 Thread Antony Lee


Change by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue36378] Add support to load from paths to json.load

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

I close this because PR is closed already, and same idea
was discussed on -ideas ML.

--
nosy: +inada.naoki
resolution:  -> rejected
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] libgcc_s.so.1 must be installed for pthread_cancel to work

2019-04-11 Thread STINNER Victor


STINNER Victor  added the comment:

I looked at this old issue. First of all, "bug.py" filename is accurate: this 
program contains a bug, but it's non-obvious.

* the main thread opens a file which gets the file descriptor 3
* a new thread is spawns which indirectly closes this file descriptor on: 
sys.stdout.close()
* the main thread is not aware that the file has been closed, and so will try 
to close the same file descriptor 3 sometime during Python shutdown
* then, sometimes, the glibc fails with an internal error because the main 
thread closed a file descriptor which was just opened by the other thread to 
implement thread cancellation: that logs "libgcc_s.so.1 must be installed for 
pthread_cancel to work" and calls abort()

Note: the Python file object remains alive until the "t" local variable is 
cleared, since "t.fh" contains a strong reference to the file object.

Again: it's a bug in the program. "libgcc_s.so.1 must be installed for 
pthread_cancel to work" is just *one* example of bad thing that can happen.

What can be do on the Python side? Well, stop to ignore silently I/O errors 
when a file is closed by its destructor.

I wrote a shy PR 12786 to only log these exceptions in development mode (-X 
dev). I'm not sure if we could stop to silence these exceptions *by default*.

Python has been modified last years to first raise an exception on I/O errors 
when file.close() is called explicitly, and then a similar change has been done 
for call to socket.socket.close().

--

___
Python tracker 

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



[issue36588] change sys.platform() to just "aix" for AIX

2019-04-11 Thread Michael Felt


Michael Felt  added the comment:

Was:
root@x064:[/data/prj/python/python3-3.8]./python
Python 3.8.0a3+ (heads/bpo-28009-2-dirty:2fb2bc81c3, Apr 11 2019, 07:09:55) [C] 
on aix6
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.platform
'aix6'
>>> import os
>>> os.uname()[3]
'7'

./python ../git/python3-3.8/Tools/scripts/patchcheck.py
Getting base branch for PR ... origin/master
Getting the list of files that have been added/changed ... 6 files
Fixing Python file whitespace ... 0 files
Fixing C file whitespace ... 0 files
Fixing docs whitespace ... 0 files
Docs modified ... yes
Misc/ACKS updated ... NO
Misc/NEWS.d updated with `blurb` ... yes
configure regenerated ... yes
pyconfig.h.in regenerated ... no

On system I built on:
root@x066:[/data/prj/python/python3-3.8]./python
Python 3.8.0a3+ (heads/bpo-36588-aix-platform-dirty:2021d40faa, Apr 11 2019, 
15:16:05) [C] on aix
Type "help", "copyright", "credits" or "license" for more information.
>>> import os,sys
>>> sys.platform
'aix'
>>> os.uname()[3]
'6'

And on AIX7 system:
root@x064:[/data/prj/python/python3-3.8]./python
Python 3.8.0a3+ (heads/bpo-36588-aix-platform-dirty:2021d40faa, Apr 11 2019, 
15:16:05) [C] on aix
Type "help", "copyright", "credits" or "license" for more information.
>>> import os,sys
>>> sys.platform
'aix'
>>> os.uname()[3]
'7'

--

___
Python tracker 

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



[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2019-04-11 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
type:  -> enhancement
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue36600] re-enable test in nntplib

2019-04-11 Thread SilentGhost


Change by SilentGhost :


--
components: +Tests
nosy: +vstinner
type:  -> behavior
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



[issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses

2019-04-11 Thread Jeremy McMillan


Jeremy McMillan  added the comment:

I think the code in SaltStack to handle scoped IPv6 addresses is mature, so 
please look at these examples.

https://github.com/saltstack/salt/blob/2085cb1078f187adf82a0cf19b39d350ff1bbd50/salt/_compat.py#L125

--

___
Python tracker 

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



[issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work

2019-04-11 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +12713
stage: resolved -> patch review

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

https://github.com/Homebrew/homebrew-core/blob/b2aff6271caa04508fb1529fdd5edbb22f4e7f21/Formula/python%402.rb#L75-L82

Homebrew checks compiler version too.

I don't think it's worth enough to add more code to avoid this trouble.

--
resolution:  -> wont fix
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



[issue13927] Document time.ctime format

2019-04-11 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I guess what I'm thinking of `Www Mmm dd hh:mm:ss ` as representing isn't 
so much a format, but rather a literal replacement of where each value has a 
placeholder in the string (that is, a pattern).  So, even if `Www` doesn't mean 
anything, to me it means that the first three characters in the string are a 
Weekday, then there's a space, then Mmm is the month, then a space, then dd is 
the day number (with zero sometimes suppressed), etc.  

If that is more confusing than not using it, then that's fine.  I just wanted 
to mention it.

Using %d to me is also confusing since the docs define %d as `Day of the month 
as a decimal number [01,31]`.  This clearly isn't using 01, but rather 
suppressing the 0.

--

___
Python tracker 

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



[issue36603] should pty.openpty() set pty/tty inheritable?

2019-04-11 Thread cagney


New submission from cagney :

pty.openpty(), on systems with a working os.openpty() / openpty(3) executes:

if (openpty(_fd, _fd, NULL, NULL, NULL) != 0)
goto posix_error;
if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
goto error;
if (_Py_set_inheritable(slave_fd, 0, NULL) < 0)
goto error;

where as on systems where this is fails it instead executes:

master_fd, slave_name = _open_terminal()
slave_fd = slave_open(slave_name)
i.e., result = os.open(tty_name, os.O_RDWR)
return master_fd, slave_fd

where os.open() was "Changed in version 3.4: The new file descriptor is now 
non-inheritable."

(personally I'd deprecate pty.openpty(), but that is just me)

--
components: IO
messages: 339982
nosy: cagney
priority: normal
severity: normal
status: open
title: should pty.openpty() set pty/tty inheritable?
versions: Python 3.7

___
Python tracker 

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



[issue13927] Document time.ctime format

2019-04-11 Thread Harmandeep Singh


Harmandeep Singh  added the comment:

This is not python compatible format, I want something like "%a %b %d %H:%M:%S 
%Y" to explain it.

--

___
Python tracker 

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



[issue19770] NNTP: add post_message wrapper to post Email Message objects

2019-04-11 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thanks David!  If someone is looking for an issue to work on, I'll keep this 
one in mind with the caveat that it won't be reviewed during the sprints.  And 
if no one works on it at that time, then it might be a good first issue 
afterwards.

I'm updating the title to reflect the request.

--
stage:  -> needs patch
title: NNTP.post broken -> NNTP: add post_message wrapper to post Email Message 
objects
type: behavior -> enhancement
versions: +Python 3.8 -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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12715

___
Python tracker 

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



[issue36604] Add recipe to itertools

2019-04-11 Thread SilentGhost


Change by SilentGhost :


--
assignee:  -> docs@python
components: +Documentation -Extension Modules
nosy: +docs@python, rhettinger
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



[issue36603] should pty.openpty() set pty/tty inheritable?

2019-04-11 Thread Hugh Redelmeier


Change by Hugh Redelmeier :


--
nosy: +hugh

___
Python tracker 

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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> I believe `rglob("*")` is eager, while `iterdir` is lazy.

rglob and glob also return a generator.

Slightly related, pathlib.walk was proposed in the past in python-ideas : 
https://mail.python.org/pipermail/python-ideas/2017-April/045398.html

--
nosy: +xtreak

___
Python tracker 

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



[issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file

2019-04-11 Thread Eitan Adler


Change by Eitan Adler :


--
nosy: +eitan.adler

___
Python tracker 

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



[issue34652] never enable lchmod on Linux

2019-04-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

We can take a PR to fix that.

On Thu, Apr 11, 2019, at 04:42, Joshua Root wrote:
> 
> Joshua Root  added the comment:
> 
> The follow-up fix (AC_CHECK_FUNC -> AC_CHECK_FUNCS) still needs to be 
> backported to 2.7. Currently the lack of it causes lchmod to be 
> disabled on all platforms, not just Linux.
> 
> --
> nosy: +jmr
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue26205] Inconsistency concerning nested scopes

2019-04-11 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Assigning to @Mariatta for the sprints.

--
assignee: docs@python -> Mariatta
nosy: +Mariatta, cheryl.sabella
versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order

2019-04-11 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> wont fix
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



[issue13927] Document time.ctime format

2019-04-11 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I would like to help get this issue merged as it's already been approved by a 
core developer.

Does anyone object to the change?  Victor made a suggestion on the PR for 
alternative wording and I wanted to give others a chance to comment on that.

Also, looking at the man page for asctime, they use `Www Mmm dd hh:mm:ss ` 
as the description of the output.  Maybe it would be helpful to add this since 
it shows the spacing and explicitly shows the day number taking up 2 characters?

Thanks!

--
nosy: +belopolsky, cheryl.sabella

___
Python tracker 

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



[issue22377] %Z in strptime doesn't match EST and others

2019-04-11 Thread SilentGhost


SilentGhost  added the comment:

PR on github, Alex

--
nosy: +SilentGhost

___
Python tracker 

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



[issue36603] should pty.openpty() set pty/tty inheritable?

2019-04-11 Thread SilentGhost


Change by SilentGhost :


--
nosy: +twouters

___
Python tracker 

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



[issue36591] Should be a typing.UserNamedTuple

2019-04-11 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> levkivskyi
nosy: +levkivskyi

___
Python tracker 

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



[issue36599] doctest document says dict order is unstable

2019-04-11 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Go ahead and change it to:   "For example, when printing a set, Python doesn’t 
guarantee that the else will be printed in any particular order,"

--
nosy: +rhettinger

___
Python tracker 

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



[issue36604] Add recipe to itertools

2019-04-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank you for the suggestion and the nice work.

I'm going to decline adding this to our docs because it isn't in the spirit of 
the other recipes (reasonably common task, reasonably simple, and/or showing 
off effective combinations of the other itertools).

Though the docs aren't the right place for this, it would be nice if you 
published a blog post or some such to show off your work, detail the though 
processes, and illustrate how you measured performance).  Another option is to 
submit this to the more-itertools project.

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

___
Python tracker 

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



  1   2   >