[issue43776] Popen with shell=True yield mangled repr output

2021-04-10 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
versions: +Python 3.10

___
Python tracker 

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



[issue32466] Fix missing test coverage for fractions.Fraction.__new__

2021-04-10 Thread Sergey B Kirpichev


Sergey B Kirpichev  added the comment:

Mark, I think the Lib/fractions.py now is covered by tests in the 
test_fractions.py.

$ ./python -m venv ~/venv/cpython
$ . ~/venv/cpython/bin/activate
$ pip install coverage
Collecting coverage
  Using cached coverage-5.5-cp310-cp310-manylinux1_x86_64.whl (238 kB)
Installing collected packages: coverage
Successfully installed coverage-5.5
$ python -m coverage run --source=fractions --branch Lib/test/test_fractions.py
...
--
Ran 31 tests in 0.040s

OK
$ ~/venv/cpython/bin/python -m coverage report
Name   Stmts   Miss Branch BrPart  Cover

Lib/fractions.py 299  0126  0   100%

TOTAL299  0126  0   100%

My guess: this issue can be closed.

--
nosy: +Sergey.Kirpichev

___
Python tracker 

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



[issue43475] Worst-case behaviour of hash collision with float NaN

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I'm loathe to guarantee anything about this in the language itself. 

There aren't language any guarantees being proposed.  Letting the hash depend 
on the object id just helps avoid quadratic behavior.  Making float('NaN') a 
singleton is also perfectly reasonable behavior for an immutable type.  Neither 
is a guaranteed behavior, just a convenient one.


> I'm not convinced it addresses a real-world problem

Maybe yes, maybe no.  I would hope that NaNs arising from bogus calculations 
would be rare.  OTOH, they are commonly used for missing values in Pandas where 
internal dict/set operations abound.  Either way, I would like to close off a 
trivially easy way to invoke quadratic behavior unexpectedly.

--

___
Python tracker 

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



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, I've only looked at the lru_cache() code.  Someone should go through all 
the PyModule_GetState calls to see if they are on a critical path.  AFAICT a 
huge number of these changes were applied without regard to whether or not they 
occurred on an existing fast path.

This is a considerable number of clock cycles for a type lookup that used to be 
almost cost free.  Whether it is high or low impact greatly depends on whether 
the surrounding code was doing a lot of work or very little work.  In thin 
functions, the incremental costs will be higher.

--

___
Python tracker 

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



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Serhiy, do you think we could substitute the "self" instance of 
functools._lru_cache_wrapper object for the kw_mark?  It already compares on 
identity, so it should be just a fast as the instance of object().  AFAICT, 
kwd_mark doesn't have to be unique across instances.  

To avoid creating a GC only circular reference, we could skip the INCREF, 
leaving the object weakly referencing itself. 

In bounded_lru_cache_wrapper(), the other state reference reference is in 
creating a new lru_list_elem.  There are several things we can do about this.  
1) move the expensive get_functools_state_by_type() inside the code block that 
creates new links, so that it won't affect a full cache.  2) create a 
per-instance variable that references the per-type lru_list_elem.  This has the 
downside of making each lru_cache instance slightly larger.  3) prepopulate the 
lru_cache with maxsize links.  This simplifies the code and makes it slightly 
faster but will waste spaces for use cases that never actually fill-up the 
cache lazily, also it slows down start-up time.

Ideally, these PRs should be reverted for Python 3.10.  AFAICT, no user of 
functools will benefit in any way from these changes.  Presumably, that is why 
there are no tests.  It is all cost and no benefit.

BTW, the 6% timing is likely understated because the loop is executed entirely 
in L1 cache or the CPU's recent write cache rather than real world conditions 
where there is fierce competition of the limited 32kb L1 data cache.  Just 
looking at the total number of sequentially dependent memory accesses, I expect 
that the actual cost is more than a third.

--

___
Python tracker 

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



[issue43475] Worst-case behaviour of hash collision with float NaN

2021-04-10 Thread Tim Peters


Tim Peters  added the comment:

I agree hashing a NaN acting like the generic object hash (return rotated 
address) is a fine workaround, although I'm not convinced it addresses a 
real-world problem ;-) But why not? It might.

But that's for CPython. I'm loathe to guarantee anything about this in the 
language itself. If an implementation wants `__contains__()` tests to treat all 
NaNs as equal instead, or consider them equal only if "is" holds, or never 
considers them equal, or resolves equality as bitwise representation equality 
... all are fine by me. There's no truly compelling case to made for any of 
them, although "never considers them equal" is least "surprising" given the 
insane requirement that NaNs never compare equal under IEEE rules, and that 
Python-the-language doesn't formally support different notions of equality in 
different contexts.

--

___
Python tracker 

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



[issue43751] await anext() returns None when default is given

2021-04-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue43751] await anext() returns None when default is given

2021-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset dfb45323ce8a543ca844c311e32c994ec9554c1b by Dennis Sweeney in 
branch 'master':
bpo-43751: Fix anext() bug where it erroneously returned None (GH-25238)
https://github.com/python/cpython/commit/dfb45323ce8a543ca844c311e32c994ec9554c1b


--
nosy: +pablogsal

___
Python tracker 

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



