[issue36593] isinstance check fails for Mock objects with spec executed under tracing function

2019-04-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
title: Trace function interferes with MagicMock isinstance? -> isinstance check 
fails for Mock objects with spec executed under tracing function

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread David Bolen


David Bolen  added the comment:

I just noticed that my last message referenced the wrong commit.  My test 
failures were against commit f13c5c8b9401a9dc19e95d8b420ee100ac022208 (the same 
as Victor).

--

___
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-12 Thread Laurie Opperman


Laurie Opperman  added the comment:

Having `iterdir(recursive=True)` recurse into symlinks to directories would 
mean we would either not yield those symlinks, or we yield those symlinks and 
all other directories.

I feel like not yielding directories is the way to go, but it's easy enough to 
check if a yielded path is a directory in application code.

The current implementation of using recursion to list subdirectory contents 
doesn't seem to allow for the obvious implementation of symlink 
cycle-detection: keeping track of which (real) directories have been listed.

PS: I've updated the pull-request to not follow symlinks to directories. This 
is not a final decision, but just updating to be in line with what I've implied 
up to this point

--

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread David Bolen


David Bolen  added the comment:

Eric, I'm also seeing the same Win7 and Win10 worker failures with commit 
b75b1a350 as last time (test_multiprocessing_spawn on both, and test_io on 
Win7).

For test_multiprocessing_spawn, it fails differently than Victor since no core 
file is generated, but I assume it's related in terms of child process 
termination.  See for example 
https://buildbot.python.org/all/#/builders/3/builds/2390 for Win10, where 
test_mymanager_context fails with:

==
FAIL: test_mymanager_context 
(test.test_multiprocessing_spawn.WithManagerTestMyManager)
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.bolen-windows10\build\lib\test\_test_multiprocessing.py", 
line 2747, in test_mymanager_context
self.assertIn(manager._process.exitcode, (0, -signal.SIGTERM))
AssertionError: 3221225477 not found in (0, -15)
--

(3221225477 is C005 which I believe is an access violation)

For some reason, the Windows 7 worker didn't get a test run while your commit 
was live, but I can reproduce the same error manually.

For test_io, as before, its a shutdown lock failure:

==
FAIL: test_daemon_threads_shutdown_stdout_deadlock (test.test_io.CMiscIOTest)
--
Traceback (most recent call last):
  File "D:\cygwin\home\db3l\python.test\lib\test\test_io.py", line 4157, in 
test_daemon_threads_shutdown_stdout_deadlock
self.check_daemon_threads_shutdown_deadlock('stdout')
  File "D:\cygwin\home\db3l\python.test\lib\test\test_io.py", line 4148, in 
check_daemon_threads_shutdown_deadlock
self.assertIn("Fatal Python error: could not acquire lock "
AssertionError: "Fatal Python error: could not acquire lock for 
<_io.BufferedWriter name=''> at interpreter shutdown, possibly due to 
daemon threads" not found in ''

--

In manual attempts I have yet to be able to recreate the 
test_multiprocessing_spawn failure under Win10 but can usually manage a 25-50% 
failure rate under Win7 (which is much slower).  The test_io failure on Win7 
however, appears to be more easily reproducible.

It's possible I/O is more critical than CPU, or perhaps its impact on latency; 
I seem to more easily exacerbate the test_multiprocessing_spawn failure rate by 
loading down the host disk than its CPU.  I also noticed that the Win10 failure 
was when test_io and test_multiprocessing_spawn overlapped.

While I'm guessing this should happen on any low powered Windows VM, if it 
would help, I could arrange remote access to the Win7 worker for you.  Or just 
test a change on your behalf.  In fairness, it's unlikely to be useful for any 
significant remote debugging but perhaps at least having somewhere you could 
test a change, even if just with print-based debugging, might help.  And while 
it might be an independent issue, the test_io failure rate appears to occur 
more reliably than test_multiprocessing_spawn.

--

___
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-12 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Yeah, the check makes sense on a system like the comment says IRIX used to be, 
where getpid() actually returns a thread id *and* signals are delivered to all 
threads (wtf). But any modern system should do the POSIX thing, where getpid() 
returns the same value in all threads, and signals are only delivered to one 
thread anyway. So I agree with everyone else that the original motivation 
doesn't make sense any more.

The place where this would change things is in fork/vfork context. For fork it 
seems unhelpful... like Greg notes, we already reset main_pid in the AfterFork 
handler, so the only effect is that there's a brief moment where signals can be 
lost. If we removed the (getpid() == main_thread) check, then fork() would work 
slightly better.

For vfork, man, I don't even know. Here I do disagree with Greg a little – 
according to POSIX, trip_signal is *not* safe to call in a vfork'ed process. 
POSIX says: "behavior is undefined if the process created by vfork() either 
modifies any data [...] or calls any other function". Yes this is really as 
extreme as it sounds – you're not allowed to mutate data or use any syscalls. 
And they explicitly note that this applies to signal handlers too: "If signal 
handlers are invoked in the child process after vfork(), they must follow the 
same rules as other code in the child process."

trip_signals sets a flag -> it mutates data -> it technically can invoke 
undefined behavior if it's called in a child process after a vfork. And it can 
call write(), which again, undefined behavior.

Of course this is so restrictive that vfork() is almost unusable in Python 
anyway, because you can't do anything in Python without modifying memory.

And worse: according to a strict reading of POSIX, vfork() should call 
pthread_atfork() handlers, and our pthread_atfork() handlers mutate memory.

So from the POSIX-rules-lawyer perspective, there's absolutely no way any 
Python process can ever call vfork() without invoking undefined behavior, no 
matter what we do here.

Do we care?

It looks like subprocess.py was recently modified to call posix_spawn in some 
cases: 
https://github.com/python/cpython/blob/a304b136adda3575898d8b5debedcd48d5072272/Lib/subprocess.py#L610-L654

If we believe the comments in that function, it only does this on macOS – where 
posix_spawn is a native syscall, so no vfork is involved – or on systems using 
glibc (i.e., Linux), where posix_spawn *does* invoke vfork(). So in this one 
case, currently, CPython does use vfork(). Also, users might call 
os.posix_spawn directly on any system.

However, checking the glibc source, their implementation of posix_spawn 
actually takes care of this – it doesn't use vfork() directly, but rather 
clone(), and it takes care to make sure that no signal handlers run in the 
child (see sysdeps/unix/sysv/linux/spawni.c for details).

AFAICT, the only ways that someone could potentially get themselves into 
trouble with vfork() on CPython are:

- by explicitly wrapping it themselves, in which case, good luck to them I 
guess. On Linux they aren't instantly doomed, because Linux intentionally 
deviates from POSIX and *doesn't* invoke pthread_atfork handlers after vfork(), 
but they still have their work cut out for them. Not really our problem.

- by explicitly calling os.posix_spawn on some system where this is implemented 
using vfork internally, but with a broken libc that doesn't handle signals or 
pthread_atfork correctly. Currently we don't know of any such systems, and if 
they do exist they have to be pretty rare.

So: I think we shouldn't worry about vfork(), and it's fine to remove the 
(getpid() == main_pid) check.

--
nosy: +njs

___
Python tracker 

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



[issue36540] PEP 570: Python Positional-Only Parameters

2019-04-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will separate the work in two Pull Request (maybe more). The implementation 
of the PEP will be done in PR12701 and the documentation and other additions 
will be done in future Pull Requests to keep things more manageable.

--

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

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



[issue36623] Clean unused parser headers

2019-04-12 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

After the removal of pgen, there are multiple parser headers that are not used 
anymore or ar lacking implementations.

--
components: Interpreter Core
messages: 340140
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Clean unused parser headers
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



[issue36623] Clean unused parser headers

2019-04-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue36622] Inconsistent exponent notation formatting

