[issue38021] pep425 tag for AIX is inadequate

2019-09-03 Thread Ned Deily


Ned Deily  added the comment:

I don't have an opinion about the bulk of the proposed change.  But, since 
_osx_support was mentioned as a model for an _aix_support, I wanted to comment 
on the history of _osx_support. _osx_support was created as a separate module 
back when the distutils2 (aka packaging) project was active and it appeared 
that, at least for some number of releases, both distutils and distutils2 would 
have to co-exist in the cpython source repo.  So, rather than duplicating the 
macOS code - most of which had been added on to distutils piecemeal over the 
years - in both places, we ripped out the existing code from distutils and put 
it into the new _osx_support module for use by both.  In the end, though, a 
different direction for distutils was chosen and the distutils2/packaging 
project code was removed from cpython prior to a formal release.  If we were 
doing it today, there probably would be no reason to have a separate 
_osx_support module as nearly all of the code is only called from one place.  Th
 us, I would not use its existence as a justification for having a separate 
_aix_support module.

--
nosy: +ned.deily

___
Python tracker 

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



[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-09-03 Thread tzickel


tzickel  added the comment:

It should be noted that this causes a big headache for users of requests / 
urllib3 / etc... as those print on each multipart response a logging warning 
based on this bug, and it might cause people to go try debugging valid code:

https://github.com/urllib3/urllib3/issues/800

https://github.com/psf/requests/issues/3001

https://github.com/diyan/pywinrm/issues/269

https://github.com/jborean93/pypsrp/issues/39

https://github.com/home-assistant/home-assistant/pull/17042

https://github.com/Azure/azure-storage-python/issues/167

and others

--
nosy: +tzickel

___
Python tracker 

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



[issue38018] Increase Code Coverage for multiprocessing.shared_memory

2019-09-03 Thread Vinay Sharma


Vinay Sharma  added the comment:

Can anyone please review my pull request. No Reviewer has been assigned yet to 
it. And I don't have permissions to request a review.

--

___
Python tracker 

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



[issue37858] CookieLib: MozillaCookieJar.py uses case-sensitive regex to validate cookies file

2019-09-03 Thread Ashley Harvey


Change by Ashley Harvey :


--
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37966] is_normalized is much slower at "no" than the standard's algorithm

2019-09-03 Thread miss-islington


miss-islington  added the comment:


New changeset 4dd1c9d9c2bca4744c70c9556b7051f4465ede3e by Miss Islington (bot) 
in branch '3.8':
closes bpo-37966: Fully implement the UAX GH-15 quick-check algorithm. 
(GH-15558)
https://github.com/python/cpython/commit/4dd1c9d9c2bca4744c70c9556b7051f4465ede3e


--
nosy: +miss-islington

___
Python tracker 

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



[issue37966] is_normalized is much slower at "no" than the standard's algorithm

2019-09-03 Thread Maxime Belanger


Maxime Belanger  added the comment:

Thanks for that!

--

___
Python tracker 

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



[issue37966] is_normalized is much slower at "no" than the standard's algorithm

2019-09-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15335
pull_request: https://github.com/python/cpython/pull/15671

___
Python tracker 

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



[issue37966] is_normalized is much slower at "no" than the standard's algorithm

2019-09-03 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 2f09413947d1ce0043de62ed2346f9a2b4e5880b by Benjamin Peterson 
(Greg Price) in branch 'master':
closes bpo-37966: Fully implement the UAX #15 quick-check algorithm. (GH-15558)
https://github.com/python/cpython/commit/2f09413947d1ce0043de62ed2346f9a2b4e5880b


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



[issue36252] update to Unicode 12

2019-09-03 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +15334
pull_request: https://github.com/python/cpython/pull/12256

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
priority: normal -> low

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Paul, you're a new core dev.  Please don't take issues away from the assignee.  
Please try to learn from more seasoned core devs.  Don't argue with everything 
they say and demand they give you justifications.