[issue43802] Seg fault on macOS using multiprocessing.JoinableQueue

2021-04-10 Thread Jacob Walls


Jacob Walls  added the comment:

Thanks for this detailed reply. I reproduced on Python 3.9.4 on the same iMac 
from my original report running macOS 10.13.6, but with much lesser frequency 
(I wouldn't use the word "consistently" anymore).

I tried on a MacBook Pro with worn-out hardware running a newer OS (10.15.4) 
and could not reproduce the issue there. I also built cPython (Python 3.10.0a7+ 
(heads/master:ac05f82ad4, Apr 10 2021, 20:16:36) [Clang 10.0.0 
(clang-1000.10.44.4)] on darwin) using --with-pydebug and ran the test case a 
few times on the good-hardware iMac, and observed the file parsing 
(predictably) slow to a crawl, but no reproduction of the segfault. This leads 
me to believe that, yes, this is a race condition I'm encountering on fast 
hardware.

Possibly related to issue-25769, since music21 makes heavy use of weakrefs and 
since music21.metadata.caching.MetadataCachingJob.run() calls gc.collect(). 
Perhaps I can look into engineering a minimal test case based on that 
discussion, involving a deliberately expensive __eq__() call.

To answer your original question: my first report on 3.9.2 was on this specific 
version:
3.9.2 (v3.9.2:1a79785e3e, Feb 19 2021, 09:06:10) \n[Clang 6.0 (clang-600.0.57)]

--

___
Python tracker 

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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-10 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 9045919bfa820379a66ea67219f79ef6d9ecab49 by Jelle Zijlstra in 
branch 'master':
bpo-43772: Fix TypeVar.__ror__ (GH-25339)
https://github.com/python/cpython/commit/9045919bfa820379a66ea67219f79ef6d9ecab49


--

___
Python tracker 

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



[issue43783] Make ParamSpec.args/kwargs more useful objects

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 522433601a5c64603dab3d733f41a5db39d237eb by Jelle Zijlstra in 
branch 'master':
bpo-43783: Add ParamSpecArgs/Kwargs (GH-25298)
https://github.com/python/cpython/commit/522433601a5c64603dab3d733f41a5db39d237eb


--

___
Python tracker 

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



[issue43783] Make ParamSpec.args/kwargs more useful objects

2021-04-10 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-10 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
keywords: +patch
nosy: +Jelle Zijlstra
nosy_count: 4.0 -> 5.0
pull_requests: +24074
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/25339

___
Python tracker 

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



[issue43803] ctypes string_at/wstring_at bad argument name

2021-04-10 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

It's a bit worse: the actual name is "ptr", the function docstrings say "addr", 
and the documentation 
(https://docs.python.org/3.9/library/ctypes.html#ctypes.string_at) has 
"address". I'd favor updating them all to say "ptr", because changing the name 
of the runtime parameter would risk breaking users' code.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue43803] ctypes string_at/wstring_at bad argument name

2021-04-10 Thread Tal Hayon


Change by Tal Hayon :


--
title: ctypes string_at/wstring_at -> ctypes string_at/wstring_at bad argument 
name

___
Python tracker 

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



[issue43803] ctypes string_at/wstring_at

2021-04-10 Thread Tal Hayon


New submission from Tal Hayon :

string_at and wstring_at first argument in docs in address but actually in code 
is ptr.

See
https://github.com/python/cpython/blob/750f484752763fe9ac1d6455780aabcb67f25508/Lib/ctypes/__init__.py#L513
https://github.com/python/cpython/blob/750f484752763fe9ac1d6455780aabcb67f25508/Lib/ctypes/__init__.py#L525

Noticed this when going over stubtest errors in typeshed.
See pull request https://github.com/python/typeshed/pull/5204

--
components: ctypes
messages: 390761
nosy: talhayon1
priority: normal
severity: normal
status: open
title: ctypes string_at/wstring_at
type: behavior
versions: Python 3.10, 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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 750f484752763fe9ac1d6455780aabcb67f25508 by Eric V. Smith in 
branch 'master':
bpo-43764: Add match_args=False parameter to dataclass decorator and to 
make_dataclasses function. (GH-25337)
https://github.com/python/cpython/commit/750f484752763fe9ac1d6455780aabcb67f25508


--

___
Python tracker 

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



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2021-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

As a Release Manager, I am not very happy with a 6% reduction in speed, 
especially in these functions. Can someone take a look to see if we can get the 
performance closer to Python 3.9?

--

___
Python tracker 

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



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2021-04-10 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Here are some benchmarks of using lru_cache in 3.9 and 3.10 (PGO/LTO/CPU isol):

❯ ./python -m pyperf timeit "from functools import lru_cache; f = 
lru_cache(lambda: 42)" "f()" --compare-to ../3.9/python
/home/pablogsal/github/3.9/python: . 2.60 us +- 0.05 us
/home/pablogsal/github/cpython/python: . 2.74 us +- 0.06 us

Mean +- std dev: [/home/pablogsal/github/3.9/python] 2.60 us +- 0.05 us -> 
[/home/pablogsal/github/cpython/python] 2.74 us +- 0.06 us: 1.06x slower

Given that lru_cache is normally used to seek speed, this is a bit unfortunate 
:(

--

___
Python tracker 

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



[issue43801] Carriage Return problem in version v3.9.0:9cf6752

2021-04-10 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hello Santosh,

In future, please don't post images or screen shots of text, please copy and 
paste the text of your code.

You have something similar to this:

>>> text = "short line\rvery long line of text"
>>> print(text)
very long line of text


but you haven't told us what you expected to see instead or why you think it is 
a bug.

It isn't a bug, it is working correctly. Consider this version:


>>> text = "a very long line of text\rshort line"
>>> print(text)
short lineg line of text


Printing a carriage return returns the print location to the start of the line. 
To start a new line, you need a newline \n.


This is most commonly used for updating the display in place. Try running this 
code:

import time
def demo():
for i in range(1, 101):
print("\rUpdating record %d" % i, end='', flush=True)
time.sleep(0.1)
print()

--
nosy: +steven.daprano
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



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

State lookups and indirections were added to most performance sensitive code 
part of the

_functools_state *state;

state = get_functools_state_by_type(Py_TYPE(self));
if (state == NULL) {
return NULL;
}
key = lru_cache_make_key(state, args, kwds, self->typed);

I think it should be removed for Python3.10.  Right now, it is of zero value to 
users (actually, negative value).

--
nosy: +pablogsal, rhettinger, serhiy.storchaka
priority: normal -> high
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue43475] Worst-case behaviour of hash collision with float NaN

2021-04-10 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue43654] IDLE: Applying settings disables tab completion

2021-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I presume '^' means 'hit Tab'.

The underlying Python problem is that namespaces are conceptually mappings of 
names (identifiers), a subset of strings, to objects.  Python specifies that 
the global namespace is a dict, which I believe could mean a dict subclass 
restricting keys to strings or maybe even identifier strings.  But CPython, at 
least, uses built-in dicts, allowing any hashable as a key.  Ditto for 
attribute dicts and locals.  At toplevel, locals() is globals().

(There are a few semi-same uses to non-identifier string completions.
>>> globals()["3.1459"] = None
>>> 3.1459 # 3
and
>>> globals()['itertools.permutations'] = None
>>> itertools.permutations # itert
But not recommended or, I believe, guaranteed.)

Completion lists are sorted.  In original Python, sorting was universal.  That 
was broken for a few types by 2.7.  In 3.x, comparisons and hence sorting were 
restricted.

Decoding the traceback.  Completion requests are handled in the IDLE interface 
process.  The remotecall in autocomplete.fetch_completions tries to execute 
fetch_completions in the user execution process.  That fails trying to sort the 
list of globals.  The exception is returned with the tag "CALLEXC".  In rpc, 
decoderesponse filters out various failures and raises the returned exception.

IDLE could filter out non-strings from global and attribute dicts or display a 
special message.  Or do nothing on the basis that putting non-strings in 
namespaces and making them unsortable is either a user bug or a consenting 
adults, do at your own risk and deal with the consequences operation.

Built-in dir() sorts keys and hence it and anything using it fails.

>>> globals()[1]=None
>>> dir()
Traceback (most recent call last):
  File "", line 1, in 
dir()
TypeError: '<' not supported between instances of 'int' and 'str'

Indeed, fetch_completions uses dir(), and this is where it fails.  

Vars() does not sort, allowing one to see the full contents.

>>> vars()
{'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': 
, '__spec__': None, 
'__annotations__': {}, '__builtins__': , 1: None}

If one edits a file after putting a non-string in globals, the TypeError is not 
displayed.  Instead, tab completion is silently disabled and spaces are 
inserted, just as after applying settings.  This is not good and so a point in 
favor of doing something.

--
versions: +Python 3.10 -Python 3.9

___
Python tracker 

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



[issue39125] Type signature of @property not shown in help()

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Currently there is no way to tell if the *attribute* 
> is read-only, read-write or write-only.

Read-only is segregated in the help() output.

>>> class A:
@property
def computed_field(self):
'An example property'


>>> help(A)
Help on class A in module __main__:

class A(builtins.object)
 |  Readonly properties defined here:
 |  
 |  computed_field
 |  An example property
 |  
 |  --
 |  Data descriptors defined here:
 |  
 |  __dict__
 |  dictionary for instance variables (if defined)
 |  
 |  __weakref__

--

___
Python tracker 

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



[issue43776] Popen with shell=True yield mangled repr output

2021-04-10 Thread mkocher


Change by mkocher :


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

___
Python tracker 

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



[issue43802] Seg fault on macOS using multiprocessing.JoinableQueue

2021-04-10 Thread Ned Deily


Ned Deily  added the comment:

Thanks for providing a detailed and relatively simple-to-run test case for such 
a complicated failure. Not totally surprising for what appears to likely be a 
race condition, I have been unable to reproduce it under several macOS 
environments including in a 10.13.6 VM with multiple cores and under 11.2.3. 
I'm not sure if this would be expected to affect the results but I did receive 
multiple "WARNING: Could not import wedge: Error in getting DynamicWedges" 
messages when running the test case.

Doing a quick exam of the installed set up, it appears that there is no attempt 
to use multiprocessing's "fork" method which is known to be problematic on 
macOS so that's a plus. And there don't appear to be any extension modules so 
the test case is pure Python, eliminating other likely suspects.

One question that does come to mind is exactly which version of Python 3.9.2 
you are testing with; can you provide the results of: /path/to/python3.9 -c 
'import sys;print(sys.version)' ?

Searching bugs.python.org, I see a few open issues with segfaults in 
PyObject_RichCompare but nothing that leaps out as being obviously similar. If 
it were possible to reproduce the segfault in other environments, like with 
3.9.4 or on newer versions of macOS or on a current Linux platform, that would 
help to confirm the issue. Even better would be to be able to reproduce the 
issue while running a current Python 3.9 built with --with-pydebug on; 
unfortunately, we don't normally provide pre-built debug binaries on 
python.org. And, of course, running in debug mode could affect the rece 
condition, if that is indeed the issue.

--
nosy: +davin, pitrou

___
Python tracker 

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



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset ac05f82ad4983e3d3653ae7494c1ff62c4a265fc by DevilXD in branch 
'master':
bpo-41974: Remove part of the note regarding complex.__float__ (GH-25197)
https://github.com/python/cpython/commit/ac05f82ad4983e3d3653ae7494c1ff62c4a265fc


--

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-10 Thread STINNER Victor


STINNER Victor  added the comment:

Carl:
> Just chiming in to say that for PyPy this API would be extremely useful, 
> because PyPy's "is" is not implementable with a pointer comparison on the C 
> level (due to unboxing we need to compare integers, floats, etc by value). 
> Right now, C extension code that compares pointers is subtly broken and 
> cannot be fixed by us.

Can you come with a sentence that I can put in the documentation to explain 
that Py_Is() is written for interoperability with other Python implementations?

--

___
Python tracker 

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



[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 09bbebea163fe7303264cf4069c51d4d2f22fde4 by Victor Stinner in 
branch 'master':
bpo-43753: Add Py_Is() and Py_IsNone() functions (GH-25227)
https://github.com/python/cpython/commit/09bbebea163fe7303264cf4069c51d4d2f22fde4


--

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

LGTM

--

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

I can go either way. It's easy enough for the user to add their own 
__match_args__, so I won't link them.

Here's what I have for the documentation, which is why the issue came up:

   - ``match_args``: If true (the default is ``True``), the
 ``__match_args__`` tuple will be created from the list of
 parameters to the generated :meth:`__init__` method (even if
 :meth:`__init__` is not generated, see above).  If false, or if
 ``__match_args__`` is already defined in the class, then
 ``__match_args__`` will not be generated.

--

___
Python tracker 

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



[issue43478] Disallow Mock spec arguments from being Mocks

2021-04-10 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 9.0 -> 10.0
pull_requests: +24071
pull_request: https://github.com/python/cpython/pull/25227

___
Python tracker 

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



[issue43770] Rework C types initialization

2021-04-10 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +24070
pull_request: https://github.com/python/cpython/pull/25336

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

There may be other reasons why `__init__` is not desired, and there's no
absolute requirement that `__match_args__` must match the constructor --
only a convention. I'd say don't tie them together.

--

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

> Are there other cases where suppressing one thing affects others?

Only the complex interactions among the unsafe_hash, eq, and frozen parameters.

It feels like if __init__ is not being generated, then the @dataclass code 
would have no idea what it should set __match_args__ to.

Not that this problem isn't strictly related to the match_args=False case, it 
just occurred to me that it's related while I was writing the documentation. 
Perhaps this should be a separate issue.

--

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Are there other cases where suppressing one thing affects others?

--

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

Here's a question. If __init__ is not being generated, either because the user 
supplied one to this class, or if init=False is specified, should 
__match_args__ be generated? I think the answer should be no, since the code 
has no idea what the parameters to __init__ will be. But I'd like to hear from 
people more familiar with pattern matching.

I'm working on a patch, and this is my last issue.

--

___
Python tracker 

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



[issue43478] Disallow Mock spec arguments from being Mocks

2021-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6e468cb16bde483ad73c1eb13b20a08d74e30846 by Pablo Galindo in 
branch 'master':
bpo-43478: Fix formatting of NEWS entry (GH-25335)
https://github.com/python/cpython/commit/6e468cb16bde483ad73c1eb13b20a08d74e30846


--

___
Python tracker 

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



[issue43770] Rework C types initialization

2021-04-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ecf14e6557c6e4f7af9c0d6460d31fe121c22553 by Victor Stinner in 
branch 'master':
bpo-43770: Refactor type_new() function (GH-25325)
https://github.com/python/cpython/commit/ecf14e6557c6e4f7af9c0d6460d31fe121c22553


--

___
Python tracker 

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



[issue43478] Disallow Mock spec arguments from being Mocks

2021-04-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 8.0 -> 9.0
pull_requests: +24069
pull_request: https://github.com/python/cpython/pull/25335

___
Python tracker 

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



[issue43800] os.fwalk is not exposed on macOS

2021-04-10 Thread Ned Deily


Ned Deily  added the comment:

Thank you for the report. The issue is that the necessary operating system 
support for opening with a file descriptor, openat, was only first implemented 
in macOS 10.10 (see man 2 openat) and, up until recently, all python.org macOS 
binaries were built on 10.9 (or earlier) systems for compatibility across 
multiple operating system versions. As of Python 3.9.1, we now support 
"weak-linking", that is, building on newer systems but still able to run on 
older systems. The python.org macOS universal2 installer variant, introduced in 
3.9.1, does support os.fwalk() on macOS 10.10+. (The legacy 10.9 Intel-64 only 
variant is still built on 10.9 but will be phased out by the release of Python 
3.10.)  If you build recent Python versions from source with a deployment 
target of 10.10 or later, you should also find a working os.fwalk().

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



[issue43798] Add position metadata to alias AST type

2021-04-10 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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



[issue43798] Add position metadata to alias AST type

2021-04-10 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:


New changeset 75a06f067bd0a2687312e5f8e78f9075be76ad3a by Matthew Suozzo in 
branch 'master':
bpo-43798: Add source location attributes to alias (GH-25324)
https://github.com/python/cpython/commit/75a06f067bd0a2687312e5f8e78f9075be76ad3a


--

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-04-10 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue43800] os.fwalk is not exposed on macOS

2021-04-10 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue42737] PEP 563: drop annotations for complex assign targets

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, reading the thread it's not 100% clear to me what you are proposing to do 
in your patch, since different people seem to have proposed different things.

