[issue18049] Re-enable threading test on macOS

2019-08-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

PR 15075 should fix this issue. As mentioned in that PR I do have a question 
w.r.t. the exact shape of that patch: I currently reintroduce a "skipUnless" 
decorator that only runs this test on macOS, I could also introduce one that 
just disables the test on AIX as that's where the test fails.

P.S. According to this old developer works blog AIX has a very small default 
stack size for threads (like more BSD systems) and also has an API to change 
the size of those stacks.  It's probably worthwhile to add some code to 
thread_pthread.h to do this.

The blog: 
https://www.ibm.com/developerworks/community/blogs/5894415f-be62-4bc0-81c5-3956e82276f3/entry/don_t_forget_about_stack_size_limits_for_multi_threaded_applications_on_aix?lang=en

--

___
Python tracker 

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



[issue18049] Re-enable threading test on macOS

2019-08-01 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
pull_requests: +14822
pull_request: https://github.com/python/cpython/pull/15075

___
Python tracker 

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



[issue16970] argparse: bad nargs value raises misleading message

2019-08-01 Thread miss-islington


miss-islington  added the comment:


New changeset 1cc70322c99b80c123f9ff23a415d3da28b4ec74 by Miss Islington (bot) 
in branch '3.8':
bpo-16970: Adding error message for invalid args (GH-14844)
https://github.com/python/cpython/commit/1cc70322c99b80c123f9ff23a415d3da28b4ec74


--

___
Python tracker 

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



[issue16970] argparse: bad nargs value raises misleading message

2019-08-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

The 3.8 backport will land automatically once the tests pass.

The 3.7 backport ran into some trouble, probably a simple merge conflict.

Sushma do you want to try your hands at this?  It probably requires some 
learning about Git branches.  We can also skip this, it's only an improved 
error message after all, and you can try something more fun instead.

The 3.6 branch is closed except for security fixes, which this isn't.

--
nosy: +gvanrossum
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue16970] argparse: bad nargs value raises misleading message

2019-08-01 Thread miss-islington


miss-islington  added the comment:


New changeset 4b3e97592376d5f8a3b75192b399a2da1be642cb by Miss Islington (bot) 
(tmblweed) in branch 'master':
bpo-16970: Adding error message for invalid args (GH-14844)
https://github.com/python/cpython/commit/4b3e97592376d5f8a3b75192b399a2da1be642cb


--
nosy: +miss-islington

___
Python tracker 

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



[issue16970] argparse: bad nargs value raises misleading message

2019-08-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14821
pull_request: https://github.com/python/cpython/pull/15074

___
Python tracker 

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



[issue11654] errors in atexit hooks don't change process exit code

2019-08-01 Thread hai shi


hai shi  added the comment:

as antoine said in https://bugs.python.org/issue1257, this bug should be 
closed;)

--
nosy: +shihai1991

___
Python tracker 

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



[issue37739] list(filter) returns [] ???

2019-08-01 Thread Su Zhu


Su Zhu  added the comment:

I see. Thank you very much!

--

___
Python tracker 

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