I asked Tim to opine on this because 1) he is one of the principal authors of 
the datetime module, 2) he was party to previous decisions to upgrade from 
tuples to struct seq, 3) he has a good deal of common sense and knows what is 
important, and 4) he's far more senior than me, so there is a chance you might 
listen to him (my comments don't seem to carry any weight with you).

--
assignee: p-ganssle -> tim.peters

___
Python tracker 

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



[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2019-09-03 Thread Maxime Belanger


Change by Maxime Belanger :


--
versions: +Python 3.9 -Python 2.7, Python 3.7

___
Python tracker 

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



[issue32280] Expose `_PyRuntime` through a section name

2019-09-03 Thread Maxime Belanger


Maxime Belanger  added the comment:

Thanks for taking a look! To answer your question, the need for the named 
section comes not from the API being being "internal", but because we need to 
access it at runtime from a tool running in a separate process.

We have augmented Crashpad (Google's crash reporter) tool, which inspects the 
memory of a crashing process to create/upload a report, to access each native 
thread's stack and reconstruct its Python stack frames. This allows us to 
quickly make sense of native crashes involving Python code. 

To do this, the tool needs to know where the Python runtime stores state within 
thread-local storage. This is actually the only reason we need to access 
`_PyRuntime`: it allows us to retrieve `autoTSSKey` for the process, which we 
can use to look up the `PyThreadState` for each underlying/native thread.

At the time, `_PyRuntime` seemed like a natural structure to expose and a named 
section a simple-enough way of doing so. We're certainly open to alternatives 
if you think there's a better way.

Given your plans for 3.9: I'm assuming `autoTSSKey` will remain the same 
per-process?

--

___
Python tracker 

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



[issue38023] Deal better with StackOverflow exception when debugging

2019-09-03 Thread almenon anon


New submission from almenon anon :

Code that runs fine in the command line can crash in the debugger

Note that because https://bugs.python.org/issue10933 is not fixed yet I'm 
assuming this applies to all python 3 versions but it was confirmed in python 
3.6

See https://github.com/microsoft/ptvsd/issues/1379:

@fabioz says it better than I could:

> This is really a CPython bug, not ptvsd (CPython is crashing because of a 
> stack overflow when the stack overflow is thrown inside a tracing function -- 
> because the user code already recursed too much).

> As a note, the debugger is even disabled on the face of a stack overflow 
> (see: https://bugs.python.org/issue10933), so, even if it didn't crash, 
> things wouldn't work very well from that point onwards...

> Maybe we could try to detect that a stack overflow is about to happen and 
> notify about it right before it happens in the debugger so that users could 
> know that the debugger would stop (note that this is actually pretty hard to 
> do from the debugger without killing performance because we don't have a 
> stack in the debugger as we try to run with frames untraced whenever possible 
> and I don't think there's a python API that provides the size of the stack in 
> a fast way -- but maybe I'm wrong, I haven't investigated much).

> As a note, the ideal place for that would probably be in CPython itself (when 
> it got to that condition it could raise the recursion limit a bit and call a 
> handler or at least give some warning if configured to do so as it can be 
> really puzzling to know that the tracing got disabled because of a swallowed 
> StackOverflow).

> So, I'm going to rename this issue to Deal better with StackOverflow in 
> CPython so that it reflects better the issue at hand, but it's not currently 
> high-priority -- that's really a bug in CPython itself and is probably better 
> fixed there (the workaround in user code -- in this case foxdot -- is not 
> throwing a StackOverflow).

--
components: Interpreter Core
messages: 351107
nosy: almenon anon
priority: normal
severity: normal
status: open
title: Deal better with StackOverflow exception when debugging
type: crash
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue23670] Modifications to support iOS as a cross-compilation target

2019-09-03 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
title: Restore -> Modifications to support iOS as a cross-compilation target

___
Python tracker 

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



[issue36030] add internal API function to create tuple without items array initialization

2019-09-03 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +15333
pull_request: https://github.com/python/cpython/pull/15670

___
Python tracker 

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



[issue23670] Restore

2019-09-03 Thread Jennifer Baker


Change by Jennifer Baker :


--
title: Terminate bugs -> Restore

___
Python tracker 

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



[issue23670] Terminate bugs

2019-09-03 Thread Jennifer Baker


Change by Jennifer Baker :


--
title: Modifications to support iOS as a cross-compilation target -> Terminate 
bugs

___
Python tracker 

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Using -D was a temporary kludge until someone updated the html2tk writer.  The 
key to the fix was adding the prevtag attribute with opener? field.

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread miss-islington


miss-islington  added the comment:


New changeset 952ea67289ffbd2f4785a9e537884a63d1208101 by Miss Islington (bot) 
in branch '3.8':
bpo-38022: IDLE: upgrade help.html to sphinx 2.x HTML5 output (GH-15664)
https://github.com/python/cpython/commit/952ea67289ffbd2f4785a9e537884a63d1208101


--

___
Python tracker 

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread miss-islington


miss-islington  added the comment:


New changeset 52fd6616235412d4a49ef28c1046bd133b30bc90 by Miss Islington (bot) 
in branch '3.7':
bpo-38022: IDLE: upgrade help.html to sphinx 2.x HTML5 output (GH-15664)
https://github.com/python/cpython/commit/52fd6616235412d4a49ef28c1046bd133b30bc90


--
nosy: +miss-islington

___
Python tracker 

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15331
pull_request: https://github.com/python/cpython/pull/15667

___
Python tracker 

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15332
pull_request: https://github.com/python/cpython/pull/15668

___
Python tracker 

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 580bdb0ece681537eadb360f0c796123ead7a559 by Terry Jan Reedy (Tal 
Einat) in branch 'master':
bpo-38022: IDLE: upgrade help.html to sphinx 2.x HTML5 output (GH-15664)
https://github.com/python/cpython/commit/580bdb0ece681537eadb360f0c796123ead7a559


--

___
Python tracker 

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



[issue38020] os.path.realpath crashes in Windows Store package

2019-09-03 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



[issue38020] os.path.realpath crashes in Windows Store package

2019-09-03 Thread miss-islington


miss-islington  added the comment:


New changeset 54dac6c0f4fa24d03025c45899ee7c5f2a4c367e by Miss Islington (bot) 
in branch '3.8':
bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663)
https://github.com/python/cpython/commit/54dac6c0f4fa24d03025c45899ee7c5f2a4c367e


--
nosy: +miss-islington

___
Python tracker 

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread Tal Einat


Tal Einat  added the comment:

See PR GH-15664 with an implementation.

--

___
Python tracker 

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



[issue38020] os.path.realpath crashes in Windows Store package

2019-09-03 Thread Steve Dower


Steve Dower  added the comment:


New changeset 993ac92418839427d4068d6ae8e618b06b5d9294 by Steve Dower in branch 
'master':
bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663)
https://github.com/python/cpython/commit/993ac92418839427d4068d6ae8e618b06b5d9294


--

___
Python tracker 

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



[issue38020] os.path.realpath crashes in Windows Store package

2019-09-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15330
pull_request: https://github.com/python/cpython/pull/15665

___
Python tracker 

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread Tal Einat


Change by Tal Einat :


--
keywords: +patch
pull_requests: +15329
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15664

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread STINNER Victor


STINNER Victor  added the comment:

collect() of gcmodule.c:

* collect() builds an "unreachable" list which is quite important in this bug
* the bug occurs in delete_garbage() which uses the unreachable list
* weak references part of unreachable are handled before delete_garbage() in 
handle_weakrefs(): "Clear weakrefs and invoke callbacks as necessary".

It seems like reproducer.tar.gz and gc_crash.py crashes involve a reference 
cycle.

reproducer.tar.gz uses a weak reference which is *not* part of the reference 
cycle.

--

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread STINNER Victor


STINNER Victor  added the comment:

gc_crash.py:

* PyObject_GC_UnTrack() + PyObject_GC_Track() is used to order objects in the 
GC collection 0, the objects which are involved in the reference cycle.

* BadGC2Type type is implemented in C, uses Py_TPFLAGS_HAVE_GC, implements 
tp_traverse, but it doesn't implement tp_clear.

* IHMO gc_crash.py is only legit code. BadGC2Type implements the GC protocol 
(except to tp_clear).


I'm not sure that it's the same bug than reproducer.tar.gz which uses a weak 
reference.

BadGC2Type is used to call a function in tp_dealloc. It should be possible to 
use a weak reference for that: the weak reference can use a callback. But I 
failed write a reproducer script using a weak reference.

--

___
Python tracker 

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



[issue38022] IDLE: Upgrade help.html to sphinx 2

2019-09-03 Thread Tal Einat


New submission from Tal Einat :

The rest of our docs use version 2.x of Sphinx with its new HTML5 output 
writer.  However, IDLE's help.html is a version of idle.rst rendered with the 
old writer, via the `-D html4_writer=1` command line parameter.

The reason for this is that the new output is slightly different, and causes 
some regression in how IDLE's HTML help renderer displays the help information.

I propose to upgrade the IDLE HTML help renderer to properly handle the new 
output.

--
assignee: terry.reedy
components: IDLE
messages: 351097
nosy: taleinat, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: Upgrade help.html to sphinx 2
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-09-03 Thread Michael Felt


New submission from Michael Felt :

PEP425 stats the platform tag is what distutils.util.get_platform() (and 
sysconfig.get_platform()) returns.

By that definition - anything is okay, as long as something is returned.

However, in practice, it is insufficient. Simplest case - there is no 
indication of the fitness of the running Python. This, by itself, may be a 
reason that VARs and others have never attempted to develop binary (compatible) 
eggs or wheels.

Looking further at missed potential - AIX has an algorithm that can be used to 
permit a forward (binary) compatible ABI for packaging. The current state of 
packaging for AIX is to create an RPM or INSTALLP formatted package - and 
install that. Even pure-python modules must be packaged in this way - to 
satisfy the "binary" dependencies.

For a binary compatible algorithm to be possible changes will be needed in pypa 
tools. However, rather than "patch" three sets of tools to correct the 
inadequacy of the current PEP425 tag for AIX I propose to tag AIX as:
AIX-VRTL-YYWW-BT or
AIX.{}{}{:02d}.{}.{}".format(v,r,int(tl),bd,sz)

where v=version, r=release, tl=technology_level, bd=builddate, and sz=fitness 
(32|64).

Further, rather than place this code "inline" in distutils or sysconfig create 
a new support module for AIX - similar to the _osx_support module (I.e. 
_aix_support).

--
components: Distutils, Library (Lib)
messages: 351096
nosy: Michael.Felt, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: pep425 tag for AIX is inadequate
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38020] os.path.realpath crashes in Windows Store package