I think I'd be okay if `foo[bar]: baz` and `foo.bar: baz` (etc.) didn't 
generate any bytecode at all. Is that what you're proposing here? If so, and 
assuming the code is reasonably straightforward, I'd say go ahead and make a PR 
(and close the old OR).

In case it's relevant, I don't peronally expect Larry's clever alternative to 
PEP 563 to make it past the SC, and I don't care much about it (too many tricky 
edge cases), but it's out of my control, so don't count on that being dead just 
yet.

And FWIW changing how annotations are represented in the AST is out of scope 
for this issue. (There are tricky edge cases there too.)

--

___
Python tracker 

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



[issue43682] Make static methods created by @staticmethod callable

2021-04-10 Thread STINNER Victor


STINNER Victor  added the comment:

> Implement __get__ for C functions. Of course it is breaking change so we 
> should first emit a warning. It will force all users to use staticmethod 
> explicitly if they set a C function as a class attribute. We can also start 
> emitting warnings for all callable non-descriptor class attributes.

Well... such change would impact way more code and sounds to require a painful 
migration plan.

Also, it doesn't prevent to make static methods callable, no?

--

___
Python tracker 

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



[issue43792] Cython is not compatible with Python 3.10 yet: "SystemError: bad argument to internal function"

2021-04-10 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is a bug in Cython, not in Python. I close it.

