[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-02-27 Thread Inada Naoki


Inada Naoki  added the comment:

Would you review the PR 18684?

--

___
Python tracker 

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



[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-02-27 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue29505] Submit the re, json, csv, & struct modules to oss-fuzz testing

2020-02-27 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
title: Submit the re, json, & csv modules to oss-fuzz testing -> Submit the re, 
json, csv, & struct modules to oss-fuzz testing

___
Python tracker 

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



[issue29505] Submit the re, json, csv, & struct modules to oss-fuzz testing

2020-02-27 Thread Ammar Askar


Change by Ammar Askar :


--
nosy: +ammar2
nosy_count: 9.0 -> 10.0
pull_requests: +18043
pull_request: https://github.com/python/cpython/pull/18679

___
Python tracker 

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



[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-02-27 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> inada.naoki

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Evgeny Boytsov


Evgeny Boytsov  added the comment:

I'am unable to reproduce neither my or your issues with python 3.6. The program 
runs infinitely as it meant to be. Can you please give me C++ traceback from 
the core dump, which was created when you ran my program?

--

___
Python tracker 

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



[issue39780] Add HTTP Response code 103

2020-02-27 Thread Dong-hee Na


Dong-hee Na  added the comment:

Yes, this is duplicated issue.

--
nosy: +corona10

___
Python tracker 

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



[issue39779] [argparse] Add parameter to sort help output arguments

2020-02-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion, but I am going to decline.

Since the parser remembers the order the arguments were added, the programmer 
already has complete control over the ordering of arguments.

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-02-27 Thread Tim Peters


Tim Peters  added the comment:

I'm suspecting that maybe we shouldn't be doing

Py_VISIT(od->od_weakreflist);

at all - best I can tell from a quick (non-exhaustive!) scan, the objects in 
the weakref list aren't incref'ed to begin with.  And even if they were, that 
line would only be looking at the head of the list, ignoring all the non-head 
weakrefs after the head.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-02-27 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +eric.snow

___
Python tracker 

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



[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-02-27 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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Evgeny Boytsov


Evgeny Boytsov  added the comment:

Thank you for feedback. I will try to reproduce the issue with 3.6. By the way, 
haven't you used gdb with python pretty-printers enabled to examine the state 
of the program? I've got the same error message, then I breaked the execution 
in debugger and tried to examine the callstack of threads, that stucked in 
UnlockGILandSleep. The reason for it is clear: then the debugger tries to build 
a callstack, some of pretty printers try to execute some python code to give a 
better representation of interpreter objects. The code is executed at the top 
of the stack of the examined thread. Since this thread explicitly released the 
GIL before going to sleep, these functions hit the assert about calling the 
memory allocator without holdng the GIL. Disabling pretty-printers makes these 
error messages to disappear.

--

___
Python tracker 

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



[issue39780] Add HTTP Response code 103

2020-02-27 Thread Martin Panter


Martin Panter  added the comment:

See also Issue 39509, proposing to add 103 and "425 Too Early"

--
nosy: +martin.panter

___
Python tracker 

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



[issue39704] Disable code coverage

2020-02-27 Thread Ammar Askar


Ammar Askar  added the comment:

Looks like it was just cached, the latest pull request didn't get a codecov 
comment nor was it ran on the latest commit: 
https://github.com/python/cpython/pull/18682

Should this be back-ported so backport pull requests/pull requests to other 
versioned branches don't get affected by this either?

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-02-27 Thread Tim Peters


Tim Peters  added the comment:

Thanks for the succinct example!  Although you don't need the print() ;-)

I can confirm this crashes the same way under a current master build (albeit on 
Windows 64-bit).

gc is calculating how many references in the current generation are accounted 
for by intra-generation references, and gc's visit_decref() is getting called 
back by odictobject.c's odict_traverse(), on line

Py_VISIT(od->od_weakreflist);

gc has found a second pointer to od->od_weakreflist, which is more than its 
refcount (1) claims exist.

Python's weakref implementation gives me headaches, so I'm adding Raymond to 
the nosy list under the hope the problem will be obvious to him.

--
components: +Extension Modules -C API
nosy: +rhettinger, tim.peters
stage:  -> needs patch
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue39781] IDLE: Do not jump when select in codecontext

2020-02-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +18042
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/18683

___
Python tracker 

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



[issue39781] IDLE: Do not jump when select in codecontext

2020-02-27 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Tweak the code context widget so people can select context lines and copy to 
clipboard (perhaps to document nested code) without having to do the copy while 
still holding down the left mouse button.  Button-down, move, and release (to 
select) is not really a 'click', so I don't think a doc change is needed.

--
assignee: terry.reedy
components: IDLE
messages: 362861
nosy: cheryl.sabella, terry.reedy
priority: normal
severity: normal
stage: commit review
status: open
title: IDLE: Do not jump when select in codecontext
type: behavior
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



[issue39768] remove tempfile.mktemp()

2020-02-27 Thread wyz23x2


wyz23x2  added the comment:

Well, I just think it's *serious*.
I respect your thoughts. If you want to close this, you can.

--

___
Python tracker 

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



[issue39721] Fix constness of members of tok_state struct.

2020-02-27 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 384f3c536dd15ba33ea7e8afb4087ae359d4c12e by Andy Lester in branch 
'master':
closes bpo-39721: Fix constness of members of tok_state struct. (GH-18600)
https://github.com/python/cpython/commit/384f3c536dd15ba33ea7e8afb4087ae359d4c12e


--
nosy: +benjamin.peterson
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



[issue39753] inspecting a partial with bound keywods gives incorrect signature

2020-02-27 Thread Caleb Donovick


Change by Caleb Donovick :


--
nosy: +donovick

___
Python tracker 

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



[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-02-27 Thread Caleb Donovick


Change by Caleb Donovick :


--
nosy: +donovick

___
Python tracker 

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



[issue17422] language reference should specify restrictions on class namespace

2020-02-27 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue17422] language reference should specify restrictions on class namespace

2020-02-27 Thread Caleb Donovick


Change by Caleb Donovick :


--
pull_requests: +18041
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18682

___
Python tracker 

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



[issue39780] Add HTTP Response code 103

2020-02-27 Thread Ali McMaster


Change by Ali McMaster :


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

___
Python tracker 

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



[issue39771] EmailMessage.add_header doesn't work

2020-02-27 Thread hwgdb Smith


hwgdb Smith  added the comment:

Microsoft outlook 2016 MSO(16.0.4266.10001) x64

--
Added file: https://bugs.python.org/file48925/outlook_screenshot.jpeg

___
Python tracker 

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



[issue39771] EmailMessage.add_header doesn't work

2020-02-27 Thread hwgdb Smith


hwgdb Smith  added the comment:

Microsoft outlook 20116 MSO(16.0.4266.10001) x64
Foxmail 7.2 (build 7.026)

I use these two email client. All display incorrectly. And I have uploaded the 
screenshot.

--
Added file: https://bugs.python.org/file48924/foxmail_screenshot.jpeg

___
Python tracker 

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



[issue17422] language reference should specify restrictions on class namespace

2020-02-27 Thread Caleb Donovick


Caleb Donovick  added the comment:

While It is perfectly fine behavior for CPython to use a dict, as dict is an 
ordered mapping.  I think Eric is right that the data model should not specify 
that a dict is necessarily used in the absence of __prepare__.

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Brandt Bucher


Brandt Bucher  added the comment:

Sounds good, I'll have these up soon.

--

___
Python tracker 

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



[issue17422] language reference should specify restrictions on class namespace

2020-02-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

As I mentioned in my response on the PR, dict *is* required to be ordered since 
3.7. So I think it is okay as is.

--

___
Python tracker 

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



[issue17422] language reference should specify restrictions on class namespace

2020-02-27 Thread Eric Snow


Eric Snow  added the comment:

Thanks for working on this.  Sorry I didn't get a chance to see your PR sooner. 
 There was one small thing that needs to be changed back, as I implied in my 
comment on the PR [1].  Please undo the change in the text from "ordered 
mapping" to "dict".

The original "is initialised as an empty ordered mapping" text line should be 
restored.  "dict" is currently still not correct (the language spec does not 
dictate that dict be ordered).  However, PEP 520 specifies that it must be 
ordered.

Thanks!


[1] https://github.com/python/cpython/pull/18559#pullrequestreview-366098695

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

We already have somewhat different semantics of `|` for Counter, and hence I 
think it's fine to give it the most useful semantics for ChainMap given that 
class's special behavior. I think we've come up with the right solution there.

Let's stop the debate and put up a PR.

--

___
Python tracker 

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



[issue39780] Add HTTP Response code 103

2020-02-27 Thread Ali McMaster


New submission from Ali McMaster :

https://tools.ietf.org/html/rfc8297

I would like to work on this - PR to follow

--
title: Add HTTP Response code 451 -> Add HTTP Response code 103

___
Python tracker 

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



[issue39780] Add HTTP Response code 103

2020-02-27 Thread Ali McMaster


Change by Ali McMaster :


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



[issue39780] Add HTTP Response code 451

2020-02-27 Thread Ali McMaster


Change by Ali McMaster :


--
components: Library (Lib)
nosy: Ali McMaster
priority: normal
severity: normal
status: open
title: Add HTTP Response code 451
type: enhancement

___
Python tracker 

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



[issue39704] Disable code coverage

2020-02-27 Thread Ammar Askar


Ammar Askar  added the comment:

Can someone with access check that 
https://codecov.io/gh/python/cpython/settings/yaml has the right config? The 
latest run after my PR was pushed through still has the status check running :(

--

___
Python tracker 

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



[issue39779] [argparse] Add parameter to sort help output arguments

2020-02-27 Thread brian.gallagher


New submission from brian.gallagher :

1 import argparse   

  2 
  
  3 parser = argparse.ArgumentParser(description='Test')
  
  4 parser.add_argument('c', help='token c')
  
  5 parser.add_argument('b', help='token b')
  
  6 parser.add_argument('d', help='token d')
  
  7 parser.add_argument('-a', help='token a')   
  
  8 parser.add_argument('-z', help='token z')   
  
  9 parser.add_argument('-f', help='token f', required=True)


 10 parser.print_help() 

It would be nice if we could have the option to alphabetically sort the tokens 
in the optional and positional arguments sections of the help message in order 
to find an argument more quickly when reading long help descriptions.

Currently we output the following, when the above program is ran:

positional arguments:
  c   token c
  b   token b
  d   token d

optional arguments:
  -h, --help  show this help message and exit
  -a Atoken a
  -z Ztoken z
  -f Ftoken f

I'm proposing that we provide a mechanism to allow alphabetical ordering of 
both sections, like so:

positional arguments:
  b   token b
  c   token c
  d   token d

optional arguments:
  -h, --help  show this help message and exit
  -a Atoken a
  -f Ftoken f
  -z Ztoken z

I've chosen to leave -h as an exception, as it will always be there as an 
optional argument, but it could easily be treated no different.

We could provide an optional argument to print_help(sort=False) as a potential 
approach.

If this is something that the maintainer's would be willing to accept, I'd love 
to take it on and prepare a patch.

--
components: Library (Lib)
messages: 362849
nosy: brian.gallagher
priority: normal
severity: normal
status: open
title: [argparse] Add parameter to sort help output arguments
type: enhancement

___
Python tracker 

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



[issue39704] Disable code coverage

2020-02-27 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 766b7546a564c8e386a3c31eb06fc1b55e8f5a25 by Ammar Askar in branch 
'master':
bpo-39704: Explicitly pass the path to codecov config (GH-18680)
https://github.com/python/cpython/commit/766b7546a564c8e386a3c31eb06fc1b55e8f5a25


--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-02-27 Thread Elad Lahav


Elad Lahav  added the comment:

I may be missing something, but subprocess depends on _posixsubprocess, which 
doesn't get built until setup.py is run, which results in a circular dependency.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-02-27 Thread Leonard Lausen


Change by Leonard Lausen :


--
type:  -> crash

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-02-27 Thread Leonard Lausen


New submission from Leonard Lausen :

Below sample program, will raise "Modules/gcmodule.c:110: gc_decref: Assertion 
"gc_get_refs(g) > 0" failed: refcount is too small" on Python 3.8.2 debug build.
On 3.7.6 debug build, "Modules/gcmodule.c:277: visit_decref: Assertion 
`_PyGCHead_REFS(gc) != 0' failed." is raised.

```
import collections
import gc
import weakref

hooks_dict = collections.OrderedDict()
hooks_dict_ref = weakref.ref(hooks_dict)
gc.collect()

print('Hello world')
```


The complete error message on 3.8.2 debug build is

```
Modules/gcmodule.c:110: gc_decref: Assertion "gc_get_refs(g) > 0" failed: 
refcount is too small
Memory block allocated at (most recent call first):
  File "/home/$USER/test.py", line 6

object  : 
type: weakref
refcount: 1
address : 0x7ff788208a70
Fatal Python error: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x7ff789f9c080 (most recent call first):
  File "/home/$USER/test.py", line 7 in 
zsh: abort  PYTHONTRACEMALLOC=1 python ~/test.py
```

--
components: C API
messages: 362846
nosy: leezu
priority: normal
severity: normal
status: open
title: collections.OrderedDict and weakref.ref raises "refcount is too small" 
assertion
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



[issue39704] Disable code coverage

2020-02-27 Thread Ammar Askar


Change by Ammar Askar :


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

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2020-02-27 Thread Brett Cannon


Brett Cannon  added the comment:

@ned.deily the motivation is covered in Michael's initial comment; some vendors 
like to leave out the tests and not having them all under 'test' prevents that 
from working cleanly. Plus it makes the tests more discoverable.

As for any of the projects being vendored from outside the stdlib, none of them 
fall under https://www.python.org/dev/peps/pep-0360/ so it isn't a worry. Plus 
none of them are anymore to my knowledge anyway.

--

___
Python tracker 

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



[issue39777] Use the codecov GH Action

2020-02-27 Thread Ammar Askar


Ammar Askar  added the comment:

On a second look, we currently do this anyway: 
https://github.com/python/cpython/blob/374d998b507d34a6c0a3816a163926a8ba0c483f/.github/workflows/coverage.yml#L66-L70

and don't run coverage for PRs so it shouldn't matter.

--

___
Python tracker 

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



[issue39777] Use the codecov GH Action

2020-02-27 Thread Ammar Askar


Ammar Askar  added the comment:

This has the disadvantage that it won't work for PRs because Github doesn't 
make secrets like `${{ secrets.CODECOV_TOKEN }}` available in PRs.

See: https://github.com/codecov/codecov-action/issues/29

--
nosy: +ammar2

___
Python tracker 

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



[issue14678] Update zipimport to support importlib.invalidate_caches()

2020-02-27 Thread Brett Cannon


Brett Cannon  added the comment:

@crwilcox Don't know what's left. That's probably part of the work that's left. 
;) This issue is so old that it's possibly out-of-date since zipimport got 
rewritten in pure Python.

--

___
Python tracker 

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



[issue39704] Disable code coverage

2020-02-27 Thread Ammar Askar


Ammar Askar  added the comment:

Thanks for the pointer Brett, I'll submit a PR.

--

___
Python tracker 

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



[issue39682] pathlib.Path objects can be used as context managers

2020-02-27 Thread Brett Cannon


Brett Cannon  added the comment:

A use-case of "closing" a path is to cheaply flag that a path object is no 
longer valid, e.g. you deleted the underlying file and so you don't want others 
using the object anymore without paying the penalty of having to do the I/O to 
trigger the failure due to the path no longer existing.

Now whether anyone is using this functionality I don't know, but removing it 
will inevitably break code for someone, so someone will need to make at least 
some form of an attempt to see if there's any use in the wild to justify 
simplifying the code by removing the functionality.

--

___
Python tracker 

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



[issue39777] Use the codecov GH Action

2020-02-27 Thread Brett Cannon


New submission from Brett Cannon :

Codecov provides a GH Action for uploading coverage reports which we might as 
well use instead of their bash uploader: 
https://github.com/marketplace/actions/codecov.

--
messages: 362839
nosy: brett.cannon, steve.dower
priority: normal
severity: normal
status: open
title: Use the codecov GH Action

___
Python tracker 

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



[issue39704] Disable code coverage

2020-02-27 Thread Brett Cannon


Brett Cannon  added the comment:

The codecov config lives at 
https://github.com/python/cpython/blob/master/.github/codecov.yml and the docs 
for the file are at https://docs.codecov.io/docs/codecov-yaml. Specifically, 
the comment feature is covered at 
https://docs.codecov.io/docs/pull-request-comments and the status check is at 
https://docs.codecov.io/docs/commit-status.

Nothing has changed in the config, though, so it might be a change related to 
https://docs.codecov.io/docs/codecov-yaml#section-can-i-name-the-file-codecov-yml
 and thus the file path to the config might need to be added to the upload step 
in the following files:

1. https://github.com/python/cpython/blob/master/.github/workflows/coverage.yml
2. https://github.com/python/cpython/blob/master/.travis.yml
3. 
https://github.com/python/cpython/blob/master/.azure-pipelines/posix-steps.yml#L52

(I would submit a PR myself but I'm still digging myself out from under email 
after vacation.)

--
nosy: +brett.cannon

___
Python tracker 

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



[issue39715] Implement __repr__ methods for AST classes

2020-02-27 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue39730] Licence (license) for Python 3.8.1 is missing

2020-02-27 Thread Brett Cannon


Brett Cannon  added the comment:

The 3.8.1 license can be found at 
https://github.com/python/cpython/blob/v3.8.1/LICENSE. But the reason you are 
seeing the license as under 3.8.2rc2 is because that's the version the 3.8 docs 
is showing, not 3.8.1. So there's no license missing, you're just not looking 
at the 3.8.1 docs as we are not displaying those at docs.python.org anymore.

--
nosy: +brett.cannon
resolution:  -> rejected
stage: needs patch -> 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



[issue39771] EmailMessage.add_header doesn't work

2020-02-27 Thread R. David Murray


R. David Murray  added the comment:

The legacy API appears to be using an RFC-incorrect (but common) encoded-word 
encoding, while the new API is using the RFC-compliant MIME-parameter encoding 
(% encoding).  Which email client are you using?

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Brandt Bucher


Brandt Bucher  added the comment:

I think we're only seriously considering the first variant (although 
implemented slightly differently, see my last two messages). And __ror__ would 
probably change, returning the type of self.

What are the "problems" with it, exactly? We seem to be in agreement that the 
update behavior is reasonable, even for ChainMaps.

--

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Stefan Krah


Stefan Krah  added the comment:

I built your example with 3.6:

git clone https://github.com/pybind/pybind11
wget https://bugs.python.org/file48923/decimal_crash.zip
unzip decimal_crash.zip

git checkout v3.6.7
./configure --with-pydebug
make

g++ -std=c++11 -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -Wextra 
-Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. 
-I./Include -I./pybind11/include -c main.cpp

g++ -pthread -Xlinker -export-dynamic -o main main.o libpython3.6dm.a -lpthread 
-ldl -lutil -lm


cp python python3
PATH=.:$PATH
./main



And I literally get this error (not always, it may take 10 runs or so):

$ ./main
Fatal Python error: Python memory allocator called without holding the GIL

Thread 0x7f1e73fff700 (most recent call first):

Thread 0x7f1e7b836700 (most recent call first):

Thread 0x7f1e7a834700 (most recent call first):

Thread 0x7f1e7b035700 (most recent call first):

Thread 0x7f1e7d039700 (most recent call first):

Thread 0x7f1e7c838700 (most recent call first):

Current thread 0x7f1e7c037700 (most recent call first):

Thread 0x7f1e7e84f740 (most recent call first):
Aborted (core dumped)



So no, I don't think the GIL handling is correct.

--

___
Python tracker 

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



[issue39609] Set the thread_name_prefix for asyncio's default executor ThreadPoolExecutor

2020-02-27 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue39609] Set the thread_name_prefix for asyncio's default executor ThreadPoolExecutor

2020-02-27 Thread miss-islington


miss-islington  added the comment:


New changeset 374d998b507d34a6c0a3816a163926a8ba0c483f by Markus Mohrhard in 
branch 'master':
bpo-39609: set the thread_name_prefix for the default asyncio executor 
(GH-18458)
https://github.com/python/cpython/commit/374d998b507d34a6c0a3816a163926a8ba0c483f


--
nosy: +miss-islington

___
Python tracker 

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



[issue39689] test_struct failure on s390x Fedora Clang buildbot

2020-02-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

the concept of a native _Bool seems fuzzy.  the important thing for the struct 
module is to consume sizeof _Bool bytes from the input stream.  how those are 
interpreted is up to the platform.  So if the platform says a bool is 8 bytes 
and it only ever looks at the lowest bit in those for bool-ness, good for it.

in that situation our unittest assuming that b'\xf0' should be true when 
interpreted as a bool is wrong.

just get rid of that value from the loop in the test?

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

1.

def __or__(self, other):
return self.__class__(self.maps[0] | other, *self.maps[1:])

def __ror__(self, other):
return other | dict(self)


2.

def __or__(self, other):
return self.__class__(other, *self.maps)

def __ror__(self, other):
return self.__class__(*self.maps, other)


There are problems with both variants, so I think it may be better to not add 
this operator to ChainMap.

--

___
Python tracker 

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



[issue39689] test_struct failure on s390x Fedora Clang buildbot

2020-02-27 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
components: +Extension Modules
nosy: +gregory.p.smith
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue39765] asyncio loop.add_signal_handler() may not behave as expected

2020-02-27 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Other threads are not related.

Speaking about the main thread that runs an event loop with the signal handler 
installed -- the handler is executed along with other async code.
If the loop executes some user-provides async task -- it executes the signal 
handler as well if needed.

This is why I suspect that the discussed program is not completely correct.

--

___
Python tracker 

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



[issue39689] test_struct failure on s390x Fedora Clang buildbot

2020-02-27 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

maybe we should be raising an error if the bytes are not a valid platform _Bool 
pattern?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Brandt Bucher


Brandt Bucher  added the comment:

Just to clarify:

If we decide to check isinstance(other, (ChainMap, dict)), '|' should probably 
be used.

If we decide to check isinstance(other, Mapping), I think the copy/update 
methods should be used.

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Brandt Bucher


Brandt Bucher  added the comment:

> Im not sure if the dict(other) cast is the best way to go about it. Maybe 
> this would work?

Yeah, I was imagining something like that... I used the cast for brevity in my 
reply but that probably wasn't helpful.

Note that for __or__, we probably want to check the type of the argument (for 
either dict or ChainMap, or maybe just Mapping), to keep it from working on an 
iterable of key-value pairs.

> I guess we need a __ror__ as well, in case there's some other mapping that 
> doesn't implement __or__:

Agreed. Again, we can check for Mapping here to assure success for the copy() 
move.

> As a refinement, __or__ and __ror__ should perhaps check whether the 
> operation can possibly succeed and return NotImplemented instead of raising? 
> (Based on the type of other only, not its contents.)

Yup, see above. I think a check for Mapping should be fine.

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-02-27 Thread Elad Lahav


Elad Lahav  added the comment:

As sure as I can be given my limited experience debugging Python... Luckily I 
do know my way around the QNX kernel ;-)

The stack trace for the child shows it stuck on a semaphore with a count value 
of 0. A print in the logging module shows that the child gets to the 
_acquireLock() call on line 245 of logging/__init__.py  but a print after that 
line is never displayed. I am basing my analysis on the combination of the two 
observations.

I'll try to come up with a change to distutils.spawn, as well as a change to 
subprocess to use posix_spawn().

Stack trace:
#0  SyncSemWait () at 
/builds/workspace/710-SDP/build_x86_64/lib/c/kercalls/x86_64/SyncSemWait.S:37
#1  0x00267938bac6 in PyThread_acquire_lock_timed 
(lock=lock@entry=0x3bcde5a430, microseconds=microseconds@entry=-100, 
intr_flag=intr_flag@entry=1) at Python/thread_pthread.h:459
#2  0x0026793de7bd in acquire_timed (lock=0x3bcde5a430, 
timeout=-10) at ./Modules/_threadmodule.c:63
#3  0x0026793de8e7 in rlock_acquire (self=0x3bce057c90, args=, kwds=) at ./Modules/_threadmodule.c:308
#4  0x00267941b631 in method_vectorcall_VARARGS_KEYWORDS 
(func=0x3bcdee2ef0, args=0x3bce1ad4d0, nargsf=, 
kwnames=)
at Objects/descrobject.c:332
#5  0x002679285ff6 in _PyObject_Vectorcall (kwnames=, 
nargsf=, args=, callable=)
at ./Include/cpython/abstract.h:123
#6  call_function (kwnames=0x0, oparg=1, pp_stack=, 
tstate=0x3bcdea9040) at Python/ceval.c:4987
#7  _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3486
#8  0x00267928395b in function_code_fastcall (co=, 
args=, nargs=0, globals=) at Objects/call.c:283
#9  0x002679285d29 in _PyObject_Vectorcall (kwnames=, 
nargsf=, args=, callable=)
at ./Include/cpython/abstract.h:127
#10 call_function (kwnames=0x0, oparg=, pp_stack=, tstate=0x3bcdea9040) at Python/ceval.c:4987
#11 _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3500
#12 0x00267928395b in function_code_fastcall (co=, 
args=, nargs=1, globals=) at Objects/call.c:283
#13 0x002679285d29 in _PyObject_Vectorcall (kwnames=, 
nargsf=, args=, callable=)
at ./Include/cpython/abstract.h:127
#14 call_function (kwnames=0x0, oparg=, pp_stack=, tstate=0x3bcdea9040) at Python/ceval.c:4987
#15 _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3500
#16 0x00267928395b in function_code_fastcall (co=, 
args=, nargs=1, globals=) at Objects/call.c:283
#17 0x002679285ff6 in _PyObject_Vectorcall (kwnames=, 
nargsf=, args=, callable=)
at ./Include/cpython/abstract.h:123
#18 call_function (kwnames=0x0, oparg=1, pp_stack=, 
tstate=0x3bcdea9040) at Python/ceval.c:4987
#19 _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3486
#20 0x00267928395b in function_code_fastcall (co=, 
args=, nargs=0, globals=) at Objects/call.c:283
#21 0x00267929d26a in _PyObject_FastCallDict (callable=0x3bce1bd160, 
args=, nargsf=, kwargs=)
at Objects/call.c:96
#22 0x0026793a0584 in run_at_forkers (lst=, 
reverse=) at ./Modules/posixmodule.c:435
#23 0x0026793abbfb in run_at_forkers (reverse=0, lst=) at 
./Modules/posixmodule.c:420
#24 PyOS_AfterFork_Child () at ./Modules/posixmodule.c:474
#25 0x0026793abd08 in os_fork_impl (module=) at 
./Modules/posixmodule.c:6082

--

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Evgeny Boytsov


Evgeny Boytsov  added the comment:

Please note, that UnlockGILandSleep takes GIL back before returning. In a real 
production code there is a database query. In this example I emulate them with 
random sleep. So I don't see any problems here.

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-02-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

And you're sure that your "toy" example hangs in the at-fork handler.

In that case I can't help you further, I don't have the resources or time to 
try out QNX. Your best bet is indeed to change distutils.spawn to not use 
fork+exec -- do you think you can come up with a PR for that?

--

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Stefan Krah


Change by Stefan Krah :


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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

I didn't see your second reply, with `ChainMap(other, *cm.maps)`.

I'm not so keen on that, because its special behavior can't be mimicked by `|=`.

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-02-27 Thread Elad Lahav


Elad Lahav  added the comment:

OK, but that's not the problem I see. The parent calls fork(), creates a child 
that then runs the atfork() handlers *before* returning from the os.fork() call 
(which is the expected behaviour). At least one of those atfork() handlers is 
the one registered by the logging module (Lib/logging/__init__.py) and that one 
attempts to acquire a lock. So in my case the child never gets to the point of 
calling exec(), which is why I didn't notice the bug in the script.

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

OK, that makes sense, it works similar to ChainMap.copy(), which copies maps[0] 
and keeps links to the rest. So in particular `cm | {}` will do the same thing 
as cm.copy().

Im not sure if the dict(other) cast is the best way to go about it. Maybe this 
would work?

def __or__(self, other):
new = self.copy()
new |= other  # OR new.update(other) ???
return new

def __ior__(self, other):
self.update(other)
return self

Note that there is no ChainMap.update() definition -- it relies on 
MutableMapping.update().

I guess we need a __ror__ as well, in case there's some other mapping that 
doesn't implement __or__:

def __ror__(self, other):
new = other.copy()
new.update(self)
return new

Note that this doesn't return a ChainMap but an instance of type(other).  If 
other doesn't have a copy() method it'll fail.

As a refinement, __or__ and __ror__ should perhaps check whether the operation 
can possibly succeed and return NotImplemented instead of raising? (Based on 
the type of other only, not its contents.)

--

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Stefan Krah


Stefan Krah  added the comment:

I've briefly looked at the zip archive. Without going much into
the C++ module as a whole, this should not be done:


gil_unlocker.UnlockGILAndSleep()
self.val = decimal.Decimal(1) / decimal.Decimal(7)
gil_unlocker.UnlockGILAndSleep()


If you want C++ threads with a released GIL, you should use libmpdec
directly and not the Python module.

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Brandt Bucher


Brandt Bucher  added the comment:

...however, I could also see the (similar):

ChainMap(other, *cm.maps)  # Note that `other` is the original reference 
here.

Being okay as well. Maybe even better, now that I've written it out.

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-02-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

The key is that os.execl() never returns.

My understanding is that the hang happens when the child code returns (or 
raises) in the forked child process, because the semaphore state is cloned by 
the fork.

There is no logging here. I just added some print() calls. (See the script I 
posted.)

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Brandt Bucher


Brandt Bucher  added the comment:

I believe that:

cm | other

Should return the equivalent of:

ChainMap(cm.maps[0] | dict(other), *cm.maps[1:])

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

OK, assuming `|=` gets the same semantics as update(), can you repeat once
more (without motivation) what the specification for `cm | other` will be?

--

___
Python tracker 

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



[issue39689] test_struct failure on s390x Fedora Clang buildbot

2020-02-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

C compiler dev that it's indeed undefined behavior.

> Quick and obvious fix:
> 
>   static PyObject *
>   nu_bool(const char *p, const formatdef *f)
>   {
>   char x;
>   memcpy((char *), p, sizeof x);
>   return PyBool_FromLong(x != 0);
>   }
>
> Which is optimized to
>
> static PyObject *
> nu_bool(const char *p, const formatdef *f)
> {
> return PyBool_FromLong(*p != 0);
> }


I'm left with a question for CPython's struct experts:

The above would be my preferred fix, but the Python code is asking to convert a 
memory buffer to bool *using platform-specific semantics*.
Is this fix OK if C treats a \xf0 _Bool as falsey?


(Also, this assumes size of _Bool is the same as size of char.
I guess we can add a build-time assertion for that, and say we don't support 
platforms where that's not the case.)

--
nosy: +mark.dickinson, meador.inge

___
Python tracker 

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



[issue39771] EmailMessage.add_header doesn't work

2020-02-27 Thread hwgdb Smith


hwgdb Smith  added the comment:

Why there are two different representations of the same file name?  It displays 
incorrectly when use the EmailMessage API filename representation.

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Brandt Bucher


Brandt Bucher  added the comment:

> Note that in your last message, `d1 |= cm2` will fail for this reason. You 
> can of course fix that with `d1 |= dict(cm2)`, although IIUC there's no 
> reason one of the maps couldn't be some other [Mutable]Mapping.

Mappings and iterables are fine for the in-place variant. :)

>>> from collections import ChainMap
>>> d = {}
>>> c = ChainMap({"r": 2, "d":2})
>>> d |= c
>>> d
{'r': 2, 'd': 2}

I think it would be confusing to have `ChainMap | ChainMap` behave subtly 
different than `dict | ChainMap`. It would be *especially* odd if it also 
differed subtly from `ChainMap | dict`.

To recap:

+1 on adding the operators with dict semantics,
+0 on no PEP 584 for ChainMap.
-0 on implementing them, but changing the winning behavior by concatenating the 
maps lists or something. This would probably make more sense to me as a `+` 
operator, honestly. :(
-1 for having the operators behave differently (other than performance 
shortcuts) for `cm | d`, `cm | cm`, `cm |= d`, `cm |= cm`.

--

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Stefan Krah


Stefan Krah  added the comment:

Before I look at the example code: Can you also reproduce this with
Python 3.6?  The threading code in _decimal was changed to a ContextVar
in 3.7.

There's a high chance though that the problem is in the c++ module.

--
nosy: +skrah

___
Python tracker 

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



[issue39757] EmailMessage wrong encoding for international domain

2020-02-27 Thread SilentGhost


Change by SilentGhost :


--
superseder:  -> email parseaddr and formataddr should be IDNA aware

___
Python tracker 

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



[issue39689] test_struct failure on s390x Fedora Clang buildbot

2020-02-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

The call:
struct.unpack('>?', b'\xf0')
means to unpack a "native bool", i.e. native size and alignment. Internally, 
this does:

static PyObject *
nu_bool(const char *p, const formatdef *f)
{
_Bool x;
memcpy((char *), p, sizeof x);
return PyBool_FromLong(x != 0);
}

i.e., copies "sizeof x" (1 byte) of memory to a temporary buffer x, and then 
treats that as _Bool.

While I don't have access to the C standard, I believe it says that assignment 
of a true value to _Bool can coerce to a unique "true" value. It seems that if 
a char doesn't have the exact bit pattern for true or false, casting to _Bool 
is undefined behavior. Is that correct?

Clang 10 on s390x seems to take advantage of this: it probably only looks at 
the last bit(s) so a _Bool with a bit pattern of 0xf0 turns out false.
But the tests assume that 0xf0 should unpack to True.

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

I had just come to a different conclusion. Maybe ChainMap should just not
grow `|` and `|=` operators? That way there can be no confusion. `dict() |
ChainMap()` and `ChainMap() | dict()` will fail because ChainMap doesn't
inherit from dict. (Note that in your last message, `d1 |= cm2` will fail
for this reason. You can of course fix that with `d1 |= dict(cm2)`,
although IIUC there's no reason one of the maps couldn't be some other
[Mutable]Mapping.)

--

___
Python tracker 

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



[issue39768] remove tempfile.mktemp()

2020-02-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

wyz23x2, why do you think that this is not a duplicate of issue36309?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39771] EmailMessage.add_header doesn't work

2020-02-27 Thread hwgdb Smith


hwgdb Smith  added the comment:

Using utf-8 doesn't display correctly on my mail client.
So i thought it might work using GBK, and I try to change the 
Content-Disposition filename using GBK.
And just now, I print the legacy Api MIMEMultipart.as_string(), I found it 
using utf-8 too. The difference is 
legacy api:  filename="=?utf-8?b?6LaFZeS/nTMwMDBQLmNzdg==?="   
EmailMessage: filename*=utf-8''.%2F%E8%B6%85e%E4%BF%9D3000P.csv

So it is not the encoding cause the display error. But I still don't know why? 
Base64?

--

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Evgeny Boytsov


New submission from Evgeny Boytsov :

Hello everybody!

We are using Python 3.7 running at CentOS 7 x64. Python is used as a library to 
create dynamic extensions for our app server. 

Some time ago we began to experience crashes in decimal module in some 
heavy-multithreaded scenarios. After some testing and debugging I was able to 
reproduce it without our own code using only pybind11 library to simplify 
embedding (in real app we are using boost.python).


I've built python 3.8 with clang 7 and address sanitizer enabled and got error 
"use-after-free" with some additional data.

Please find attached C++ source file, python module and ASAN output. Is it 
really a bug (most probably - data race) or there is something wrong with such 
embedding scenario?

--
components: Interpreter Core
files: decimal_crash.zip
messages: 362807
nosy: boytsovea
priority: normal
severity: normal
status: open
title: Crash in decimal module in heavy-multithreaded scenario
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48923/decimal_crash.zip

___
Python tracker 

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



[issue38380] Update SQLite to 3.30 in Windows and macOS installer builds

2020-02-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +18038
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18678

___
Python tracker 

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



[issue39771] EmailMessage.add_header doesn't work

2020-02-27 Thread R. David Murray


R. David Murray  added the comment:

Actually, given that the contentmanager does accept a charset parameter for 
text content, it does seem reasonable to treat this as a bug.  But as I said 
fixing it may not be trivial.

--

___
Python tracker 

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



[issue38380] Update SQLite to 3.30 in Windows and macOS installer builds

2020-02-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


Added file: 
https://bugs.python.org/file48922/0002-bpo-38380-Update-Windows-builds-to-use-SQLite-3.30.1.patch

___
Python tracker 

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



[issue38380] Update SQLite to 3.30 in Windows and macOS installer builds

2020-02-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


Added file: 
https://bugs.python.org/file48921/0001-bpo-38380-Update-macOS-installer-to-use-SQLite-3.30.1.patch

___
Python tracker 

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



[issue39771] EmailMessage.add_header doesn't work

2020-02-27 Thread R. David Murray


R. David Murray  added the comment:

I think you are saying that you want the charset in the encoded filename to be 
GBK rather than utf-8?  utf-8 should certainly display correctly in your email 
client, though, so if it is not there is something else going wrong.  

As far as the 3 tuple not working to set the charset...I believe what is 
happening there is that a header created by the application gets "refolded" on 
serialization, and refolding doesn't keep the existing charset, it converts 
everything to utf-8.  This is an intentional part of the design: the library 
handles the gory details of MIME and uses utf-8 as the charset for application 
created content.  It is actually an accident of the implementation that the 
tuple form of the filename is even accepted; you will note that it is *not* 
documented in the contentmanager docs.

It wouldn't be crazy to ask for this as a feature, and it could even be treated 
as a bug that it doesn't work if we want to, but it may not be easy to "fix", 
because it goes against the design philosophy of the new API.

--

___
Python tracker 

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



[issue39771] EmailMessage.add_header doesn't work

2020-02-27 Thread hwgdb Smith


hwgdb Smith  added the comment:

I have uploaded just now. Thank you.

--
Added file: https://bugs.python.org/file48920/email bug.rar

___
Python tracker 

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



[issue38380] Update SQLite to 3.30 in Windows and macOS installer builds

2020-02-27 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

I've updated these patches to sqlite3-3.30.1 
(https://www.sqlite.org/releaselog/3_30_1.html).

cpython-source-deps is updated 
(https://github.com/python/cpython-source-deps/pull/17).

CPython commits are updated and rebased onto current 3.9 master: 
https://github.com/erlend-aasland/cpython/tree/fix-issue-38380


(Since Oct 2019, SQLite 3.31 have been released, but that would probably 
require opening a new issue.)

--

___
Python tracker 

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



[issue39757] EmailMessage wrong encoding for international domain

2020-02-27 Thread Julien Castiaux


Julien Castiaux  added the comment:

Woops wrong copie/paste, here is the correct link: 
https://bugs.python.org/issue11783

--

___
Python tracker 

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



[issue39757] EmailMessage wrong encoding for international domain

2020-02-27 Thread Julien Castiaux


Julien Castiaux  added the comment:

Duplicate of https://bugs.python.org/issue39757

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



[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-02-27 Thread Antony Lee


New submission from Antony Lee :

https://bugs.python.org/issue36350 / 
https://github.com/python/cpython/pull/12412 changed Signature.parameters and 
BoundArguments.arguments to be plain dicts, not OrderedDicts (for Py3.9a4).  
Even though I agree for BoundArguments.arguments (in fact I argued for this 
behavior in https://bugs.python.org/issue23080), I think Signature.parameters 
should remain OrderedDicts.  Otherwise, one would get

>>> inspect.signature(lambda x, y: None).parameters == 
inspect.signature(lambda y, x: None).parameters
True

which seems plain wrong (comparing the signature objects themselves still 
correctly return False because __eq__ explicitly considers parameter order, but 
one may e.g. want to compare parameters for equality while ignoring the return 
annotation).

--
components: Library (Lib)
messages: 362800
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: inspect.Signature.parameters should be an OrderedDict, not a plain dict
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



[issue23080] BoundArguments.arguments should be unordered

2020-02-27 Thread Antony Lee


Antony Lee  added the comment:

Done in bugs.python.org/issue36350 / 
https://github.com/python/cpython/pull/12412.

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



[issue39636] Can't change Treeview row color in Tkinter

2020-02-27 Thread Олег Париев

Олег Париев  added the comment:

I figured out the problem myself. I found out that the problem was in the topic 
that I used for Tkinter

--

___
Python tracker 

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



[issue39672] SIGSEGV crash on shutdown with shelve & c pickle

2020-02-27 Thread zd nex


zd nex  added the comment:

Hi,

i was looking on failing tests on attached pull request and it seems to me that 
it intentionally should create new entry for saving.

Maybe that save should actually happen, but it should be fixed in different 
way? From my small tests I was thinking that problem was actually in pickle, 
but maybe it is connected to shelve itself.

--

___
Python tracker 

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



[issue38597] C Extension import limit

2020-02-27 Thread Steve Dower


Steve Dower  added the comment:

Hmm, just ran it on my own and it's finding the OneCore file first, which is 
not a problem (yet) but could become one.

So we at least need to replace the "**" with a "*" in 
Lib/distutils/_msvccompiler.py#L109. Not sure if that will help in this other 
case or not.

--

___
Python tracker 

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



[issue38597] C Extension import limit

2020-02-27 Thread Steve Dower


Steve Dower  added the comment:

Thanks, it does seem like it's finding the correct MSVC, but is not finding the 
redistributable DLL:

> cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT ...

The "/MT" means to statically the CRT, and then we use link settings later to 
dynamically link the part installed in the OS (see 
https://stevedower.id.au/blog/building-for-python-3-5-part-two for more 
details).

The problem seems to be that this glob in distutils can't find the path listed 
below it:

"2019\BuildTools\VC\redist\MSVC\**\x64\Microsoft.VC14*.CRT\vcruntime140.dll"

"2019\BuildTools\VC\Redist\MSVC\14.24.28127\x64\Microsoft.VC142.CRT\vcruntime140.dll"

We swallow a lot of errors while doing this glob, so I assume there's something 
about your install that's affecting it (maybe related to it being BuildTools 
rather than Community or higher?)

Could you try running this code and see what result/error you get:

import glob
glob.glob(r"C:\Program Files (x86)\Microsoft Visual 
Studio\2019\BuildTools\VC\redist\MSVC\**\x64\Microsoft.VC14*.CRT\vcruntime140.dll",
 recursive=True)

--

___
Python tracker 

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



  1   2   >