[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-01 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



[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-08-01 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2019-08-01 Thread Stefan Sullivan


Stefan Sullivan  added the comment:

This seems like it directly contradicts the documentation for the discover 
method:

"If a package (a directory containing a file named __init__.py) is found, the 
package will be checked for a load_tests function. If this exists then it will 
be called package.load_tests(loader, tests, pattern)."

I believe this _is_ a functional bug. I have a use case where I have provided a 
root script with contents along the lines of 

for d in includes:
test_dir = os.path.join(search_dir, d)
if test_dir not in excludes:
test_suite.addTests(test_loader.discover(test_dir, '*.py', 
search_dir))

and a load_tests function in one of those directory's __init__.py. However, 
since test discovery does not pass on the pattern, I cannot possibly discover 
what the pattern should have been.

Furthermore, if I instead invoke test discovery on the command line using:

python -m unittest discover -s /path/to/code -t /path/to/code -p *.py

I again will see a load_tests invoked with pattern=None.

What is the situation where load_tests will be invoked with a non-None pattern?

Is there a workaround for how I'm supposed to get this pattern? Is there a 
convention or design pattern where I'm supposed to return everything and let 
the caller filter out the extra tests?

As far as I can tell, the load_tests protocol is only relevant to packages (not 
modules) by virtue of its placement in the __init__.py file. However, the only 
way to load tests from a package is via discover, because there is no 
loadTestsFromPackage method (like there is for loadTestsFromModule). Have I 
misunderstood the load_tests protocol? Is there some special way to get a 
pattern?

I feel that if the user really wanted to use their own pattern, being passed a 
string won't hurt anything, but converse is not true (at least for my use case)

--
nosy: +Stefan Sullivan

___
Python tracker 

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



[issue33408] Enable AF_UNIX support in Windows

2019-08-01 Thread Ma Lin


Ma Lin  added the comment:

The current AF_UNIX address family of Windows10 doesn't support datagram, 
adding this flag may break some cross-platform code:

https://github.com/osbuild/osbuild/blob/9371eb9eaa3d0a7cab876eb4c7b70f519dfbd915/osbuild/__init__.py#L253
https://github.com/watsona4/dot_julia2/blob/5b7632b8089be01af706d8152555e711e0a81f06/conda/3/pkgs/python-3.7.3-h0371630_0/lib/python3.7/logging/handlers.py#L676
https://github.com/bognikol/Eleusis/blob/828672492b9cdb3444ddf466c0ac3055572277f7/Dependencies/02_macOS/40_gtk%2B/x64/lib/python2.7/test/test_socketserver.py#L177
https://github.com/sarnautov/python3/blob/005d75d8ac2b11a06707ce0184021a727d6fe844/lib/python3.6/test/test_asyncio/test_unix_events.py#L311
https://github.com/yanlianglai/ssr_python_leeblog/blob/8113fe3f32a250cc52e0cddad9761692dd840967/shadowsocks/manager.py#L60
...

So I'm -1 on adding AF_UNIX personally.

I thought a compromise proposal:
- if (building SDK >= 1804 and run-time Windows >= 1804), add a undocumented 
flag _WIN_AF_UNIX, its value is equal to AF_UNIX.
- only use _WIN_AF_UNIX in stdlib, this is a black-box optimization.
- if someone really need high performance, he/she can uses this undocumented 
flag privately.

If one day Windows support full AF_UNIX, we can remove _WIN_AF_UNIX and add 
standard AF_UNIX.

--

___
Python tracker 

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



[issue37744] thread native id support for GNU/Hurd

2019-08-01 Thread Samuel Thibault


New submission from Samuel Thibault :

Hello,

Here is a patch to add thread native ID support for GNU/Hurd.

Samuel

--
components: Interpreter Core
files: hurd_thread_native_id.diff
keywords: patch
messages: 348879
nosy: samuel-thibault
priority: normal
severity: normal
status: open
title: thread native id support for GNU/Hurd
versions: Python 3.8
Added file: https://bugs.python.org/file48526/hurd_thread_native_id.diff

___
Python tracker 

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



[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-08-01 Thread Antony Lee


New submission from Antony Lee :

The docs for ContextDecorator (of which contextmanager is a case) describe its 
semantics as:

... for any construct of the following form:

def f():
with cm():
# Do stuff

ContextDecorator lets you instead write:

@cm()
def f():
# Do stuff

However, when decorating a generator, the equivalence is broken:

from contextlib import contextmanager

@contextmanager
def cm():
print("start")
yield
print("stop")

def gen_using_with():
with cm():
yield from map(print, range(2))

@cm()
def gen_using_decorator():
yield from map(print, range(2))

print("using with")
list(gen_using_with())
print("==")
print("using decorator")
list(gen_using_decorator())

results in

using with
start
0
1
stop
==
using decorator
start
stop
0
1

i.e., when used as a decorator, the entire contextmanager is executed first 
before iterating over the generator (which is unsurprising given the 
implementation of ContextDecorator: ContextDecorator returns a function that 
executes the context manager and returns the generator, which is only iterated 
over later).

Should this be considered as a bug in ContextDecorator, and should 
ContextDecorator instead detect when it is used to decorate a generator (e.g. 
with inspect.isgeneratorfunction), and switch its implementation accordingly in 
that case?

--
components: Library (Lib)
messages: 348878
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: How should contextmanager/ContextDecorator work with generators?
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



[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-01 Thread Damian Yurzola


New submission from Damian Yurzola :

'root' should be a reserved name to avoid this:

>>> import logging
>>> a = logging.getLogger()
>>> b = logging.getLogger('root')
>>> a.name
'root'
>>> b.name
'root'
>>> a is b
False

--
components: Library (Lib)
messages: 348877
nosy: yurzo
priority: normal
severity: normal
status: open
title: logging.getLogger accepts name='root' leading to confusion
type: enhancement
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



[issue34880] About the "assert" bytecode

2019-08-01 Thread Armin Rigo


Change by Armin Rigo :


--
nosy:  -arigo

___
Python tracker 

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



[issue18049] Re-enable threading test on macOS

2019-08-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The patch to fix this should be:

diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 1466d25e94..658bc1c7a0 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -1057,6 +1057,7 @@ class ThreadingExceptionTests(BaseTestCase):
 lock = threading.Lock()
 self.assertRaises(RuntimeError, lock.release)
 
+@unittest.skipUnless(sys.platform == 'darwin', 'test macos problem')
 def test_recursion_limit(self):
 # Issue 9670
 # test that excessive recursion within a non-main thread causes

---

PR will follow after I've run tests locally, I'll probably create the PR in the 
morning.

--

___
Python tracker 

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



[issue18049] Re-enable threading test on macOS

2019-08-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

That is related, my patch removes a guard that should enable this test only on 
macOS.

This fragment is the issue:
- @unittest.skipUnless(sys.platform == 'darwin' and 
test.support.python_is_optimized(),
-'test macosx problem')

I'll create a pull request for this.

BTW. This does point to an issue with AIX though, this means it is possible to 
crash threads by deep recursion on AIX. But that's separate from this issue.

--

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2019-08-01 Thread Fred L. Drake, Jr.


Fred L. Drake, Jr.  added the comment:

Provisional status should not cause a module or other API element to be omitted 
from the indexes.  So long as it's marked provisional where it's described, it 
should be locatable.

--
nosy: +fdrake

___
Python tracker 

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



[issue37706] IDLE test_sidebar test_(click/drag)_selection fail on macOS 8.6

2019-08-01 Thread Tal Einat


Tal Einat  added the comment:

I can't reproduce this on a Mac now with the recent 3.8.0b3 installer: After 
removing the skipIf() decorators, the tests all pass as expected.

Ned, can you check with this installer? If it still fails for you, can you give 
some details about your Mac, e.g. the screen resolution you are using and 
whether you are using any kind of scaling?

--

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2019-08-01 Thread Brett Cannon


New submission from Brett Cannon :

If you look at https://docs.python.org/3.9/py-modindex.html#cap-i you will see 
that importlib.metadata isn't listed (same goes for the 3.8 docs).

Or are you leaving it out due to it being provisional?

--
assignee: docs@python
components: Documentation
messages: 348872
nosy: barry, brett.cannon, docs@python, jaraco
priority: normal
severity: normal
status: open
title: importlib.metadata docs not showing up in the module index
versions: 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



[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-08-01 Thread R. David Murray

R. David Murray  added the comment:

Right, and the python email package fully supports non ascii:

>>> msg = EmailMessage()
>>> msg['Subject'] = "Panamá- Casco Antiguo"
>>> bytes(msg)
b'Subject: =?utf-8?q?Panam=C3=A1-?= Casco Antiguo\n\n'
>>> str(msg)
'Subject: Panamá- Casco Antiguo\n\n'
>>> msg['subject']
'Panamá- Casco Antiguo'

make_header also supports non-ascii, you just have to tell it what charset you 
want to use.  Like I said, make_header is part of the *legacy* API, and it 
really is a pain to use.  That's why we wrote the new API.

--

___
Python tracker 

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



[issue37740] Python 3.7 sh hangs when using in threads, forking and logging

2019-08-01 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

os.fork() cannot be safely used in an application that uses threads in any 
manner.  This is not something Python can fix.  This is a POSIX limitation.

The "sh" module on PyPI is incompatible with threaded applications on POSIX 
platforms due to its use of os.fork().

https://github.com/amoffat/sh/blob/master/sh.py#L1861

Raise this issue with them.

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



[issue37740] Python 3.7 sh hangs when using in threads, forking and logging

2019-08-01 Thread mzbuild


New submission from mzbuild :

Hi,
We use the sh module in a threaded context to execute shell commands. When we 
were migrating to python 3 from python 2 we encountered some commands hanging. 
We created a test script that recreates the issue we are seeing.
`import sh
import logging
import concurrent.futures.thread

def execmd(exe):
print(sh.ls())
execution_pool = concurrent.futures.thread.ThreadPoolExecutor(20)
i = 0
thread_results = []
while i<500:
i+= 1
thread_results.append(execution_pool.map(execmd, ['ls']))

execution_pool.shutdown()

When running this in python 3.7 it hangs but in python 3.6 it works fine. We 
think it is releated to this issue https://bugs.python.org/issue36533. 
Installing the latest 3.7.4 didn't fix the issue.  The sh module uses logging 
and forking and the top script uses threading so we think there is a locking 
issue with 3.7.  Any help would be great.

--
components: Library (Lib)
messages: 348869
nosy: cagney, ebizzinfotech, gregory.p.smith, hugh, lukasz.langa, mzbuild, 
ned.deily
priority: normal
severity: normal
status: open
title: Python 3.7 sh hangs when using in threads, forking and logging
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-08-01 Thread Yun Li


Yun Li  added the comment:

Hi, David:

I don't think your argument stands here. The whole world does not just
include English speaking countries. There are Spanish, Russian, Chinese,
etc. Any legacy packages should support all languages instead of just
English. This is definitely a bug in this package. I hope that the python
support team should fix this issue or simply add the "support English only"
description in the function explicitly . Otherwise it is very annoying for
other countries to use this package.

Thanks!
Yun

On Thu, Aug 1, 2019 at 5:42 AM R. David Murray 
wrote:

>
> R. David Murray  added the comment:
>
> The input header is not valid (non-ascii is not allowed in headers), so
> you shouldn't expect make_header to do anything sensible.  Note that this
> is the legacy API, which is a toolkit and does not hold your hand when it
> comes to RFC compliance.  Aside from any other concerns, this is long
> standing behavior (it is the same in python2), and it doesn't make sense to
> change the behavior of a legacy API.
>
> --
> resolution:  -> not a bug
> stage: patch review -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34880] About the "assert" bytecode

2019-08-01 Thread Zackery Spytz


Change by Zackery Spytz :


--
components: +Interpreter Core
nosy: +ZackerySpytz
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue34880] About the "assert" bytecode

2019-08-01 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-08-01 Thread Ned Deily


Ned Deily  added the comment:


New changeset 1789bbdd3e03023951a39933ef12dee0a03be616 by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
bpo-37461: Fix infinite loop in parsing of specially crafted email headers 
(GH-14794) (GH-14817)
https://github.com/python/cpython/commit/1789bbdd3e03023951a39933ef12dee0a03be616


--
nosy: +ned.deily

___
Python tracker 

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



[issue37739] list(filter) returns [] ???

2019-08-01 Thread Ned Deily


Ned Deily  added the comment:

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

--
nosy: +ned.deily
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



[issue37739] list(filter) returns [] ???

2019-08-01 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Su Zhu, this is expected, as per the documentation, filter returns an 
iterable and not a list. The first `list(a)` consumes the iterable so it is 
empty when doing the second `list(a)`. You can see the same behavior when 
creating an iterable manually:

>>> a = iter([1, 2, 3])
>>> list(a)
[1, 2, 3]
>>> list(a)
[]

If you need to keep the result in a list, you can do:

>>> a = list(filter(lambda x:x, [1,2,3]))

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue37739] list(filter) returns [] ???

2019-08-01 Thread Su Zhu


New submission from Su Zhu :

The filter become empty after serving as an argument of list().

Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a = filter(lambda x:x, [1,2,3])
>>> list(a)
[1, 2, 3]
>>> list(a)
[]

--
components: Demos and Tools
messages: 348864
nosy: zhusu.china
priority: normal
severity: normal
status: open
title: list(filter) returns [] ???
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread STINNER Victor


Change by STINNER Victor :


--
versions: +Python 3.9 -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



[issue3753] bytearray incompatible with y#

2019-08-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14819
pull_request: https://github.com/python/cpython/pull/15072

___
Python tracker 

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



[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

I'm able to reproduce the issue on Fedora 30: Python 3.7.4 with 
ncurses-libs-6.1-10.20180923.fc30.x86_64.

vstinner@apu$ cat /etc/fedora-release 
Fedora release 30 (Thirty)
vstinner@apu$ python3 -VV
Python 3.7.4 (default, Jul  9 2019, 16:32:37) 
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)]
vstinner@apu$ python3 -c 'import _curses; print(_curses.__file__)'
/usr/lib64/python3.7/lib-dynload/_curses.cpython-37m-x86_64-linux-gnu.so
vstinner@apu$ ldd $(python3 -c 'import _curses; print(_curses.__file__)')
linux-vdso.so.1 (0x7ffe6f1b4000)
libncursesw.so.6 => /lib64/libncursesw.so.6 (0x7f1acf456000)
libtinfo.so.6 => /lib64/libtinfo.so.6 (0x7f1acf427000)
libpython3.7m.so.1.0 => /lib64/libpython3.7m.so.1.0 (0x7f1acf0de000)
libc.so.6 => /lib64/libc.so.6 (0x7f1acef18000)
libdl.so.2 => /lib64/libdl.so.2 (0x7f1acef12000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x7f1aceef1000)
libutil.so.1 => /lib64/libutil.so.1 (0x7f1aceeea000)
libm.so.6 => /lib64/libm.so.6 (0x7f1aceda4000)
/lib64/ld-linux-x86-64.so.2 (0x7f1acf4dc000)
vstinner@apu$ rpm -qf /lib64/libncursesw.so.6
ncurses-libs-6.1-10.20180923.fc30.x86_64

--

___
Python tracker 

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



[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

stdscr.addch(str, color_pair) is implemented with:

   setcchar(, wstr, attr, 0, NULL);
   rtn = wadd_wch(self->win, );

whereas stdscr.addch(bytes, color_pair) is implemented with:

   rtn = waddch(self->win, cch | (attr_t) attr);

The 4th argument of setcchar() is "short color_pair": Python always pass 0. It 
seems to be your bug.

Attached PR 15071 fix this bug.

Note: Python 3.5 and 3.6 don't accept bugfixes anymore, only security fixes.

--
nosy: +vstinner

___
Python tracker 

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



[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36273] test_thread leaks a core dump on PPC64 AIX 3.x

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

"""
What I assume has not been clear about my question - from the output I
see that there is, somewhere, a file named 'core' - but I can never find
it - and my assumption is that the test environment is cleaning up after
itself.
"""

Right, regrtest removes all temporary directories used for tests. You should 
try to extract the code run by the test and run it manually.

For example for test_recursion_limit(), you can use attached recurse.py.

--
Added file: https://bugs.python.org/file48525/recurse.py

___
Python tracker 

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



[issue18049] Re-enable threading test on macOS

2019-08-01 Thread miss-islington


miss-islington  added the comment:


New changeset 8399641c34d8136c3151fda6461cc4727a20b28e by Miss Islington (bot) 
in branch '3.8':
bpo-18049: Sync thread stack size to main thread size on macOS (GH-14748)
https://github.com/python/cpython/commit/8399641c34d8136c3151fda6461cc4727a20b28e


--
nosy: +miss-islington

___
Python tracker 

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



[issue37726] Tutorial should not recommend getopt

2019-08-01 Thread Guido van Rossum


Change by Guido van Rossum :


--
versions:  -Python 2.7

___
Python tracker 

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



[issue37726] Tutorial should not recommend getopt

2019-08-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks mental! All done.

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



[issue37726] Tutorial should not recommend getopt

2019-08-01 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 8990ac0ab0398bfb9c62031288030fe7c630c2c7 by Guido van Rossum 
(Miss Islington (bot)) in branch '3.7':
bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (#15069)
https://github.com/python/cpython/commit/8990ac0ab0398bfb9c62031288030fe7c630c2c7


--

___
Python tracker 

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



[issue37726] Tutorial should not recommend getopt

2019-08-01 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset dcc53ebbff384076b0763c1f842966c189417071 by Guido van Rossum 
(Miss Islington (bot)) in branch '3.8':
bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (#15070)
https://github.com/python/cpython/commit/dcc53ebbff384076b0763c1f842966c189417071


--

___
Python tracker 

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



[issue37726] Tutorial should not recommend getopt

2019-08-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14816
pull_request: https://github.com/python/cpython/pull/15069

___
Python tracker 

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



[issue37726] Tutorial should not recommend getopt

2019-08-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14817
pull_request: https://github.com/python/cpython/pull/15070

___
Python tracker 

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



[issue37726] Tutorial should not recommend getopt

2019-08-01 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 2491134029b195d3159a489e1803ee22a7839b41 by Guido van Rossum 
(mental) in branch 'master':
bpo-37726: Prefer argparse over getopt in stdlib tutorial (#15052)
https://github.com/python/cpython/commit/2491134029b195d3159a489e1803ee22a7839b41


--

___
Python tracker 

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



[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread Marius Gedminas


New submission from Marius Gedminas :

curses.addch() ignores color information if I pass it a string of length one.  
Color works fine if I pass it a byte string or an int.  Here's a reproducer:

### start of example ###
import curses   





def main(stdscr):   

curses.start_color()

curses.use_default_colors() 

curses.init_pair(1, curses.COLOR_RED, -1)   

curses.init_pair(2, curses.COLOR_GREEN, -1) 

curses.curs_set(0)  



stdscr.addch("a", curses.color_pair(1)) 

stdscr.addch("b", curses.color_pair(2) | curses.A_BOLD) 

stdscr.addch(b"c", curses.color_pair(1))

stdscr.addch(b"d", curses.color_pair(2) | curses.A_BOLD)

stdscr.addch(ord("e"), curses.color_pair(1))

stdscr.addch(ord("f"), curses.color_pair(2) | curses.A_BOLD)

stdscr.refresh()



stdscr.getch()  





curses.wrapper(main)

### end of example ###

On Python 2.7 this prints 'abcdef' in alternating red and green.  On Python 3.5 
through 3.8 this prints 'ab' in white and the rest in red/green.

Note that only color pair information is lost -- the bold attribute is 
correctly set on the 'b'.

--
components: Library (Lib)
messages: 348855
nosy: mgedmin
priority: normal
severity: normal
status: open
title: curses.addch('a', curses.color_pair(1)) ignores the color information
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue36273] test_thread leaks a core dump on PPC64 AIX 3.x

2019-08-01 Thread Michael Felt


Michael Felt  added the comment:

On 01/08/2019 11:15, STINNER Victor wrote:
> FAILED (failures=1)
> Warning -- files was modified by test_threading
>   Before: []
>   After:  ['core']

Thanks. I'll look again (on my bot) and other test systems.

What I assume has not been clear about my question - from the output I
see that there is, somewhere, a file named 'core' - but I can never find
it - and my assumption is that the test environment is cleaning up after
itself.

So, rephrased - is there a way to stop running test cycle when there is
an environment error, especially with a core dump, so that it can be
examined for further clues.

Michael

--

___
Python tracker 

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



[issue37737] mmap module track anonymous page on macOS

2019-08-01 Thread David CARLIER


Change by David CARLIER :


--
components: macOS
nosy: devnexen, ned.deily, ronaldoussoren
priority: normal
pull_requests: 14815
severity: normal
status: open
title: mmap module track anonymous page on macOS
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



[issue36302] distutils creates unreproducible .so files

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not excited about backporting this change to Python 3.8 and older. Python 
3.8 also switch to its feature freeze for Python 3.8.0. This change is 
borderline between bugfix and feature. In case of doubt, I prefer to do nothing.

See concerns in the PR discussion:
https://github.com/python/cpython/pull/12341#issuecomment-473361985

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

___
Python tracker 

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



[issue36302] distutils creates unreproducible .so files

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0d30ae1a03102de07758650af9243fd31211325a by Victor Stinner 
(Bernhard M. Wiedemann) in branch 'master':
bpo-36302: Sort list of sources (GH-12341)
https://github.com/python/cpython/commit/0d30ae1a03102de07758650af9243fd31211325a


--
nosy: +vstinner

___
Python tracker 

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



[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-08-01 Thread R. David Murray


R. David Murray  added the comment:

The input header is not valid (non-ascii is not allowed in headers), so you 
shouldn't expect make_header to do anything sensible.  Note that this is the 
legacy API, which is a toolkit and does not hold your hand when it comes to RFC 
compliance.  Aside from any other concerns, this is long standing behavior (it 
is the same in python2), and it doesn't make sense to change the behavior of a 
legacy API.

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



[issue37491] IndexError in get_bare_quoted_string

2019-08-01 Thread R. David Murray


Change by R. David Murray :


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



[issue37461] email.parser.Parser hang

2019-08-01 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

3.5 also seems to be affected. git cherry pick works and the patch fixes the 
problem so I assume the backport would be straightforward. Since 3.5 is open 
for security fixes with 3.5.8 as next release I am adding Larry.

$ git cherry-pick a4a994b
Performing inexact rename detection: 100% (566740/566740), done.
[detached HEAD 9877e9283c] bpo-37461: Fix infinite loop in parsing of specially 
crafted email headers (GH-14794)
 Author: Abhilash Raj 
 Date: Wed Jul 17 09:44:27 2019 -0700
 3 files changed, 12 insertions(+)
 create mode 100644 
Misc/NEWS.d/next/Security/2019-07-16-08-11-00.bpo-37461.1Ahz7O.rst

--
nosy: +larry
versions: +Python 3.5

___
Python tracker 

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



[issue37724] [[Errno 17] File exists: ] # Try create directories that are not part of the archive with

2019-08-01 Thread Tal Cohen


Tal Cohen <3talco...@gmail.com> added the comment:

Thanks

--

___
Python tracker 

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



[issue37736] asyncio.wait_for is still confusing

2019-08-01 Thread David Lewis


New submission from David Lewis :

This issue is a follow up to previous discussions about confusing results with 
asyncio.wait_for. In the current implementation, it seems unintuitive that a 
coroutine with a timeout argument may easily wait forever. Perhaps wait_for 
could use an await_cancellation=True kwarg.

Prior issues:

a) "It's a feature, not a bug" - Guido
https://github.com/python/asyncio/issues/253#issuecomment-120020018

b) "I don't feel comfortable with asyncio living with this bug till 3.8." - Yury
https://bugs.python.org/issue32751#msg318065

Originally, wait_for would cancel the future and raise TimeoutError 
immediately. In the case of a Task, it could remain active for some time after 
the timeout, since its cancellation is potentially asynchronous.

In (a), this behaviour was defended, since waiting on the cancellation would 
violate the implicit contract of the timeout argument to wait_for(). While the 
documentation suggests it's a poor idea, it's not illegal for a task to defer 
or entirely refuse cancellation.

In (b), the task outliving the TimeoutError was considered a bug, and the 
behaviour changed to its current state. To address the issue raised in (a), the 
documentation for wait_for now contains the line "The function will wait until 
the future is actually cancelled, so the total wait time may exceed the 
timeout."

However, we still have the case where a misbehaving Task can cause wait_for to 
hang indefinitely. For example, the following program doesn't terminate:

import asyncio, contextlib

async def bad():
while True:
with contextlib.suppress(asyncio.CancelledError):
await asyncio.sleep(1)
print("running...")

if __name__ == '__main__':
asyncio.run(asyncio.wait_for(bad(), 1))


More realistically, the task may have cooperative cancellation logic that waits 
for something else to be tidied up:

try:
await wait_for(some_task(service), 10)
except TimeoutError:
   ...
finally:
service.stop()

--
components: asyncio
messages: 348848
nosy: David Lewis, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.wait_for is still confusing
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



[issue18049] Re-enable threading test on macOS

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not sure if it's related, but test_threading.test_recursion_limit() started 
to crash on two AIX buildbot workers after commit 
1a057bab0f18d6ad843ce321d1d77a4819497ae4:
https://bugs.python.org/issue36273#msg348845

--
nosy: +vstinner

___
Python tracker 

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



[issue36273] test_thread leaks a core dump on PPC64 AIX 3.x

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

Same test_threading crash on POWER6 AIX 3.x:
https://buildbot.python.org/all/#/builders/161/builds/1430

This build was triggered by the change of bpo-18049 which is supposed to only 
impact macOS, but it does touch test_recursion_limit... can it be related to 
the regression?

https://github.com/python/cpython/commit/1a057bab0f18d6ad843ce321d1d77a4819497ae4

test_recursion_limit (test.test_threading.ThreadingExceptionTests) ... FAIL
test_releasing_unacquired_lock (test.test_threading.ThreadingExceptionTests) 
... ok
test_start_thread_again (test.test_threading.ThreadingExceptionTests) ... ok
test_init_immutable_default_args (test.test_threading.TimerTests) ... ok

==
FAIL: test_recursion_limit (test.test_threading.ThreadingExceptionTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_threading.py",
 line 1088, in test_recursion_limit
self.assertEqual(p.returncode, 0, "Unexpected error: " + stderr.decode())
AssertionError: -11 != 0 : Unexpected error: 

--

Ran 168 tests in 12.623s

FAILED (failures=1)
Warning -- files was modified by test_threading
  Before: []
  After:  ['core']

--

___
Python tracker 

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



[issue36273] test_thread leaks a core dump on PPC64 AIX 3.x

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

test_threading has a similar issue, still on PPC64 AIX 3.x:
https://buildbot.python.org/all/#builders/10/builds/3171

test_recursion_limit (test.test_threading.ThreadingExceptionTests) ... FAIL
test_releasing_unacquired_lock (test.test_threading.ThreadingExceptionTests) 
... ok
test_start_thread_again (test.test_threading.ThreadingExceptionTests) ... ok
test_init_immutable_default_args (test.test_threading.TimerTests) ... ok

==
FAIL: test_recursion_limit (test.test_threading.ThreadingExceptionTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_threading.py",
 line 1088, in test_recursion_limit
self.assertEqual(p.returncode, 0, "Unexpected error: " + stderr.decode())
AssertionError: -11 != 0 : Unexpected error:

--

Ran 168 tests in 12.623s

FAILED (failures=1)
Warning -- files was modified by test_threading
  Before: []
  After:  ['core']

--

___
Python tracker 

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



[issue36273] test_thread leaks a core dump on PPC64 AIX 3.x

2019-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

> Again - how can I get the core (dump) mentioned in the error message. When I 
> force this situation I have several core dumps - not "the one".

You have to contact the owner of the buildbot worker. From a build, you can 
click on the Worker tab. For PPC64 AIX, I see:

   David Edelsohn 

--

___
Python tracker 

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



[issue37595] Python 3.7.4 does not build on Raspbian Buster

2019-08-01 Thread Kal Sze


Kal Sze  added the comment:

Yes, removing --enable-optimizations and keeping all other configure options 
allows me to build.

However, I think most people *do* want optimizations, especially because the 
Raspberry Pi itself already isn't very fast.

--

___
Python tracker 

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



[issue37729] gc: stats from multi process are mixed up

2019-08-01 Thread Inada Naoki


Change by Inada Naoki :


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



[issue37491] IndexError in get_bare_quoted_string

2019-08-01 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@barry

the 3 PR have been merged, do you think we could close this issue?

Thank you

--
nosy: +matrixise

___
Python tracker 

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



[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2019-08-01 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I proposed a PR for issue36871 which has the same issue with constructor 
signature being used for method calls when specced. I also checked the patch 
with the examples reported here regarding signature mismatch and they seem to 
be fixed. So perhaps this can be closed once issue36871 is merged. The issue 
with error message being cryptic in issue27715 when self is passed or not for 
sig.bind is not yet solved though.

Please let me know if there is anything missed with the PR 13261 so that I can 
add relevant tests. Thanks.

--
components: +Library (Lib) -Tests
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