--
resolution:  -> third party
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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

Okay, I'll re-open this to just add @dataclass(match_args=False).

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

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

I don't think we need control at the field level here. Omitting one field
is just going to cause confusion.

--

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

> So, should we reopen this ad add the flag to suppress __match_args__ 
> generation after all?

I think so, although I'm still contemplating it.

I can't decide if we should also add match_arg=False to field(). Or is it good 
enough to just tell the user to manually set __match_args__ if they want that 
level of control? I think this is different enough from repr, init, etc. that 
we don't need to allow the per-field control, although maybe doing so would 
make the code more robust in terms of re-ordering or adding fields at a later 
date.

--

___
Python tracker 

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



[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

> Do you need anything from me here?

No, I don't think so. Thanks.

--

___
Python tracker 

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



[issue43654] IDLE: Applying settings disables tab completion

2021-04-10 Thread Mikhail


Mikhail  added the comment:

I did a little experiment, and it turned out that the problem is not in the 
IDLE, but inside Python itself. With this case, the same behavior remains 
inside the terminal version of Python, and IPython also produces a similar 
error.

--

___
Python tracker 

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



[issue43654] IDLE: Applying settings disables tab completion

2021-04-10 Thread Mikhail


Mikhail  added the comment:

Hello again!
I found another kind of bug, where the autosupplement window doesn't show up. 
In order for the bug to occur, you need to put a non-string value into 
`locals()`.
Example:
```
locals()['arg'] = 123  # or locals().setdefault('arg', 123)
# ^ it's okay

locals()[123] = 123  # or locals().setdefault(123, 123)
# ^ completion window is not shown
```
Of course, I know that "Whether or not updates to this dictionary will affect 
name lookups in the local scope and vice-versa not covered by any backwards 
compatibility guarantees" , but take a little bug :)

Here is the traceback of the error
```
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.9/tkinter/__init__.py", line 1885, in __call__
return self.func(*args)
  File "/usr/lib/python3.9/idlelib/multicall.py", line 176, in handler
r = l[i](event)
  File "/usr/lib/python3.9/idlelib/autocomplete.py", line 74, in 
autocomplete_event
opened = self.open_completions(TAB)
  File "/usr/lib/python3.9/idlelib/autocomplete.py", line 146, in 
open_completions
comp_lists = self.fetch_completions(comp_what, mode)
  File "/usr/lib/python3.9/idlelib/autocomplete.py", line 171, in 
fetch_completions
return rpcclt.remotecall("exec", "get_the_completion_list",
  File "/usr/lib/python3.9/idlelib/rpc.py", line 219, in remotecall
return self.asyncreturn(seq)
  File "/usr/lib/python3.9/idlelib/rpc.py", line 250, in asyncreturn
return self.decoderesponse(response)
  File "/usr/lib/python3.9/idlelib/rpc.py", line 270, in decoderesponse
raise what
TypeError: '<' not supported between instances of 'int' and 'str'
```

--
versions: +Python 3.9 -Python 3.10

___
Python tracker 

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



[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I have updated the PR with:

* Works for while statements (we can make it work for other kinds of statements 
but is a bit tricky because those have different grammar paths. We could do 
this in other PRs.

* I changed the error message for when the LHS is a name. In other cases we 
still want the special error message. For example:

>>> f() = 1
  File "", line 1
f() = 1
^
SyntaxError: cannot assign to function call. Maybe you meant '==' instead of 
'='?

If we still want something different we could say:

"cannot assign to ... here". The "here" makes it clear that in other places 
could be possible to do an assignment (for instance with names or attributes).

--

___
Python tracker 

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



[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> in invalid_named_expression, but it does not have any effect.

That is because the rule for named_expressions are:

 named_expression[expr_ty]:
 | a=NAME ':=' ~ b=expression
 | expression !':='
 | invalid_named_expression

and the second alternative (| expression !':=') succeeds with an assignment, 
not letting the invalid_named_expression run

--

___
Python tracker 

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



[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

These are good points, let me investigate a bit

--

___
Python tracker 

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



[issue40701] tempfile mixes str and bytes in an inconsistent manner

2021-04-10 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset e05a703848473b0365886dcc593cbddc46609f29 by Gregory P. Smith in 
branch 'master':
bpo-40701: doc typo historcal -> historical (GH-25334)
https://github.com/python/cpython/commit/e05a703848473b0365886dcc593cbddc46609f29


--

___
Python tracker 

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



[issue40701] tempfile mixes str and bytes in an inconsistent manner

2021-04-10 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +24068
pull_request: https://github.com/python/cpython/pull/25334

___
Python tracker 

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



[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2021-04-10 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

So, should we reopen this ad add the flag to suppress __match_args__ generation 
after all?

--

___
Python tracker 

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



[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Do you need anything from me here?

--

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the PR

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 28fb2d1c4dbf16b05acfb20d457b08e049a7c83f by Miss Islington (bot) 
in branch '3.9':
bpo-43739: Add type declaration Doc/extending/extending.rst example (GH-25333)
https://github.com/python/cpython/commit/28fb2d1c4dbf16b05acfb20d457b08e049a7c83f


--

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 3a3c0464bd719a8cac6e52b02a3479b2834b88a4 by Miss Islington (bot) 
in branch '3.8':
bpo-43739: Add type declaration Doc/extending/extending.rst example (GH-25332)
https://github.com/python/cpython/commit/3a3c0464bd719a8cac6e52b02a3479b2834b88a4


--

___
Python tracker 

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



[issue43802] Seg fault on macOS using multiprocessing.JoinableQueue

2021-04-10 Thread Jacob Walls


New submission from Jacob Walls :

macOS 10.13.6
Python 3.9.2

I can consistently reproduce a seg fault while using 
multiprocessing.JoinableQueue in Python 3.9.2.

My use case is the sheet music processing library music21. My fork includes a 
folder of 209 files I use to reproduce, running 3 cores, shown in the script 
below. (This is a subset of the over 1,000 files found here: 
https://github.com/MarkGotham/When-in-Rome/tree/master/Corpus/OpenScore-LiederCorpus
Using this set of 1,000 files reproduces nearly every time; using the 209 files 
I committed to my fork was enough to reproduce about 75% of the time.)

I'm a contributor to music21, so if this is an overwhelming amount of 
information to debug, I will gladly pare this down as much as I can or create 
some methods to access the multiprocessing functionality more directly. Many 
thanks for any assistance.


pip3 install 
git+https://github.com/jacobtylerwalls/music21.git@bpo-investigation

from music21 import corpus
# suggest using a unique name each attempt
lc = corpus.corpora.LocalCorpus(name='bpo-investigation')
# point to the directory of files I committed to my fork for this investigation
lc.addPath('/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/music21/bpo-files')
# parse the files using multiprocessing
# calls music21.metadata.bundles.MetadataBundle.addFromPaths()
# which calls music21.metadata.caching.process_parallel()
lc.save()

# CTRL-C to recover from seg fault
# then, wipe out the entries in .music21rc so that you can cleanly reproduce 
again
from music21 import environment
us = environment.UserSettings()
us['localCorporaSettings'] = {}
quit()


Process:   Python [31677]
Path:  
/Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python
Identifier:Python
Version:   3.9.2 (3.9.2)
Code Type: X86-64 (Native)
Parent Process:Python [31674]
Responsible:   Python [31677]
User ID:   501

Date/Time: 2021-04-10 11:21:19.294 -0400
OS Version:Mac OS X 10.13.6 (17G14042)
Report Version:12
Anonymous UUID:E7B0208A-19D6-ABDF-B3EA-3910A56B3E72

Sleep/Wake UUID:   C4B83F57-6AD1-469E-82AE-88214FAA6283

Time Awake Since Boot: 14 seconds
Time Since Wake:   5900 seconds

System Integrity Protection: enabled

Crashed Thread:0  Dispatch queue: com.apple.main-thread

Exception Type:EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:   KERN_INVALID_ADDRESS at 0x000100b3acd8
Exception Note:EXC_CORPSE_NOTIFY

Termination Signal:Segmentation fault: 11
Termination Reason:Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0x100b3acd8:
--> 
__TEXT 0001068bb000-0001068bc000 [4K] r-x/rwx 
SM=COW   
[/Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.python.python   0x000106944072 PyObject_RichCompare 
+ 258
1   org.python.python   0x000106943e9b 
PyObject_RichCompareBool + 43
2   org.python.python   0x0001069ce3c0 min_max + 624
3   org.python.python   0x000106940bab cfunction_call + 59
4   org.python.python   0x000106901cad _PyObject_MakeTpCall 
+ 365
5   org.python.python   0x0001069d865c call_function + 876
6   org.python.python   0x0001069d5b8b 
_PyEval_EvalFrameDefault + 25371
7   org.python.python   0x000106902478 
function_code_fastcall + 104
8   org.python.python   0x0001069d85cc call_function + 732
9   org.python.python   0x0001069d5ad2 
_PyEval_EvalFrameDefault + 25186
10  org.python.python   0x0001069d92c3 _PyEval_EvalCode + 
2611
11  org.python.python   0x000106902401 
_PyFunction_Vectorcall + 289
12  org.python.python   0x0001069d85cc call_function + 732
13  org.python.python   0x0001069d5ad2 
_PyEval_EvalFrameDefault + 25186
14  org.python.python   0x0001069d92c3 _PyEval_EvalCode + 
2611
15  org.python.python   0x000106902401 
_PyFunction_Vectorcall + 289
16  org.python.python   0x000106901b05 
_PyObject_FastCallDictTstate + 293
17  org.python.python   0x0001069026e8 
_PyObject_Call_Prepend + 152
18  org.python.python   0x00010695be85 slot_tp_init + 165
19  org.python.python   0x0001069573d9 type_call + 345
20  org.python.python   0x000106901cad _PyObject_MakeTpCall 
+ 365
21  org.python.python   0x0001069d865c call_function + 876
22  org.python.python   0x0001069d5af3 
_PyEval_EvalFrameDefault 

[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +scoder

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24067
pull_request: https://github.com/python/cpython/pull/25333

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +24066
pull_request: https://github.com/python/cpython/pull/25332

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset ea9b2d631902238acf69e51af6e3d308567b5dfd by Shreyan Avigyan in 
branch 'master':
bpo-43739: Add type declaration Doc/extending/extending.rst example
https://github.com/python/cpython/commit/ea9b2d631902238acf69e51af6e3d308567b5dfd


--
nosy: +rhettinger

___
Python tracker 

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



[issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative

2021-04-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I just checked with another Python expert who reported:
"""
I have never once in my whole life seen or used a negative modulo. And that 
says a lot given that 6 years of it was spent studying math. Including a few 
years in a math PhD program.

Perhaps my only "surprise" on negative modulo is finding out that the classic 
gcd algorithm works fine if you give it negative integers.
"""

The reviewer inputs a unanimous.  Marking this as closed.  Please do not be 
rude and reopen again.

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

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Documentation versions older than 3.8 describes a different approach to import 
the module. Therefore those documentation versions are not to be messed with. 
I've attached the PRs for documentation versions 3.10, 3.9 and 3.8. Please 
anyone have a review of my PR as soon as possible.

Thanking you,

With Regards

--
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43790] CLA check fails with a 500 error

2021-04-10 Thread Bob Kline


Bob Kline  added the comment:

And now it's working for me as well. Thanks, @Mariatta.

--
resolution: third party -> fixed
status: open -> closed

___
Python tracker 

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



[issue43790] CLA check fails with a 500 error

2021-04-10 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Thanks Mariatta. It works now. I'm able to check if I've signed the CLA now. 
Thanks a lot.

--

___
Python tracker 

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



[issue43790] CLA check fails with a 500 error

2021-04-10 Thread Bob Kline


Bob Kline  added the comment:

I can, if you prefer, close this ticket and create a new one on GitHub (even 
though this is the same issue, not a different "further" issue).

--

___
Python tracker 

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



[issue43801] Carriage Return problem in version v3.9.0:9cf6752

2021-04-10 Thread Santosh Kumbhar


New submission from Santosh Kumbhar :

Carriage return \r provide incorrect result

--
components: Interpreter Core
files: CarriageReturn_Issue.JPG
messages: 390714
nosy: skumbhar
priority: normal
severity: normal
status: open
title: Carriage Return problem in version v3.9.0:9cf6752
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49952/CarriageReturn_Issue.JPG

___
Python tracker 

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



[issue43790] CLA check fails with a 500 error

2021-04-10 Thread Bob Kline


Bob Kline  added the comment:

To reproduce, enter "bkline" in the GitHub username field and press Check.

--

___
Python tracker 

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



[issue43790] CLA check fails with a 500 error

2021-04-10 Thread Bob Kline


Bob Kline  added the comment:

Sorry, it's still failing with the same error message.

--
status: closed -> open

___
Python tracker 

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



[issue43790] CLA check fails with a 500 error

2021-04-10 Thread Bob Kline


Bob Kline  added the comment:

Super, thanks!

--

___
Python tracker 

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



[issue43800] os.fwalk is not exposed on macOS

2021-04-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue43800] os.fwalk is not exposed on macOS

2021-04-10 Thread ntninja


New submission from ntninja :

Is has come to my attention that the `os.fwalk` function has been missing from 
the standard library on Python for macOS since 3.6, even though macOS should 
support the necessary OS-interfaces (as specified in POSIX.1-2008) to support 
that function it just doesn't appear to exist.

Due to lack of the required hardware I can unfortunately not even test this 
myself.

--
components: Library (Lib)
messages: 390710
nosy: ntninja
priority: normal
severity: normal
status: open
title: os.fwalk is not exposed on macOS
type: behavior

___
Python tracker 

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



[issue43790] CLA check fails with a 500 error

2021-04-10 Thread Mariatta


Mariatta  added the comment:

Thanks for the report. I've identified the problem and fixed it. It should be 
working now. Further issues with it can be filed at

https://github.com/Mariatta/check_python_cla/issues

Thanks.

--
assignee:  -> Mariatta
components:  -Demos and Tools
resolution:  -> third party
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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
pull_requests: +24065
pull_request: https://github.com/python/cpython/pull/25331

___
Python tracker 

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



[issue43478] Disallow Mock spec arguments from being Mocks

2021-04-10 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
nosy:  -shreyanavigyan

___
Python tracker 

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



[issue43478] Disallow Mock spec arguments from being Mocks

2021-04-10 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
pull_requests:  -24064

___
Python tracker 

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



[issue43478] Disallow Mock spec arguments from being Mocks

2021-04-10 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
nosy: +shreyanavigyan
nosy_count: 8.0 -> 9.0
pull_requests: +24064
pull_request: https://github.com/python/cpython/pull/25207

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
pull_requests: +24063
pull_request: https://github.com/python/cpython/pull/25330

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I've managed to overcome the "HEAD Detached" problem I was facing when 
switching to the 3.9, 3.8, 3.7 and 3.6 branches. So I'm also submitting the PRs 
for those documentation versions.

--

___
Python tracker 

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



[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-10 Thread Adrian Freund


Adrian Freund  added the comment:

I think for namedtuple a short mention in the opening paragraph, where it also 
mentions the generation of a docstring and __repr__ method should be enough.

--

___
Python tracker 

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



[issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1

2021-04-10 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1

2021-04-10 Thread Christian Heimes


New submission from Christian Heimes :

OpenSSL 1.1 introduced the macro OPENSSL_API_COMPAT to select which APIs are 
exposed and which deprecation warnings are shown. 
https://www.openssl.org/docs/manmaster/man7/OPENSSL_API_COMPAT.html

"#define OPENSSL_API_COMPAT 0x10101000L" suppresses warnings for APIs that are 
available in 1.1.1 and deprecated in 3.0.0.

--
assignee: christian.heimes
components: SSL
messages: 390706
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1
type: behavior
versions: Python 3.10, 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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-10 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I've signed the PSF CLA (as it is required) now. Please have a review.

--

___
Python tracker 

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



[issue43682] Make static methods created by @staticmethod callable

2021-04-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Do you see a way to make C functions and Python functions behave the same?

Implement __get__ for C functions.

Of course it is breaking change so we should first emit a warning. It will 
force all users to use staticmethod explicitly if they set a C function as a 
class attribute. We can also start emitting warnings for all callable 
non-descriptor class attributes.

--

___
Python tracker 

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



[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I tried to add

| a=NAME '=' {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
a, "invalid syntax. Maybe you meant '==' or ':=' instead of '='?") }
| a=bitwise_or '=' {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
a, "invalid syntax. Maybe you meant '==' instead of '='?") }

in invalid_named_expression, but it does not have any effect.

--

___
Python tracker 

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



[issue40701] tempfile mixes str and bytes in an inconsistent manner

2021-04-10 Thread Łukasz Langa

Łukasz Langa  added the comment:

Sorry, I decided not to take this. We're four bugfix releases into 3.9 and 
there is non-zero chance somebody relies on existing behavior somehow. Marking 
this as changing with 3.10.0 is cleaner from an end user standpoint.

--
priority: release blocker -> normal
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.9

___
Python tracker 

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



[issue43475] Worst-case behaviour of hash collision with float NaN

2021-04-10 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Why not have hash() return the id() like we do for instances of object?

I think that's fine, and IIUC that's what Cong Ma was proposing. It seems like 
the least invasive potential fix.

In principle I find the idea of making NaN a singleton rather attractive - the 
performance hit is likely negligible, and it solves a bunch of subtle 
NaN-related issues. (For example, there's still a proposal to provide an IEEE 
754 total_ordering key so that lists of floats can be ordered sanely in the 
presence of nans, but even if you use that you don't know whether your nans 
will end up at the start or the end of the list, and you could potentially have 
nans in both places; fixing a single nan and its sign bit would fix that.) But 
there are bound to be some people somewhere making use of the NaN payload and 
sign bit, however inadvisedly, and Serhiy's right that this couldn't be 
extended to Decimal, where the sign bit and payload of the NaN are mandated by 
the standard.

--

___
Python tracker 

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



  1   2   >