2019-09-03 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue38020] os.path.realpath crashes in Windows Store package

2019-09-03 Thread Steve Dower


Steve Dower  added the comment:

I forgot to initialize the result object in readlink() on Windows, and so when 
we hit the failure path it returns garbage. Attempting to DECREF that garbage 
fails.

The call to readlink() fails in the Store app because sys.executable is not a 
readable link. It should fail in most cases anyway, but apparently outside of 
the app container the stack is NULL here.

--

___
Python tracker 

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



[issue38020] os.path.realpath crashes in Windows Store package

2019-09-03 Thread Steve Dower


New submission from Steve Dower :

When installed via the Store, "python3.8 -c 'import sysconfig'" crashes hard.

So far, I've discovered it's inside an os.path.realpath() call, and appears to 
be a refcounting issue (double DECREF I think), but haven't gotten any further 
yet.

I'm looking into it.

--
assignee: steve.dower
components: Windows
keywords: 3.8regression
messages: 351094
nosy: lukasz.langa, paul.moore, steve.dower, tim.golden, zach.ware
priority: release blocker
severity: normal
stage: test needed
status: open
title: os.path.realpath crashes in Windows Store package
type: crash
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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-03 Thread Paul Ganssle


Paul Ganssle  added the comment:

In an effort to get a sense of how useful this would actually be, I did a code 
search for `.isoformat()` on github. I saw a few doctests that will break (if 
they're even being run) if we make this change, but I also found that the 
*vast* majority of uses of `isocalendar` seem to be people pulling out a single 
component of it, like:  `return datetime.datetime.now().isocalendar()[1]`.

That is not the kind of usage pattern I was envisioning when I said that this 
was a marginal improvement, a *lot* of this code could be made considerably 
more readable with named fields. If indeed the performance is similar or the 
same and this won't impact consumers of the pure python version of the module 
unduly (I checked in #pypy and they think that it shouldn't be more than a 
minor irritation if anything), then I am changing my -1 to a +1.

--
assignee: tim.peters -> p-ganssle

___
Python tracker 

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



[issue37597] audit event table breaks PDF sphinx build

2019-09-03 Thread Steve Dower


Steve Dower  added the comment:

Guessing we still need to fix this...

Julien - does this exception get raised through 
Doc/tools/extensions/pyspecific.py? At the get_relative_uri() call (line 573) 
perhaps?

If so, it seems like we could just handle it there and leave out any links that 
aren't in the doc.

--

___
Python tracker 

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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-09-03 Thread miss-islington


miss-islington  added the comment:


New changeset 59e8fba7189d0e86d428a1125744afb8b0f40b5d by Miss Islington (bot) 
(Ashwin Ramaswami) in branch '3.8':
[3.8] bpo-21315: Fix parsing of encoded words with missing leading ws 
(GH-13425) (GH-15655)
https://github.com/python/cpython/commit/59e8fba7189d0e86d428a1125744afb8b0f40b5d


--
nosy: +miss-islington

___
Python tracker 

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



[issue38019] AttributeError: 'NoneType' object has no attribute '_add_reader' / '_remove_reader'

2019-09-03 Thread Marat Sharafutdinov


New submission from Marat Sharafutdinov :

I'm trying to use dwdiff (https://os.ghalkes.nl/dwdiff.html) to compare two 
text files. While running subprocess I'm getting the following errors:

```
Traceback (most recent call last):
  File "test_dwdiff.py", line 17, in 
asyncio.run(main())
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/runners.py", 
line 43, in run
return loop.run_until_complete(main)
  File 
"/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/base_events.py", line 
579, in run_until_complete
return future.result()
  File "test_dwdiff.py", line 14, in main
await asyncio.gather(*(dwdiff() for __ in range(25)))
  File "test_dwdiff.py", line 10, in dwdiff
await process.communicate()
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/subprocess.py", 
line 187, in communicate
loop=self._loop)
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/subprocess.py", 
line 166, in _read_stream
output = await stream.read()
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/streams.py", 
line 633, in read
block = await self.read(self._limit)
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/streams.py", 
line 646, in read
self._maybe_resume_transport()
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/streams.py", 
line 417, in _maybe_resume_transport
self._transport.resume_reading()
  File 
"/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/unix_events.py", line 
498, in resume_reading
self._loop._add_reader(self._fileno, self._read_ready)
AttributeError: 'NoneType' object has no attribute '_add_reader'
```

and

```
Exception in callback SubprocessStreamProtocol.pipe_data_received(1, 
b'\xd0\x9f\xd...b8\xd1\x8f.\n')
handle: 
Traceback (most recent call last):
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/events.py", 
line 88, in _run
self._context.run(self._callback, *self._args)
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/subprocess.py", 
line 71, in pipe_data_received
reader.feed_data(data)
  File "/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/streams.py", 
line 440, in feed_data
self._transport.pause_reading()
  File 
"/home/decaz/.pyenv/versions/3.7.4/lib/python3.7/asyncio/unix_events.py", line 
495, in pause_reading
self._loop._remove_reader(self._fileno)
AttributeError: 'NoneType' object has no attribute '_remove_reader'
```

The code is the following:
```
import asyncio

async def dwdiff():
process = await asyncio.create_subprocess_exec(
'/usr/local/bin/dwdiff', 'f1.txt', 'f2.txt',
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
await process.communicate()

async def main():
await asyncio.gather(*(dwdiff() for __ in range(25)))

asyncio.run(main())
```

Two text files f1.txt and f2.txt are attached as archive.

Perhaps it relates to https://bugs.python.org/issue29704

--
components: asyncio
files: f1_and_f2.zip
messages: 351090
nosy: asvetlov, decaz, yselivanov
priority: normal
severity: normal
status: open
title: AttributeError: 'NoneType' object has no attribute '_add_reader' / 
'_remove_reader'
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48589/f1_and_f2.zip

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-09-03 Thread miss-islington


miss-islington  added the comment:


New changeset ea21389dda401457198fb214aa2c981a45ed9528 by Miss Islington (bot) 
(Ashwin Ramaswami) in branch '3.7':
[3.7] bpo-37764: Fix infinite loop when parsing unstructured email headers. 
(GH-15239) (GH-15654)
https://github.com/python/cpython/commit/ea21389dda401457198fb214aa2c981a45ed9528


--

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-03 Thread Paul Ganssle


Paul Ganssle  added the comment:

> What IS unprecedented is having a C function bend over backwards to return an 
> instance of collections.namedtuple().  

Is this an issue that anyone is currently insisting upon? From what I can tell 
the current implementation uses a structseq and none of my objections had to do 
with the properties of a structseq.

> ISTM the cross-version pickling issue is minor red herring.  We've cheerfully 
> upgraded tuples to structseqs on a number of occasions and it hasn't been an 
> issue.

I generally agree with this - it is nice to not break this compatibility when 
there's no good reason to do so, but pickling data in one version of Python and 
unpickling it in another is not something that's supported by the pickle module 
anyway.

> Tim, would you please weigh in on this so we can put this to bed, either 
> closing the request because we're too meek to make any change, 
upgrading to structseq to provide the requested functionality, or twisting our 
code in weird ways to have a C function become dependent on a pure python 
module.

I must take some umbrage at this framing of the question. I don't even know 
where meekness comes into it - adding *any* new functionality brings support 
burdens and additional code complexity and changes to code that's been stable 
for a long time like `dateutil.isocalendar` is particularly likely to cause 
breakages if only because of the time people have had to start relying on the 
specific implementation. I have merely asked for a justification and an 
argument other than your subjective judgement that this is a nice improvement.

--

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file48588/gc_crash.patch

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread STINNER Victor


STINNER Victor  added the comment:

Aha! I reproduced the crash with attached gc_crash.py and gc_crash.patch:

# cd /path/to/python/source
$ git apply gc_crash.patch
$ make
$ ./python gc_crash.py
Segmentation fault (core dumped)

--
Added file: https://bugs.python.org/file48587/gc_crash.py

___
Python tracker 

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



[issue38018] Increase Code Coverage for multiprocessing.shared_memory

2019-09-03 Thread Vinay Sharma


Change by Vinay Sharma :


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

___
Python tracker 

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



[issue38018] Increase Code Coverage for multiprocessing.shared_memory

2019-09-03 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +davin

___
Python tracker 

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



[issue34226] cgi.parse_multipart() requires undocumented CONTENT-LENGTH in Python 3.7

2019-09-03 Thread Niklas Sombert


Change by Niklas Sombert :


--
nosy: +ytvwld

___
Python tracker 

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



[issue38018] Increase Code Coverage for multiprocessing.shared_memory

2019-09-03 Thread Vinay Sharma


New submission from Vinay Sharma :

Increase Code coverage for multiprocessing.shared_memory.SharedMemory Class

--
components: Tests
messages: 351085
nosy: vinay0410
priority: normal
severity: normal
status: open
title: Increase Code Coverage for multiprocessing.shared_memory
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



[issue38017] IO-like interface for SHAKE-* and other XOFs.

2019-09-03 Thread DannyNiu


New submission from DannyNiu :

The SHAKE family functions are the first formally defined XOFs (eXtensible 
Output Functions), previous implementations such as MGF from PKCS#1 relies on 
ad-hoc construction. 

In the current library, SHAKE-* are given digest-like interface, where their 
output has to be always obtained from the start; where as in reality, there 
exists applications that consumes such output progressively, such as 
deterministic key generation from fixed seed, and more specifically, as the 
random oracle used in Crystals-Dilithium post-quantum digital signature scheme. 

Therefore, I'd like developers consider adding ``shake.read(len)'' function to 
support IO-like consumption in hashlib.

--
components: Library (Lib)
messages: 351084
nosy: dannyniu
priority: normal
severity: normal
status: open
title: IO-like interface for SHAKE-* and other XOFs.
type: enhancement

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread STINNER Victor


STINNER Victor  added the comment:

Second step: when func_clear() is called, the closure is cleared. Clearing the 
closure should call the function which is being cleared (or is already cleared).

---
import gc

class CallFunc:
def __del__(self):
func = self.func
if func is None:
return
print("CallFunc", func)
func("call func from CallFunc.__del__")

def create_remove():
call_func = CallFunc()
def remove(msg):
x = call_func
print(msg)
remove.__name__ = "evil_func"
call_func.func = remove
return call_func, remove

call_func, remove = create_remove()
print("== clear ==")
call_func = None
remove = None
print()

print("== collect ==")
gc.collect()
print()

print("== exit ==")
---

Output (with my hacked CPython):
--
== clear ==

== collect ==
CallFunc .remove at 0x7fab8a189eb0>
call func from CallFunc.__del__
func_clear remove() -- in delete_garbage? 1

== exit ==
--

call_func and remove are part of a reference cycle. A forced garbage collection 
breaks the cycle and removes the two objects, but they are not removed in the 
expected order:

* first: call_func
* then: remove

The crash requires to destroy the objects in the reverse order

--

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread STINNER Victor


STINNER Victor  added the comment:

I failed to write a reproducer from scratch. So let me share my notes here. The 
first point is that remove() function of WeakValueDictionary keeps 
WeakValueDictionary.data alive like that:

---
class NoisyDel:
def __del__(self):
print("dealloc data dict")

def create_closure():
data = {0: NoisyDel()}
def remove():
return data
return remove

remove = create_closure()
print("clear ")
remove = None
print("exit")
---

data is only deleted once remove is cleared.

--

___
Python tracker 

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



[issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long

2019-09-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

These opcodes are always used with CALL_FUNCTION_EX (which can be used also 
without any of them).

f(*a, *b, **c, **d)
  1   0 LOAD_NAME0 (f)
  2 LOAD_NAME1 (a)
  4 LOAD_NAME2 (b)
  6 BUILD_TUPLE_UNPACK_WITH_CALL 2
  8 LOAD_NAME3 (c)
 10 LOAD_NAME4 (d)
 12 BUILD_MAP_UNPACK_WITH_CALL 2
 14 CALL_FUNCTION_EX 1

I though about naming CALL_FUNCTION_EX as CALL_FUNCTION_VAR in 3.6, but this 
name was used in pre-3.6 bytecode with different semantic. Now I think there is 
smaller change of confusion, so it can be renamed to CALL_FUNCTION_VAR or 
something other.

--

___
Python tracker 

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



[issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long

2019-09-03 Thread Nick Coghlan


Nick Coghlan  added the comment:

Reviewing this again now, I think my previous naming suggestion is problematic, 
as it encourages conflating two different concepts that use similar syntax:

* collecting arbitrary positional parameters in a tuple (VAR_POSITIONAL) or 
arbitrary keyword parameters in a dictionary (VAR_POSITIONAL, VAR_KEYWORD)
* unpacking function arguments from iterables (BUILD_VAR_POSITIONAL) or 
mappings (BUILD_VAR_KEYWORD)

I think the fix for that error is straightforward though: replace "VAR" with 
"ARG" in the new opcode names, giving:

* BUILD_ARG_POSITIONAL
* BUILD_ARG_KEYWORD

That should also read nicely with Zackery's documentation updates.

--

___
Python tracker 

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



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-09-03 Thread Tal Einat


Tal Einat  added the comment:


New changeset 58067d2cf6e81187f9782aff03cc8bec3d878778 by Tal Einat (Miss 
Islington (bot)) in branch '3.8':
bpo-37798: Fix _statistics module doc (GH-15546)
https://github.com/python/cpython/commit/58067d2cf6e81187f9782aff03cc8bec3d878778


--

___
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-09-03 Thread Antony Lee


Change by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-09-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15326
pull_request: https://github.com/python/cpython/pull/15660

___
Python tracker 

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



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-09-03 Thread Tal Einat


Tal Einat  added the comment:


New changeset 0cf832a9ef84be6e18aad02464814530d80b82b2 by Tal Einat (Dong-hee 
Na) in branch 'master':
bpo-37798: Fix _statistics module doc (GH-15546)
https://github.com/python/cpython/commit/0cf832a9ef84be6e18aad02464814530d80b82b2


--
nosy: +taleinat

___
Python tracker 

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



[issue17239] XML vulnerabilities in Python

2019-09-03 Thread Dirkjan Ochtman


Change by Dirkjan Ochtman :


--
nosy:  -djc

___
Python tracker 

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



[issue7247] test_fcntl_64_bit from test_fcntl.py fails in Python 2.6.4

2019-09-03 Thread Dirkjan Ochtman


Change by Dirkjan Ochtman :


--
nosy:  -djc

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2019-09-03 Thread Dirkjan Ochtman


Change by Dirkjan Ochtman :


--
nosy:  -djc

___
Python tracker 

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



[issue29427] Option to skip padding for base64 urlsafe encoding/decoding

2019-09-03 Thread Dirkjan Ochtman


Change by Dirkjan Ochtman :


--
nosy: +djc

___
Python tracker 

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2019-09-03 Thread Dirkjan Ochtman


Change by Dirkjan Ochtman :


--
nosy:  -djc

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread STINNER Victor


STINNER Victor  added the comment:

Attached crash.tar.gz: minimum reproducer which doesn't depend on FreeIPA 
anymore.

Depends on:

* cffi (_cffi_backend dynamic library)
* pycparser
* Python 3.8 (need "python3.8")

To reproduce the crash:

$ tar -xf reproducer.tar.gz 
$ cd reproducer/
$ ./bug.sh 

Output:

(...)
++ env/bin/python ./crash.py
exit
./bug.sh : ligne 7 : 14529 Segmentation fault  (core dumped)env/bin/python 
./crash.py
++ echo 'exitcode: 139'
exitcode: 139

--
Added file: https://bugs.python.org/file48586/reproducer.tar.gz

___
Python tracker 

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



[issue37398] contextlib.ContextDecorator decorating async functions

2019-09-03 Thread Nick Coghlan


Nick Coghlan  added the comment:

The query in #37743 highlights that generator functions and other wrapped 
iterator factories actually face a similar problem: they need the function body 
to contain "yield from wrapped(*args, **kwargs)" if the CM is going to be 
closed after the iterator terminates (or is closed), rather than closing 
immediately after the iterator is created.

--

___
Python tracker 

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



[issue37941] python -m and runpy.run_module set different __name__ by default

2019-09-03 Thread Julian Berman


Julian Berman  added the comment:

Is there no desire to have an API that works like -m (entirely. In this and
any other way)?

On Tue, Sep 3, 2019, 09:41 Nick Coghlan  wrote:

>
> Change by Nick Coghlan :
>
>
> --
> stage:  -> 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



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

2019-09-03 Thread Nick Coghlan


Nick Coghlan  added the comment:

This is a documentation bug, as the current behaviour is as intended, but the 
documented equivalence doesn't hold for generator functions: for a generator 
function, the CM will only be applied when the generator is instantiated, 
whereas the inline context manager version will be held open until the 
generator is closed or destroyed.

That said, an approach similar to the one discussed in #37398 could also be 
applied, here, with a separate "ContextDecorator.generator()" class method 
added to give the "wrapped yield from" behaviour. If anyone is interested in 
pursuing that, it can be filed as a separate enhancement issue (leaving this 
bug to cover the fact that the existing documentation is only accurate for 
regular synchronous functions)

--
assignee: ncoghlan -> 
components: +Documentation -Library (Lib)

___
Python tracker 

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



[issue37398] contextlib.ContextDecorator decorating async functions

2019-09-03 Thread Nick Coghlan


Nick Coghlan  added the comment:

It isn't the simple case where the auto-detection idea concerns me, it's 
decorator stacking cases like:

@outer
@magic_detection
@inner_forces_async
def sync_native_api():
...

(With the original asyncio.coroutine being one example, but there are other 
situations where this comes up, like a wrapper that bundles synchronous calls 
up into an executor invocation)

That said, I'd be completely fine with a combination where:

* ContextDecorator grew a coroutine() classmethod (open to suggestions for 
bikeshed colours)
* The regular ContextDecorator constructor emitted a warning suggesting 
"cls.coroutine" when it was applied to a synchronous function

Then the original example would provide distinct spellings for the sync and 
async case, without the definition of PerfTimer needing to change:

  @PerfTimer.coroutine('query_async')
  async def query_or_throw(self, q):
  return _parse_result(await self._send_query(q))

  @PerfTimer('query_sync')
  def query_or_throw(self, q):
  return _parse_result(self._send_query_sync(q))

That way we're still refusing to guess in the face of ambiguity (does the user 
want the coroutine version of the context manager, or did they accidentally mix 
a potentially blocking synchronous context manager into their async code?), but 
the warning can be usefully explicit regarding how to resolve the ambiguity.

--

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread Christian Heimes


Christian Heimes  added the comment:

Pablo, Victor, could you please assist Armin on the CFFI issue? As usual the 
situation is more complex than I anticipated.

--

___
Python tracker 

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



[issue37947] symtable_handle_namedexpr does not adjust correctly the recursion level

2019-09-03 Thread Nick Coghlan


Nick Coghlan  added the comment:

We never actually coded a reproducer for this, but if we had, it would have 
been a crash bug.

--
type:  -> crash

___
Python tracker 

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



[issue31874] [feature] runpy.run_module should mimic script launch behavior for sys.path

2019-09-03 Thread Nick Coghlan


Nick Coghlan  added the comment:

Good point regarding the heuristic: it would need to take the requested module 
name into account to be correct.

* check if the requested module was found relative to the current directory 
(can be worked out from __main__.__spec__ and the current working directory)
* if it was, make sys.path[0] the absolute path of the current directory
* otherwise, remove sys.path[0] entirely

--
nosy: +ncoghlan

___
Python tracker 

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



[issue37941] python -m and runpy.run_module set different __name__ by default

2019-09-03 Thread Nick Coghlan


Nick Coghlan  added the comment:

Yes, this is deliberate. From the run_module documentation: "__name__ is set to 
run_name if this optional argument is not None, to mod_name + '.__main__' if 
the named module is a package and to the mod_name argument otherwise."

This allows arbitrary code to be executed to populate a namespace, but you have 
to explicitly opt-in to having a second pseudo-__main__ module run in the same 
process (with all the potential pickle compatibility issues that doing so 
creates).

--
resolution:  -> not a bug

___
Python tracker 

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



[issue37941] python -m and runpy.run_module set different __name__ by default

2019-09-03 Thread Nick Coghlan


Change by Nick Coghlan :


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



[issue38016] Results with re.sub and re.replace is giving different results

2019-09-03 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue38016] Results with re.sub and re.replace is giving different results

2019-09-03 Thread hongweipeng


hongweipeng  added the comment:

It's because ```re.sub('0.072', '72.0', newStringUpdated)``` match '03072' in 
-0.043'03072'77670375.

`.` can match any character in regular expression.So I don't think that's a 
issue.

--
nosy: +hongweipeng

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-03 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks Victor!

I have opened a bug for CFFI, 
https://bitbucket.org/cffi/cffi/issues/416/python-38-segfault-cfield_type-does-not

--

___
Python tracker 

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



[issue38016] Results with re.sub and re.replace is giving different results

2019-09-03 Thread Mallinath Akkalkot


Change by Mallinath Akkalkot :


Removed file: https://bugs.python.org/file48584/Bug_Description_Regular 
Expression.pptx

___
Python tracker 

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



[issue38016] Results with re.sub and re.replace is giving different results

2019-09-03 Thread Mallinath Akkalkot


Change by Mallinath Akkalkot :


Added file: https://bugs.python.org/file48585/Bug_Description_Regular 
Expression.pptx

___
Python tracker 

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



[issue38016] Results with re.sub and re.replace is giving different results

2019-09-03 Thread Mallinath Akkalkot


New submission from Mallinath Akkalkot :

Issue is explained in the attached presentation for the below python script.

# PYTHON script
import re

stringPassed = "START, 0.272342208623734, 0.122712611838329\nCIRCL, 0.2739, 
0.1175, 0.2644, 0.1175\nCIRCL, 0.2644, 0.108, 0.2644, 0.1175\nLINE, 
0.26237716818855, 0.108\nCIRCL, 0.2564, 0.102522934456486, 0.26237716818855, 
0.102\nLINE, 0.255041919210401, 0.087\nLINE, 0.255041919210401, 0.072\nCIRCL, 
0.239541747114243, -0.0106446715786942, 0.0269671265080016, 
0.07200296\nCIRCL, 0.2391, -0.0138, 0.2456, 
-0.0138\nLINE, 0.2391, -0.0358\nCIRCL, 
0.243376868486329, -0.0411080018232587, 0.2456, -0.0358\nLINE, 
0.24865951460066, -0.0430307277670375\nCIRCL, 0.255041919210401, 
-0.0521457461886608, 0.245341919210401, -0.0521457461886608\nLINE, 
0.255041919210401, -0.087\nLINE, 0.2564, -0.102522934456486\nCIRCL, 
0.26237716818855, -0.108, 0.26237716818855, -0.102\nLINE, 0.2644, 
-0.108\nCIRCL, 0.2739, -0.1175, 0.2644, -0.1175\nCIRCL, 0.272342208623734, 
-0.122712611838329, 0.2644, -0.1175\n"

retVal = re.findall(r"(\w+,\s+)(-\d+\.\d+)|(\d+\.\d+)", stringPassed, 
re.MULTILINE)

floatNumbersList = []   # List conatins all Folat numbers
for each in retVal:
for each in each:
if each != "":floatNumbersList.append(each)

newStringUpdated = stringPassed
for eachVal in floatNumbersList:
newVal =  str(float(eachVal)*1000)
retVals = re.sub(eachVal, newVal, newStringUpdated)
#   retVals = newStringUpdated.replace(eachVal, newVal)
newStringUpdated = retVals

print(newStringUpdated)

--
components: Regular Expressions
files: Bug_Description_Regular Expression.pptx
messages: 351066
nosy: Mallinath Akkalkot, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Results with re.sub and re.replace is giving different results
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48584/Bug_Description_Regular 
Expression.pptx

___
Python tracker 

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