2019-04-12 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith, mark.dickinson, skrah

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

> Any ideas of how far I need to throttle the VM?  Is there more than just CPU 
> that I need to limit?

I don't know how to make the race condition more likely. I'm not sure that 
starving the CPU helps. Maybe try the opposite: add more CPUs and reduce the 
number of tests run in parallel.

Did you test commit f13c5c8b9401a9dc19e95d8b420ee100ac022208?

--

___
Python tracker 

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



[issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5403006c5c371649b92ab8a2cde742412c765640 by Victor Stinner in 
branch '3.7':
bpo-36605: make tags: parse Modules/_io directory (GH-12789) (GH-12814)
https://github.com/python/cpython/commit/5403006c5c371649b92ab8a2cde742412c765640


--

___
Python tracker 

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



[issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h

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



[issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 44a2c4aaf2d0c03c70646eb16fbc6c1ba1689e69 by Victor Stinner in 
branch '2.7':
bpo-36605: make tags: parse Modules/_io directory (GH-12789) (GH-12815)
https://github.com/python/cpython/commit/44a2c4aaf2d0c03c70646eb16fbc6c1ba1689e69


--

___
Python tracker 

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



[issue36622] Inconsistent exponent notation formatting

2019-04-12 Thread Sep Dehpour


New submission from Sep Dehpour :

Floats and Decimals have inconsistent exponent notation formatting:

>>> '{:.5e}'.format(Decimal('2.0001'))
'2.00010e+0'
>>> '{:.5e}'.format(2.0001)
'2.00010e+00'

This is causing issues for us since we use the scientific notation formatted 
string of numbers to compare them. Between decimals and floats, one produces 
'+0' while the other one produces '+00'

--
messages: 340136
nosy: seperman
priority: normal
severity: normal
status: open
title: Inconsistent exponent notation formatting
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



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

2019-04-12 Thread Paul Ganssle


Paul Ganssle  added the comment:

> I don't spend enough time dealing with symlinks to have strong opinions 
> there, but given we have ways to resolve symlinks but not to get back to the 
> original name (and I *have* had to deal with issues where I've needed to find 
> the original name from the target :roll-eyes:) I'd say don't resolve anything 
> eagerly.

You mean treating symlinks to directories like files? I suppose that's a 
possibility, but I do think it will end up being a source of bugs around 
symlinking.

Admittedly, it *is* apparently what rglob('*') does (just tested it - 
apparently it won't follow symlinks to directories), though I think it might be 
a better interface to try to break cycles rather than not follow symlinks 
(particularly since `iterdir` currently treats symlinks to directories as 
directories).

--

___
Python tracker 

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



[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-04-12 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thanks, Charles.  I'm going to assign this to @Mariatta for the sprints.

--
assignee: docs@python -> Mariatta
nosy: +Mariatta

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread Eric Snow


Eric Snow  added the comment:

@Victor, I set up a FreeBSD 12.0 VM (in Hyper-v) and made sure core files were 
getting generated for segfaults.  Then I cloned the cpython repo, built it 
(using GCC), and ran regrtest as you recommended.  It generated no core files 
after half an hour.  I adjusted the VM down to 1 CPU from 4 and there were no 
segfaults over an hour and a half of running those 4 test loops.  So I've set 
the VM to 10% of a CPU and still have gotten no core files after over half an 
hour.  The load average has been hovering between 5 and 6.  I guess I'm not 
starving the VM enough. :)

Any ideas of how far I need to throttle the VM?  Is there more than just CPU 
that I need to limit?

--

___
Python tracker 

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



[issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12741

___
Python tracker 

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



[issue32299] unittest.mock.patch.dict.__enter__ should return the dict

2019-04-12 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12740

___
Python tracker 

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



[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2019-04-12 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-04-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-04-12 Thread Charles Merriam


Charles Merriam  added the comment:

Hi Cheryl,

No.  I've dealt with the Team Python long cycles for random pull requests
before.

Charles

On Fri, Apr 12, 2019 at 2:27 PM Cheryl Sabella 
wrote:

>
> Cheryl Sabella  added the comment:
>
> Good catch!  In the same section, accumulate() is missing the `initial`
> argument.
>
> Would you be interested in submitting a pull request for this?
>
> --
> nosy: +cheryl.sabella
>
> ___
> Python tracker 
> 
> ___
>

--
nosy: +Charles.Merriam

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

> It should not block us from going forward with a workaround like your PRs for 
> now.

I pushed a fix quickly to unblock my PR 12796, but also because I was very 
scared by what I saw :-D

I see my change as a "quick fix", but we really have to sit down to think about 
the "correct fix". Especially since we will have to do something for Python 2.7 
and 3.7, and adding -fmax-type-align=8 to exported CFLAGS can cause *new* 
issues, as you explained.

That's why I mentioned bpo-27987 and other issues, to try to see what has 
already been said, and try to find to identify and fix the root issue, rather 
than working around the issue with compiler flags.

--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a304b136adda3575898d8b5debedcd48d5072272 by Victor Stinner in 
branch 'master':
bpo-36618: Don't add -fmax-type-align flag to old clang (GH-12811)
https://github.com/python/cpython/commit/a304b136adda3575898d8b5debedcd48d5072272


--

___
Python tracker 

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



[issue35581] Document @typing.type_check_only

2019-04-12 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I believe -fno-max-type-align is also an option.

--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Even if you check for -fmax-type-align compiler support at configure time, 
there is a potential problem:

Nothing guarantees that extension modules are built by the same compiler that 
CPython is.  If CPython used an old clang without support for that flag and the 
extension module compiled by that CPython via pip and setup.py, etc. uses a 
more recent version of clang - it wouldn't specify that flag and the extension 
module code could be broken.

I suppose this issue of conditional compiler flags is nothing new.  It should 
not block us from going forward with a workaround like your PRs for now.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue35581] Document @typing.type_check_only

2019-04-12 Thread miss-islington


miss-islington  added the comment:


New changeset b759a2c5b9612a03c8b30514aa93444268931e5e by Miss Islington (bot) 
in branch '3.7':
bpo-35581: Document @typing.type_check_only (GH-11312)
https://github.com/python/cpython/commit/b759a2c5b9612a03c8b30514aa93444268931e5e


--
nosy: +miss-islington

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-04-12 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue35581] Document @typing.type_check_only

2019-04-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

Now waiting for the backport to 3.7. Once that's done I'll close this as fixed.

--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

See also:

* bpo-27987: obmalloc's 8-byte alignment causes undefined behavior
* bpo-18835: Add PyMem_AlignedAlloc()
* bpo-31912: PyMem_Malloc() should guarantee alignof(max_align_t)

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

I see that a fix has been pushed. I'm not sure why this issue is still open, so 
I close it.

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



[issue35581] Document @typing.type_check_only

2019-04-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12739

___
Python tracker 

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



[issue35581] Document @typing.type_check_only

2019-04-12 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 1e8295402bf5e81d327ed2b5eb88a6b6de449d63 by Guido van Rossum 
(Sebastian Rittau) in branch 'master':
bpo-35581: Document @typing.type_check_only (GH-11312)
https://github.com/python/cpython/commit/1e8295402bf5e81d327ed2b5eb88a6b6de449d63


--

___
Python tracker 

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



[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2019-04-12 Thread miss-islington


miss-islington  added the comment:


New changeset 395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee by Miss Islington (bot) 
in branch '3.7':
bpo-33922: Adding documentation for new "-64" suffix of Python launcher 
(GH-7849)
https://github.com/python/cpython/commit/395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee


--
nosy: +miss-islington

___
Python tracker 

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



[issue33922] [Windows] Document the launcher's -64 suffix

2019-04-12 Thread miss-islington


miss-islington  added the comment:


New changeset 395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee by Miss Islington (bot) 
in branch '3.7':
bpo-33922: Adding documentation for new "-64" suffix of Python launcher 
(GH-7849)
https://github.com/python/cpython/commit/395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee


--
nosy: +miss-islington

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

While this issue looked purely theorical to me 3 years ago, it is now very 
concrete: bpo-36618 "clang expects memory aligned on 16 bytes, but pymalloc 
aligns to 8 bytes".

--

___
Python tracker 

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



[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:


New changeset 1e2ad6c275d2b09e76b7cbba7281d5a125a593c1 by Steve Dower (mrh1997) 
in branch 'master':
bpo-33922: Adding documentation for new "-64" suffix of Python launcher 
(GH-7849)
https://github.com/python/cpython/commit/1e2ad6c275d2b09e76b7cbba7281d5a125a593c1


--

___
Python tracker 

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



[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2019-04-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12738

___
Python tracker 

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



[issue33922] [Windows] Document the launcher's -64 suffix

2019-04-12 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
pull_requests: +12737

___
Python tracker 

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



[issue33922] [Windows] Document the launcher's -64 suffix

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:


New changeset 1e2ad6c275d2b09e76b7cbba7281d5a125a593c1 by Steve Dower (mrh1997) 
in branch 'master':
bpo-33922: Adding documentation for new "-64" suffix of Python launcher 
(GH-7849)
https://github.com/python/cpython/commit/1e2ad6c275d2b09e76b7cbba7281d5a125a593c1


--

___
Python tracker 

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



[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread Saim Raza


Saim Raza  added the comment:

> Knowing that pdb stops just before the interpreter executes the line after 
> pdb.set_trace(), what prevents you from writing the pdb.set_trace() statement 
> before the last line of the except clause ?

Of course, that can be done. The issue here is to get the correct and expected 
behavior from pdb/ipdb.

On a similar note, users might want to put just the set_trace() call and no 
other code in the block while writing the code or during debugging the 
exception caught.

--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12736

___
Python tracker 

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



[issue17267] datetime.time support for '+' and '-'

2019-04-12 Thread Skip Montanaro


Change by Skip Montanaro :


--
nosy:  -skip.montanaro

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, it seems like the change broke the FreeBSD 10 buildbot :-(

https://buildbot.python.org/all/#/builders/167/builds/769

...
checking for makedev... no
checking for le64toh... no
checking for mode_t... no
checking for off_t... no
checking for pid_t... no
checking for size_t... no
checking for uid_t in sys/types.h... yes
checking for ssize_t... no
checking for __uint128_t... no
checking size of int... 0
checking size of long... 0
checking size of long long... 0
checking size of void *... 0
checking size of short... 0
checking size of float... 0
checking size of double... 0
checking size of fpos_t... 0
checking size of size_t... 0
checking size of pid_t... 0
checking size of uintptr_t... 0
checking for long double... yes
configure: error: in 
`/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build':
configure: error: cannot compute sizeof (long double)
See `config.log' for more details

--

On the previous build, the output looked fine:

https://buildbot.python.org/all/#/builders/167/builds/768

...
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking size of void *... 8
checking size of short... 2
checking size of float... 4
checking size of double... 8
checking size of fpos_t... 8
checking size of size_t... 8
checking size of pid_t... 4
checking size of uintptr_t... 8
checking for long double... yes
checking size of long double... 16

pythoninfo:

CC.version: FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 
20140512
os.uname: posix.uname_result(sysname='FreeBSD', 
nodename='10-STABLE-amd64.elysium', release='10.4-STABLE', version='FreeBSD 
10.4-STABLE #1 r337021: Wed Aug  1 15:12:48 AEST 2018 
root@10-STABLE-amd64.elysium:/usr/obj/usr/src/sys/GENERIC', machine='amd64')
platform.platform: FreeBSD-10.4-STABLE-amd64-64bit-ELF

--

___
Python tracker 

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



[issue19113] duplicate test names in Lib/ctypes/test/test_functions.py

2019-04-12 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

Still fails on Python 3.8.0a3+.

--

___
Python tracker 

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



[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

> Now, I need to *inconveniently* put some dummy code after the ser_trace call 
> every time I want to access the exception inside the except block

Knowing that pdb stops just before the interpreter executes the line after 
pdb.set_trace(), what prevents you from writing the pdb.set_trace() statement 
before the last line of the except clause ?

--

___
Python tracker 

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



[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-04-12 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Good catch!  In the same section, accumulate() is missing the `initial` 
argument.  

Would you be interested in submitting a pull request for this?

--
nosy: +cheryl.sabella

___
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-12 Thread Michael Felt


Michael Felt  added the comment:

On 12/04/2019 17:34, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
>> But, should I just continue standard practice (sys.platform), or would
>> this be a moment to move towards platform.system() (i.e., set the
>> example to be to use "run-time" rather than "build-time").
> Oh, now I'm confused :-) I checked the Python test suite: some tests use 
> sys.platform == "linux" or sys.platform in ("linux", ...), some tests uses 
> sys.platform.startswith("linux").
>
> In case of doubt, I suggest to do nothing :-) Leave the code unchanged :-)

Agreed, in case of doubt - leave alone (never change a winning team).

And, to make it a short reply - I'll get started, and we see where it
leads us.

Michael

>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue36621] shutil.rmtree follows junctions on windows

2019-04-12 Thread Jordan Hueckstaedt


New submission from Jordan Hueckstaedt :

shutil.rmtree follows junctions / reparse points on windows and will delete 
files in the target link directory.

--
components: IO, Windows
messages: 340111
nosy: Jordan Hueckstaedt, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: shutil.rmtree follows junctions on windows
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



[issue36106] resolve sinpi() name clash with libm

2019-04-12 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I'll nosy Ned as the release manager about the request to 3.6.

--
nosy: +cheryl.sabella, ned.deily

___
Python tracker 

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



[issue28809] mention asyncio.gather non-deterministic task starting order

2019-04-12 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I believe the issue mentioned here was addressed by the doc rewrite in issue 
33649.  I'm going to mark this as a duplicate of that issue, but if the concern 
here still exists, then please re-open this issue.

--
nosy: +cheryl.sabella
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> asyncio docs overhaul

___
Python tracker 

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



[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-04-12 Thread SilentGhost


Change by SilentGhost :


--
stage:  -> needs patch
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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Note to myself: "Sadly, the flag must be expected to CFLAGS and not just 
CFLAGS_NODIST, ..."

It should be "Sadly, the flag must be *set* to CFLAGS and not just 
CFLAGS_NODIST, ..." :-( I should fix the NEWS entry.

--

___
Python tracker 

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



[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-04-12 Thread Charles Merriam


New submission from Charles Merriam :

On page:
https://docs.python.org/3.8/library/itertools.html

In the heading summary, in the "Iterators terminating on the shortest input 
sequence:" section, in the "zip_longest()" table row, in the "Arguments" 
column, the text "p, q, ..." should be "p, q, ... [, fillvalue=None]"

--
assignee: docs@python
components: Documentation
messages: 340107
nosy: CharlesMerriam, docs@python
priority: normal
severity: normal
status: open
title: Documentation missing parameter for Itertools.zip_longest
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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

I merged a "workaround" in the master branch. Python 2.7 and 3.7 are also 
affected, but I prefer to wait to see if the change goes through buildbots.

The real fix would be to modify pymalloc to use 16-byte alignement, but that's 
a more complex issue :-)

--

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

We decided to only disable the code by default, but the code stays until we are 
sure that nobody uses it.

--
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-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 472f794a33221ea835a2fbf6c9f12aa2bd66d1b0 by Victor Stinner in 
branch 'master':
bpo-18748: test_io: silence destructor errors (GH-12805)
https://github.com/python/cpython/commit/472f794a33221ea835a2fbf6c9f12aa2bd66d1b0


--

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e8f9acf03484c6c3f163f04a76321419369c28aa by Victor Stinner in 
branch 'master':
bpo-36611: Disable serialno field of debug memory allocators (#12796)
https://github.com/python/cpython/commit/e8f9acf03484c6c3f163f04a76321419369c28aa


--

___
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-12 Thread Matthew Barnett


Matthew Barnett  added the comment:

Consider re.findall(r'.{0,2}', 'abcde').

It finds 'ab', then continues where it left off to find 'cd', then 'e'.

It can also find ''; re.match(r'.*', '') does match, after all.

It could, in fact, an infinite number of ''.

And what about re.match(r'()*', '')?

What should it do? Run forever? Raise an exception?

At some point you have to make a decision as to what should happen, and the 
general consensus has been to match once.

--

___
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-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0fc91eef34a1d9194904fa093c9fbd711af0f26c by Victor Stinner in 
branch 'master':
bpo-36389: Add _PyObject_CheckConsistency() function (GH-12803)
https://github.com/python/cpython/commit/0fc91eef34a1d9194904fa093c9fbd711af0f26c


--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 23a683adf803eef405d248cc9c2a7eb08a7300e2 by Victor Stinner in 
branch 'master':
bpo-36618: Add -fmax-type-align=8 flag for clang (GH-12809)
https://github.com/python/cpython/commit/23a683adf803eef405d248cc9c2a7eb08a7300e2


--

___
Python tracker 

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



[issue36106] resolve sinpi() name clash with libm

2019-04-12 Thread Dmitrii Pasechnik


Dmitrii Pasechnik  added the comment:

Can this also be backported to 3.5. and 3.6, as requested by FreeBSD 
maintainers?

--

___
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-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

We can remove ancient Irix and LinuxThreads hacks from our codebase.

The best way to shake issues of this sort out is to remove it and watch for 
issues on supported buildbots and during beta releases.  I don't expect any 
fallout from this one.

Other places this check _could_ have come up without us realizing it... if a 
signal handler setup persisted into a quasi-forked process (vfork) this check 
would prevent that oddball dangerous state of a child process from doing signal 
processing until after _PySignal_AfterFork was called to reset main_pid.

but trip_signal() is already safe in crazy async signal safe contexts so I 
don't see a problem there.  if it happened to write to a wakeup.fd that was 
shared by the parent and child even that shouldn't be an issue.  A vfork()ed 
process is about to exec or die anyways (no other actions are supported) - 
never go back to running Python code.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue36614] Popen output on windows server 2019

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

> I guess Popen is using some OS library or environment that has changed in 
> WS2019.

Yep, which is why the report should go to those responsible for WS2019. If they 
say it's an intentional change and users are supposed to work around it 
themselves, then we can do a workaround, but if it's unintentional then they 
should fix it.

--

___
Python tracker 

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



[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

Oh, apart from the What's New section. But this looks enough like a bugfix 
(previous behaviour "wasn't capitalizing my name correctly" - new behaviour 
"now capitalizes my name correctly") that it's hardly critical to advertise it 
on that page.

--

___
Python tracker 

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



[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

What is missing? It looks like everything on Serhiy's list was done.

--

___
Python tracker 

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



[issue25361] Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this?

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

For 3.8 we support as far back as Win7 SP1 with the update for secure DLL 
loading, neither of which require SSE2. So we should hold this for 3.9 when we 
drop Win7 completely.

--

___
Python tracker 

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



[issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

Never heard of it, but perhaps there are some preprocessor checks for Windows 
that assume you are using MSVC and not gcc?

We don't support compilers other than MSVC on Windows, but if someone has a fix 
for this I'm happy to consider it.

--

___
Python tracker 

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



[issue36609] activate.ps1 in venv for Windows should encoded with BOM

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

Seems reasonable.

The most reliable way to do this will be to override the copy function for this 
file in venv and write it out with "utf-8-sig" encoding. There are many ways 
that git will break things like this, so I wouldn't trust it to simply accept a 
modified file.

--

___
Python tracker 

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



[issue36619] when is os.posix_spawn(setsid=True) safe?

2019-04-12 Thread cagney


New submission from cagney :

How can I detect that os.posix_spawn(setsid=True) is available at runtime?

I'd like to use os.posix_spawn(setsid=True) when it is available, and  
(assuming I'm getting this right) os.posix_spawn(setpgroup=0) as a poor 
fallback.

--
components: IO
messages: 340091
nosy: cagney
priority: normal
severity: normal
status: open
title: when is os.posix_spawn(setsid=True) safe?
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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a)

2019-04-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

While altering the environment to not use the system default openssl config is 
an option to make this green again today very easily.  That'd "solve" the red 
bot problem and nothing else. :/

Doing that just kicks the can down the road as all of us Linux users are going 
to face this problem when we start using modern OS distros to build and test 
CPython.

A skipped test is an ignored test.

Ideally I'd like to see the tests updated to comply with modern higher security 
openssl config constraints.

--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36617] The rich comparison operators are second class citizens

2019-04-12 Thread SilentGhost


SilentGhost  added the comment:

It seems to be parser module. 
https://docs.python.org/3/library/parser.html#creating-st-objects

--
nosy: +SilentGhost

___
Python tracker 

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



[issue19417] Bdb: add a unittest file (test.test_bdb)

2019-04-12 Thread Xavier de Gaye


Change by Xavier de Gaye :


--
dependencies:  -Bdb: add docstrings
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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +pablogsal

___
Python tracker 

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



[issue36617] The rich comparison operators are second class citizens

2019-04-12 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Sorry, I don't understand your demonstration. What's the mystery ``parser`` 
object with an ``expr`` method? What is it doing?

Your comment says "all binary/unary number ops work" but I don't know what you 
mean by "work". Could you show some plain, vanilla Python code that 
demonstrates the problem?

>From your description here:

> an unparenthesized comparison expression cannot be unpacked using
> the *iterable "unpack" operator

it sounds like you are talking about an operator precedence issue. Am I close?

But I think you are wrong:

py> print(*[] < [1, 2])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: print() argument after * must be an iterable, not bool


suggests that the < operator is evaluated before trying to unpack.

Let's try with something else:

class X:
def __lt__(self, other):
return [1, 2, 3]

py> print(*X() < None)
1 2 3


Perhaps I have misunderstood something.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


New submission from STINNER Victor :

On x86-64, clang -O3 compiles the following function:

PyCArgObject *
PyCArgObject_new(void)
{
PyCArgObject *p;
p = PyObject_New(PyCArgObject, _Type);
if (p == NULL)
return NULL;
p->pffi_type = NULL;
p->tag = '\0';
p->obj = NULL;
memset(>value, 0, sizeof(p->value));
return p;
}

like that:

   0x7fffe9c6acb0 <+0>: push   rax
   0x7fffe9c6acb1 <+1>: movrdi,QWORD PTR [rip+0xe308]# 
0x7fffe9c78fc0
   0x7fffe9c6acb8 <+8>: call   0x7fffe9c5e8a0 <_PyObject_New@plt>
   0x7fffe9c6acbd <+13>:test   rax,rax
   0x7fffe9c6acc0 <+16>:je 0x7fffe9c6acdf 
   0x7fffe9c6acc2 <+18>:movQWORD PTR [rax+0x20],0x0
   0x7fffe9c6acca <+26>:movBYTE PTR [rax+0x28],0x0
   0x7fffe9c6acce <+30>:xorps  xmm0,xmm0
   0x7fffe9c6acd1 <+33>:movaps XMMWORD PTR [rax+0x30],xmm0
   0x7fffe9c6acd5 <+37>:movQWORD PTR [rax+0x40],0x0
   0x7fffe9c6acdd <+45>:poprcx
   0x7fffe9c6acde <+46>:ret
   0x7fffe9c6acdf <+47>:xoreax,eax
   0x7fffe9c6ace1 <+49>:poprcx
   0x7fffe9c6ace2 <+50>:ret

The problem is that movaps requires the memory address to be aligned on 16 
bytes, whereas PyObject_New() uses pymalloc allocator (the requested size is 80 
bytes, pymalloc supports allocations up to 512 bytes) and pymalloc only 
provides alignment on 8 bytes.

If PyObject_New() returns an address not aligned on 16 bytes, 
PyCArgObject_new() crash immediately with a segmentation fault (SIGSEGV).

CPython must be compiled using -fmax-type-align=8 to avoid such alignment 
crash. Using this compiler flag, clag emits expected machine code:

   0x7fffe9caacb0 <+0>: push   rax
   0x7fffe9caacb1 <+1>: movrdi,QWORD PTR [rip+0xe308]# 
0x7fffe9cb8fc0
   0x7fffe9caacb8 <+8>: call   0x7fffe9c9e8a0 <_PyObject_New@plt>
   0x7fffe9caacbd <+13>:test   rax,rax
   0x7fffe9caacc0 <+16>:je 0x7fffe9caacdf 
   0x7fffe9caacc2 <+18>:movQWORD PTR [rax+0x20],0x0
   0x7fffe9caacca <+26>:movBYTE PTR [rax+0x28],0x0
   0x7fffe9caacce <+30>:xorps  xmm0,xmm0
   0x7fffe9caacd1 <+33>:movups XMMWORD PTR [rax+0x30],xmm0
   0x7fffe9caacd5 <+37>:movQWORD PTR [rax+0x40],0x0
   0x7fffe9caacdd <+45>:poprcx
   0x7fffe9caacde <+46>:ret
   0x7fffe9caacdf <+47>:xoreax,eax
   0x7fffe9caace1 <+49>:poprcx
   0x7fffe9caace2 <+50>:ret

"movaps" instruction becomes "movups" instruction: "a" stands for "aligned" in 
movaps, whereas "u" stands for "unaligned" in movups.

--
components: Build
messages: 340087
nosy: vstinner
priority: normal
severity: normal
status: open
title: clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes
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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a)

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

This is still failing regularly - any progress? Do we need to skip tests?

--
nosy: +steve.dower

___
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-12 Thread Eryk Sun


Eryk Sun  added the comment:

> Maybe a similar thing exists in Linux? 

Back in the late 90s, Linux implemented threads as 'processes' (LinuxThreads), 
but with shared resources such as virtual memory and file descriptors. (The 
Linux kernel's clone system call is highly composable in this regard.) Thus 
getpid() was different for each thread in a process and kill() could target a 
particular thread-process. I guess it was a problem if Ctrl+C in a terminal 
would send SIGINT to every thread-process associated with the terminal.

Eventually, for scalability and POSIX compliance, Linux abandoned the 
LinuxThreads implementation. It evolved kernel process IDs into thread IDs and 
a new concept called a thread group emerged. Nowadays all threads in a process 
are in the same thread group, and the PID returned by getpid() is the 
thread-group ID (TGID), which is the thread ID (TID) of the first thread in the 
process. clone() defaults to creating a new process (thread group), unless 
CLONE_THREAD is specified.

--
nosy: +eryksun

___
Python tracker 

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



[issue36617] The rich comparison operators are second class citizens

2019-04-12 Thread Dan Snider


New submission from Dan Snider :

The rich comparison operators have an (far as I can tell, unnecessary) 
limitation compared to the other binary operators, being that the result of an 
unparenthesized comparison expression cannot be unpacked using the *iterable 
"unpack" operator (does that thing have an official name?)

Here's a silly demonstration of what I'm talking about:
 
 >>> if 1:
... parser.expr("[*+-~d<
Traceback (most recent call last):
  File "", line 3, in 
  File "", line 1
[*+-~d<=b-~+_]
   ^
SyntaxError: invalid syntax


>>> if 1:
... parser.expr("f(*+d<<-b)")
... parser.expr("f(*+d<=-b)")
...




Because the limitation is not present for function calls, I suspect this is 
simply a "typo" that's gone unnoticed for years, due to nobody ever trying it. 
I'm hardly an expert on the parser and can barely read the grammar file so i 
might be totally wrong here. But then, what would be the difference between the 
expressions: [*a+b+c+d, *e-f] and [*a>> class S(list): __lt__ = list.__add__

--
messages: 340084
nosy: bup
priority: normal
severity: normal
status: open
title: The rich comparison operators are second class citizens

___
Python tracker 

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



[issue36509] Add iot layout for windows iot containers

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:


New changeset f4e5661e85ac41c987165246d2b33f363cd01e34 by Steve Dower (Paul 
Monson) in branch 'master':
bpo-36509: Add iot layout for Windows IoT containers (GH-12663)
https://github.com/python/cpython/commit/f4e5661e85ac41c987165246d2b33f363cd01e34


--

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

FYI AMD64 FreeBSD CURRENT Shared 3.x failed at commit 
f13c5c8b9401a9dc19e95d8b420ee100ac022208:
https://buildbot.python.org/all/#/builders/168/builds/913

But this issue has already been fixed: Eric reverted his change.

--

___
Python tracker 

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



[issue36513] Add support for building arm32 nuget package

2019-04-12 Thread Steve Dower


Change by Steve Dower :


--
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-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

IIRC in SGI, getpid() would return the thread ID. They had a syscall that could 
create a new subprocess that would share or not share various resources (e.g. 
memory, signals, file descriptors) so by setting or clearing bits you could 
implement a continuum of variations between fork and thread creation (for 
thread creation you'd share everything). Maybe a similar thing exists in Linux? 
But IRIX is dead so I think it's safe to kill.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

We should at least have consistent error messages:

>>> class O:
...  def __len__(self):
...   return 2**100
...
>>> o=O()
>>> len(o)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: cannot fit 'int' into an index-sized integer

I'd argue for replacing 'int' here with the rendered value, but I think 
OverflowError is the right type. Mentioning "C ssize_t" is the problem.

As for the list constructor, I'd be okay with chaining a MemoryError here, 
provided the OverflowError sticks around. But in this context a MemoryError is 
"recoverable" while an OverflowError very likely indicates a programming error, 
so we shouldn't hide it from the user.

--
nosy: +steve.dower

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

I tried but failed to reproduce the crash on Linux!?

$ sudo bash -c 'echo "%e.%p" > /proc/sys/kernel/core_pattern'
$ ./python -m test --matchfile=bisect5 test_multiprocessing_spawn 
--fail-env-changed -F
# wait 5 min
^C
$ ./python -m test --matchfile=bisect5 -j0 test_multiprocessing_spawn 
--fail-env-changed -F  # I added -j0
# wait 5 min
^C
$ ./python -m test --matchfile=bisect5 -j0 test_multiprocessing_spawn 
--fail-env-changed -F  # I added -j0
# wait 5 min
^C

No coredump seen...

--

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-12 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
type:  -> performance

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-12 Thread Jeroen Demeyer


New submission from Jeroen Demeyer :

The bytecode interpreter uses an inline function call_function() to handle most 
function calls. To check for profiling, call_function() needs to call to 
PyThreadState_GET().

In the reference implementation of PEP 590, I saw that we can remove these 
PyThreadState_GET() calls by passing the thread state from the main eval loop 
to call_function().

I suggest to apply this optimization now, because they make sense independently 
of PEP 580 and PEP 590 and to give a better baseline for performance 
comparisons.

--
components: Interpreter Core
messages: 340078
nosy: Mark.Shannon, jdemeyer, petr.viktorin
priority: normal
severity: normal
status: open
title: Optimize thread state handling in function call code
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



[issue36601] signals can be caught by any thread

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread Eric Snow


Eric Snow  added the comment:


New changeset b75b1a3504a0cea6fac6ecba44c10b2629577025 by Eric Snow in branch 
'master':
bpo-33608: Revert "Factor out a private, per-interpreter _Py_AddPendingCall()." 
(gh-12806)
https://github.com/python/cpython/commit/b75b1a3504a0cea6fac6ecba44c10b2629577025


--

___
Python tracker 

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



[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-12 Thread Zackery Spytz


Zackery Spytz  added the comment:

I think that the PR may have been merged too quickly. Serhiy had made a list, 
and I think that the PR was missing some necessary changes.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue36488] os.sendfile() on BSD, macOS don't return bytes sent on EINTR

2019-04-12 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
keywords: +patch
pull_requests: +12734
stage: needs patch -> patch review

___
Python tracker 

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



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

2019-04-12 Thread Sam Dunster


Change by Sam Dunster :


--
nosy: +sdunster

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Eric Snow:
> For now I'll revert.  This is not code that changes very often, so there 
> isn't much benefit to keeping it merged.  Testing against a separate branch 
> is just as easy.

Again, Python shutdown is *really* fragile. Last time I tried to "enhance" it, 
I also introduced random regressions and so I had to revert my changes.

Old info about the crash, should still be relevant:
https://bugs.python.org/issue36114#msg337090

> Could you point me at an immage for that VM or instructions on how to 
> reproduce it?  I hate having to bother you to test my changes! :)

*In theory*, you should be able to reproduce the crash on any platform. But in 
my experience, bugs which involve multiple threads are simply "more likely" on 
FreeBSD because FreeBSD manages threads very differently than Linux. Sometimes, 
a bug can only be reproduce on one specific FreeBSD computer, but once the root 
issue has been identified, we start to be able to trigger the crash reliably on 
other platforms (like Linux).

My procedure to reproduce the crash on FreeBSD:
https://bugs.python.org/issue36114#msg337092

I'm using FreeBSD 12.0 RELEASE VM hosted on Linux. My FreeBSD is not customized 
in any way.

On modern Linux distributions, coredumps are no longer written in the current 
directory but handled by a system service like ABRT on Fedora. For this reason, 
Python test runner can "miss" crashes, especially in child processes run by 
tests (not directly in the process used to run the test).

To get a coredump in the current directory on Linux, you can use:

sudo bash -c 'echo "%e.%p" > /proc/sys/kernel/core_pattern'

Manual test:

$ ./python -c 'import ctypes; ctypes.string_at(0)'
Segmentation fault (core dumped)

vstinner@apu$ git status
...
Untracked files:
python.18343
...

Say hello to python.18343 coredump!


Usually, running the command which trigger the crash multiple times in parallel 
(in different terminals, using screen and multiple terminals, etc.) makes the 
crash more likely since it does stress the system.

Sometimes, I run the Python test suite in parallel to stress the system even 
more.

The goal of the game is to trigger a race condition which depends on time. 
Stressing the system helps to "randomize" timings.

--

___
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-12 Thread Steve Dower


Steve Dower  added the comment:

Looks like Guido added the original code about 25 years ago. Since he removed 
himself from the other thread during that discussion, I'm going to assume he's 
not interested in thinking about it any more.

As the original comment says, it's a hack, but I guess there may have been an 
OS around at the time that would deliver signals across processes? Maybe after 
fork? It might be worth pinging python-dev briefly just to check if anyone 
there knows of an OS that might do this.

That said, the comment change in the PR looks totally fine to me. I'm just 
hesitant to remove something that's apparently been working for a quarter of a 
century ;)

--
nosy: +steve.dower

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +12733

___
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-12 Thread Steve Dower


Steve Dower  added the comment:

Having spent more time than I'm proud of recursing through directories, I'd be 
happy enough with a convenience function that has sensible defaults.

If I want breadth-first recursion (and I often do), I'll write it myself. I 
have a slight preference for getting all files in a directory before going 
deeper (which is not what the PR does), and I think that's most consistent with 
the current behaviour.

I don't spend enough time dealing with symlinks to have strong opinions there, 
but given we have ways to resolve symlinks but not to get back to the original 
name (and I *have* had to deal with issues where I've needed to find the 
original name from the target :roll-eyes:) I'd say don't resolve anything 
eagerly.

If there's an easy and well-known algorithm for detecting infinite symlink 
recursion (e.g. resolve and check if it's a parent of itself) then do that and 
skip it, but don't return the targets.

--
nosy: +steve.dower

___
Python tracker 

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



  1   2   >