[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-28 Thread Inada Naoki


Change by Inada Naoki :


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



[issue42190] global declarations affect too much inside exec or compile

2020-10-28 Thread Kevin Shweh


New submission from Kevin Shweh :

A global declaration inside a function is only supposed to affect assignments 
inside that function, but in code executed with exec, a global declaration 
affects assignments outside the function:

>>> gdict = {}
>>> ldict = {}
>>> exec('x = 1', gdict, ldict)
>>> 'x' in gdict
False
>>> 'x' in ldict
True
>>> 
>>> gdict = {}
>>> ldict = {}
>>> exec('''
... x = 1
... def f(): global x''', gdict, ldict)
>>> 'x' in gdict
True
>>> 'x' in ldict
False

Here, we can see that the presence of a "global x" declaration inside f causes 
the "x = 1" outside of f to assign to globals instead of locals. This also 
affects code objects compiled with compile().

--
components: Interpreter Core
messages: 379855
nosy: Kevin Shweh
priority: normal
severity: normal
status: open
title: global declarations affect too much inside exec or compile
type: behavior
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



[issue42163] _replace() no longer works on platform.uname_result objects

2020-10-28 Thread Robert O'Callahan


Robert O'Callahan  added the comment:

I filed issue 42189, which is similar but maybe worse: copy.deepcopy() is 
broken for platform.uname_result objects.

--
nosy: +rocallahan

___
Python tracker 

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



[issue42189] copy.deepcopy() no longer works on platform.uname_result objects

2020-10-28 Thread Robert O'Callahan


New submission from Robert O'Callahan :

Starting from Python 3.9, copy.deepcopy can't copy a platform.uname_result 
object.

```
Python 3.9.0 (default, Oct  6 2020, 00:00:00) 
[GCC 10.2.1 20200826 (Red Hat 10.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> import copy
>>> u = platform.uname()
>>> print(u)
uname_result(system='Linux', node='localhost.localdomain', 
release='5.8.16-300.fc33.x86_64', version='#1 SMP Mon Oct 19 13:18:33 UTC 
2020', machine='x86_64')
>>> v = copy.deepcopy(u)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.9/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
  File "/usr/lib64/python3.9/copy.py", line 264, in _reconstruct
y = func(*args)
  File "/usr/lib64/python3.9/copyreg.py", line 91, in __newobj__
return cls.__new__(cls, *args)
TypeError: () takes 6 positional arguments but 7 were given
```

Looks similar to issue 42163 but I guess it might need to be fixed differently.

This has broken building Intel's Xed library, which uses a Python-based build 
system: https://github.com/intelxed/mbuild

--
components: Library (Lib)
messages: 379853
nosy: rocallahan
priority: normal
severity: normal
status: open
title: copy.deepcopy() no longer works on platform.uname_result objects
type: behavior
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



[issue42187] Deprecating / removing token.ISTERMINAL/ISNONTERMINAL

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

I thought for all?

--

___
Python tracker 

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



[issue42188] forkserver not reused in child processes

2020-10-28 Thread Colin


New submission from Colin :

The docstring on Forkserver.ensure_running states that a child process will use 
the forkserver process started by its parent:

"""
Make sure that a fork server is running.

This can be called from any process.  Note that usually a child
process will just reuse the forkserver started by its parent, so
ensure_running() will do nothing.
"""

Link to definition: 
https://github.com/python/cpython/blob/master/Lib/multiprocessing/forkserver.py#L105

That is not the behavior that I am seeing, however. I'm seeing each child (that 
start a process itself) will first spawn a *new* forkserver.

--
components: Library (Lib)
files: test.py
messages: 379851
nosy: cchomey
priority: normal
severity: normal
status: open
title: forkserver not reused in child processes
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49547/test.py

___
Python tracker 

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



[issue42186] unittest overrides more serious warnings filter added before unittest.main()

2020-10-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems to be a duplicate of https://bugs.python.org/issue15626. See also 
https://bugs.python.org/issue31975

--
nosy: +ncoghlan

___
Python tracker 

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



[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-28 Thread Boris Staletic


Boris Staletic  added the comment:

Thanks for looking into this.

> Looks like a bug in valgrind.

That actually explains why I wasn't able to reproduce this problem on my local 
machine. Ubuntu 20.04 comes with valgrind 3.15.0, while my local machine has 
3.16.1. Upgrading valgrind on Ubuntu 20.04 does fix the issue.

This is good enough for me and I guess this can be closed as "not a bug".

--

___
Python tracker 

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



[issue42186] unittest overrides more serious warnings filter added before unittest.main()

2020-10-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue42173] Drop Solaris support

2020-10-28 Thread Yonatan Goldschmidt


Change by Yonatan Goldschmidt :


--
nosy: +Yonatan Goldschmidt

___
Python tracker 

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



[issue42187] Deprecating / removing token.ISTERMINAL/ISNONTERMINAL

2020-10-28 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Since there are so few projects, maybe you can just contact them?

For NT_OFFSET?

--

___
Python tracker 

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



[issue42187] Deprecating / removing token.ISTERMINAL/ISNONTERMINAL

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Since there are so few projects, maybe you can just contact them?

--

___
Python tracker 

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



[issue42187] Deprecating / removing token.ISTERMINAL/ISNONTERMINAL

2020-10-28 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
keywords:  -3.4regression

___
Python tracker 

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



[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It points on strcmp(lower, "us_ascii") == 0.

Seems that the compiler optimizes calling strcmp() with compile-time constant 
"us_ascii" by reading and comparing first 8 bytes as single word. But if lower 
contains "latin1" it has only 7 bytes initialized, and the 8-th is not 
initialized. It does not affect the result, but valgrind complains. Looks like 
a bug in valgrind.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42185] class body bytecode uses less efficient *_NAME opcodes

2020-10-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It cannot use LOAD_GLOBAL because the name can be not global. For example:

def f(self): ...
f = property(f)

It cannot use STORE_FAST and LOAD_FAST because they work with specific 
representation of locals as array, but in a class body it can be arbitrary 
mapping (returned by __prepare__()).

Also, executing bytecode takes only minor part of the class creation time, so 
optimization of LOAD_NAME and STORE_NAME is preliminary.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36281] OSError: handle is closed for ProcessPoolExecutor and run_in_executor

2020-10-28 Thread Joel Lopes Da Silva


Change by Joel Lopes Da Silva :


--
nosy: +JoeKun

___
Python tracker 

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



[issue42061] Document __format__ method for IPv[46]Address

2020-10-28 Thread Teugea Ioan-Teodor


Change by Teugea Ioan-Teodor :


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

___
Python tracker 

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



[issue42187] Deprecating / removing token.ISTERMINAL/ISNONTERMINAL

2020-10-28 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

Since the parser & symbol modules are removed, there is no real use case for 
ISTERMINAL/ISNONTERMINAL since the only input that contains grammar symbols is 
the input of the tokenize, which all its outputs are terminals. Which restricts 
the practicality of token.ISTERMINAL/ISNONTERMINAL. I'd propose we either 
deprecate them or remove them completely.

Search over the most populer PyPI packages (a set of 4k) showed there are only 
2 projects that uses these functions, which all cases coupled with the parser 
module.
pyglet-1.5.7/pyglet/text/formats/attributed.py
133:if token.ISNONTERMINAL(node[0]):
gdata-2.0.18/tests/coverage.py
328:if token.ISNONTERMINAL(tree[0]):

If we are going through a deprecation period, I will also propose to remove 
ISEOF, since it can be easily replaced and very under used. The only project 
that uses token.ISEOF in my dataset is asttokens, which I would say all cases 
there can be easily replaced tok.type == token.EOF

asttokens-2.0.4/asttokens/mark_tokens.py
105:   not token.ISEOF(t.type)):

Also, these functions are originally reflections of C macros used in the past, 
and since they are not used right now, we can also remove those macros.

I have no opinions about the token.NT_OFFSET though, but there are a couple of 
occurrences so we might keep that? 
Paste-3.4.4/paste/util/PySourceColor.py
205:ARGS = token.NT_OFFSET + 1
206:DOUBLECOMMENT = token.NT_OFFSET + 2

ipython-7.18.1/IPython/utils/PyColorize.py
54:_KEYWORD = token.NT_OFFSET + 1
55:_TEXT= token.NT_OFFSET + 2

--
keywords: 3.4regression
messages: 379844
nosy: BTaskaya, gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Deprecating / removing token.ISTERMINAL/ISNONTERMINAL

___
Python tracker 

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



[issue42186] unittest overrides more serious warnings filter added before unittest.main()

2020-10-28 Thread Yilei Yang


New submission from Yilei Yang :

Because unittest adds a `default` filter before tests run, other warnings 
filters are overridden if added before.

Ideally, unittest should not make the warnings less serious, e.g. if there is 
already an 'error' filter that raises exception, it shouldn't "downgrade" to 
'default' that simply prints.

The following example, using lib.a_function() raises exception in a regular 
program, but the unit test passes:

$ cat lib.py
import warnings
class MyWarning(UserWarning):
pass
warnings.filterwarnings('error', category=MyWarning)
def a_function():
  warnings.warn('Do not use.', MyWarning)

$ cat lib_test.py
import unittest
import lib
class TestLib(unittest.TestCase):
def test_function(self):
lib.a_function()
if __name__ == '__main__':
unittest.main()

$ python -m unittest -v lib_test
test_function (lib_test.TestLib) ... lib.py:6: MyWarning: Do not use.
  warnings.warn('Do not use.', MyWarning)
ok

--
Ran 1 test in 0.000s

OK

$ python
>>> import lib
>>> lib.a_function()
Traceback (most recent call last):
  File "", line 1, in 
  File "lib.py", line 6, in a_function
warnings.warn('Do not use.', MyWarning)
lib.MyWarning: Do not use.

--
components: Library (Lib)
messages: 379843
nosy: yilei
priority: normal
severity: normal
status: open
title: unittest overrides more serious warnings filter added before 
unittest.main()
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



[issue42185] class body bytecode uses less efficient *_NAME opcodes

2020-10-28 Thread Brandt Bucher


Brandt Bucher  added the comment:

In any case, I think the proposed change could break the current behavior:

>>> x = "global"
>>> class C:
... x = "local"
... l = x
... del x
... g = x
... 
>>> C.l
'local'
>>> C.g
'global'

--

___
Python tracker 

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



[issue42185] class body bytecode uses less efficient *_NAME opcodes

2020-10-28 Thread Brandt Bucher


Brandt Bucher  added the comment:

Actually, that doesn't make much sense in this context (more relevant would be 
a class-within-a-class or class-within-a-function).

I need to think about this more...

--

___
Python tracker 

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



[issue42185] class body bytecode uses less efficient *_NAME opcodes

2020-10-28 Thread Brandt Bucher

Brandt Bucher  added the comment:

Hm, I believe it is related to the reason why we need to use LOAD_CLASSDEREF 
instead of LOAD_DEREF with nonlocal names in class scope. If I understand 
correctly, the purpose is to keep nonlocal statements in methods from 
referencing class-level names.

>From 
>https://docs.python.org/3/reference/executionmodel.html#resolution-of-names:

> Class definition blocks and arguments to exec() and eval() are special in the 
> context of name resolution. A class definition is an executable statement 
> that may use and define names. These references follow the normal rules for 
> name resolution with an exception that unbound local variables are looked up 
> in the global namespace. The namespace of the class definition becomes the 
> attribute dictionary of the class. The scope of names defined in a class 
> block is limited to the class block; it does not extend to the code blocks of 
> methods – this includes comprehensions and generator expressions since they 
> are implemented using a function scope. This means that the following will 
> fail:
> 
> class A:
> a = 42
> b = list(a + i for i in range(10))

--

___
Python tracker 

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



[issue27886] Docs: the difference between rename and replace is not obvious

2020-10-28 Thread Ezio Melotti


Change by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue42024] Exception ignored in: .remove at 0x7f6a325f2ea0>

2020-10-28 Thread Zachary Ware


Change by Zachary Ware :


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



[issue42185] class body bytecode uses less efficient *_NAME opcodes

2020-10-28 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue42185] class body bytecode uses less efficient *_NAME opcodes

2020-10-28 Thread Gregory P. Smith


New submission from Gregory P. Smith :

The opcodes generated for the closure defining a class body looks like they 
might be suboptimal.  It seems stuck using the generic LOAD_NAME and STORE_NAME 
opcodes rather than the LOAD_GLOBAL and STORE_FAST and friends as one would 
expect and as happens within a normal function closure.

If true and the normal optimization pass (which I believe is done by 
`compiler.c` `compiler_nameop()` if i'm understanding this area of the code I 
don't know very well correctly...?) is not happening, it _appears_ maybe to be 
due to the `PyST_GetScope` call not currently having a way to represent this 
situation rather than being in a normal function?

I tried searching for an open issue on this but was at a loss of what to search 
for.  semi-related concepts might be found in:
 https://bugs.python.org/issue34750 - "locals().update doesn't work in Enum 
body, even though direct assignment to locals() does"
 https://bugs.python.org/issue10399 - "AST Optimization: inlining of function 
calls"
 https://bugs.python.org/issue9226 - "errors creating classes inside a closure"

None of those is really the same though.  if there are other filed issues 
regarding this, feel free to link to them in comments.

If this can be improved as it has been for function bodies already, it should 
be a measurable improvement to CPython startup time and/or import time.  
Especially on larger programs and things with a lot of generated code full of 
classes.

```
>>> import dis
>>> klass_def = '''
... class Klassy:
...   pinky = 'brain'
... def Funktion(castle_argh):
...   __module__ = __name__
...   __qualname__ = 'not Klassy'
...   pinky = 'brain'
... '''
>>> dis.dis(compile(klass_def, '', 'exec'))
  2   0 LOAD_BUILD_CLASS
  2 LOAD_CONST   0 (", line 2>)
  4 LOAD_CONST   1 ('Klassy')
  6 MAKE_FUNCTION0
  8 LOAD_CONST   1 ('Klassy')
 10 CALL_FUNCTION2
 12 STORE_NAME   0 (Klassy)

  4  14 LOAD_CONST   2 (", line 4>)
 16 LOAD_CONST   3 ('Funktion')
 18 MAKE_FUNCTION0
 20 STORE_NAME   1 (Funktion)
 22 LOAD_CONST   4 (None)
 24 RETURN_VALUE

Disassembly of ", line 2>:
  2   0 LOAD_NAME0 (__name__)
  2 STORE_NAME   1 (__module__)
  4 LOAD_CONST   0 ('Klassy')
  6 STORE_NAME   2 (__qualname__)

  3   8 LOAD_CONST   1 ('brain')
 10 STORE_NAME   3 (pinky)
 12 LOAD_CONST   2 (None)
 14 RETURN_VALUE

Disassembly of ", line 
4>:
  5   0 LOAD_GLOBAL  0 (__name__)
  2 STORE_FAST   1 (__module__)

  6   4 LOAD_CONST   1 ('not Klassy')
  6 STORE_FAST   2 (__qualname__)

  7   8 LOAD_CONST   2 ('brain')
 10 STORE_FAST   3 (pinky)
 12 LOAD_CONST   0 (None)
 14 RETURN_VALUE
```

--
components: Interpreter Core
messages: 379839
nosy: gregory.p.smith, twouters
priority: normal
severity: normal
stage: needs patch
status: open
title: class body bytecode uses less efficient *_NAME opcodes
type: performance
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



[issue42184] pdb exits unexpectedly when calling args

2020-10-28 Thread Adam Merchant


New submission from Adam Merchant :

When an objects __repr__ or __str__ methods return None a TypeError is raised. 
However if this object is passed to a function and `args` is called from within 
pdb, pdb will immediately exit.

Attached to this is bug_example.py which contains a simple example of how to 
reproduce this.

Depending on circumstances this can make debugging difficult.

exact python version that this happened with:
Python 3.6.11

--
files: bug_example.py
messages: 379838
nosy: xgenadam
priority: normal
severity: normal
status: open
title: pdb exits unexpectedly when calling args
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file49546/bug_example.py

___
Python tracker 

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



[issue42183] Stack overflow error with asyncio.all_tasks and wait_for

2020-10-28 Thread Gobot1234


New submission from Gobot1234 :

Using asyncio.wait_for and asyncio.all_tasks in combination causes a stack 
overflow error. 

Code to reproduce issue:
```
import asyncio

async def func():
return asyncio.all_tasks()

async def main():
print(await asyncio.wait_for(func(), timeout=10))

asyncio.run(main())
```

I'm not too sure how far back this goes but I've managed to reproduce it on 
sys.version_info(major=3, minor=8, micro=0, releaselevel='final', serial=0) and 
sys.version_info(major=3, minor=9, micro=0, releaselevel='final', serial=0).

--
components: asyncio
messages: 379837
nosy: Gobot1234, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Stack overflow error with asyncio.all_tasks and wait_for
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Cool. Please add me to the nosy list of any issues you open.

Also, if you're interesting helping out with the match statement, once the SC 
approves it, we'll need to add docs for that. See issue42128 for a possible 
plan.

--

___
Python tracker 

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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-28 Thread Ken Jin


Ken Jin  added the comment:

@guido, you're welcome! I'm thinking of updating the temporary hyperlinks for 
GenericAlias/PEP 585 in Union, subscriptions and typing, I'll submit 2 separate 
PRs since subscription and typing require backporting. 

If I think of anything major, I'll open a separate bpo to keep track of it 
there. Thanks.

--

___
Python tracker 

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



[issue42128] Structural Pattern Matching (PEP 634)

2020-10-28 Thread Brandt Bucher


Brandt Bucher  added the comment:

I'll wait till the SC makes a ruling, then send a message to our docs list (I 
think we have one)? I'm fine coordinating/reviewing that, or making PRs myself 
if nobody else steps up.

--

___
Python tracker 

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



[issue42128] Structural Pattern Matching (PEP 634)

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

If you feel up to it, you might see if you could open a new, separate
(draft) PR that updates all those docs. (But you could also wait and see if
someone volunteers. There are some good doc writers active ATM.)

--

___
Python tracker 

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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks Ken Ji! Are you planning more doc patches?

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



[issue42128] Structural Pattern Matching (PEP 634)

2020-10-28 Thread Brandt Bucher


Brandt Bucher  added the comment:

Thinking ahead...

A lot of work has gone into writing these PEPs...  we should see how much we 
can easily convert into actual docs. It seems to me:

- Parts of PEP 634 and PEP 635 can be worked into the language reference.

- Guido's overview (the appendix of PEP 636) can probably just be dropped 
verbatim into the What's New for 3.10.

- The rest of PEP 636 can just be lifted into the docs as a proper tutorial and 
linked to from the What's New.

Also, we need to document the stdlib changes (ast, collections, dataclasses, 
keyword, ...). The dis module docs are already part of the implementation.

--

___
Python tracker 

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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-28 Thread miss-islington


miss-islington  added the comment:


New changeset 577d7c4e628260eb7926d043ca9c355ece583eb7 by kj in branch '3.9':
[3.9] bpo-41805: Documentation for PEP 585 (GH-22615) (GH-23016)
https://github.com/python/cpython/commit/577d7c4e628260eb7926d043ca9c355ece583eb7


--
nosy: +miss-islington

___
Python tracker 

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



[issue42182] 3.10 Documentation Not Hyperlinking Some Methods

2020-10-28 Thread Ken Jin


New submission from Ken Jin :

Some ``:meth:`` markups are not being hyperlinked at all, while some are. This 
only occurs for Python 3.10. This also seems related to 
https://bugs.python.org/issue42042.

Eg. 
For 3.9, https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing:
``__bool__``, ``__len__`` are hyperlinked.

For 3.10, 
https://docs.python.org/3.10/library/stdtypes.html#truth-value-testing:
``__bool__``, ``__len__`` are not hyperlinked.

This occurs throughout the documentation, but it doesn't seem to consistently 
happen. For example, in 
https://docs.python.org/3.10/library/stdtypes.html#contextmanager.__exit__ , 
``__exit__`` is hyperlinked, but right below that section, the other 
``__exit__``s are not. This is puzzling since their markup both uses the same 
:meth:`__exit__`.

I'm not able to locally reproduce this using Sphinx 2.4.0. I don't know which 
version exactly of Sphinx this regression occured.

--
assignee: docs@python
components: Documentation
messages: 379829
nosy: docs@python, kj
priority: normal
severity: normal
status: open
title: 3.10 Documentation Not Hyperlinking Some Methods
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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-28 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +21932
pull_request: https://github.com/python/cpython/pull/23016

___
Python tracker 

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



[issue42181] describe PyEval_CallObjectWithKeywords and its replacement

2020-10-28 Thread Joachim

New submission from Joachim :

The current 3.9 docs do not describe PyEval_CallObjectWithKeywords, among other 
PyEval_CallObject* functions.

Yes, I know, these functions are deprecated. But they are still part of the 
API; they ought to be documented.

Rather, given that they are deprecated, there is more need than ever to 
document them: The documentation should specify when they have been deprecated, 
until then they are guaranteed to be supported, and most importantly, how they 
are to be replaced.

Fulltext search leads me to the 3.9 Changelog that says: »PyEval_CallFunction, 
PyEval_CallMethod and PyEval_CallObjectWithKeywords are deprecated. Use 
PyObject_Call() and its variants instead.« This is far not enough. As a 
maintainer of 3rd-party code with no knowledge of and no interest in the Python 
C API, I do not want to spend half a day on finding out which variant to use, 
and how argument lists differ.

--
components: C API
messages: 379828
nosy: j5w6, jdemeyer
priority: normal
severity: normal
status: open
title: describe PyEval_CallObjectWithKeywords and its replacement
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



[issue8943] Bug in InteractiveConsole /pickle

2020-10-28 Thread Steve Holden


Change by Steve Holden :


--
nosy:  -holdenweb

___
Python tracker 

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



[issue2142] difflib.unified_diff(...) produces invalid patches

2020-10-28 Thread Jakub Wilk


Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue42180] Missing a plural in library/functions

2020-10-28 Thread Rafael Fontenelle


Change by Rafael Fontenelle :


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

___
Python tracker 

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



[issue42180] Missing a plural in library/functions

2020-10-28 Thread Rafael Fontenelle


New submission from Rafael Fontenelle :

Missing plural in the start of the following sentence from library/functions:

"The optional argument *flags* and *dont_inherit* controls which :ref:`compiler 
options ` should be activated and which :ref:`future 
features ` should be allowed."

This was introduced in bpo-40484, probably by accident.

Link to source code: 
https://github.com/python/cpython/blob/master/Doc/library/functions.rst#L262

--
messages: 379827
nosy: rffontenelle
priority: normal
severity: normal
status: open
title: Missing a plural in library/functions
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



[issue40562] SEO: differentiate between Python 2 and Python 3 docs on Google SERP

2020-10-28 Thread Edouard Moine


Edouard Moine  added the comment:

Hey Simon, you can use the breadcrumb markup and other markups structured data 
with json on your webpage if you want google to read more efficiently your page 
in the browser. I used it on my https://www.mixy-design.com/;>web 
agency website if you want to have a look at the structure ;)

--
nosy: +mixy-design

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-28 Thread Tal Einat


Tal Einat  added the comment:

I should also mention that I configured and compiled Python for each of the 
above-mentioned versions using the --enable-optimizations` flag.

--

___
Python tracker 

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



[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2020-10-28 Thread Stefan Behnel


Stefan Behnel  added the comment:

In general, since the C accelerator is enabled by default, and few people would 
consider disabling it explicitly, I generally consider the behaviour of the C 
implementation to be "right", if both implementations differ.

As a single data point, the reason why the difference was found in this case 
was differing behaviour in PyPy (which uses only the Python implementation). It 
was only later found to be a problem on the CPython side.

Changing the behaviour of the C implementation would certainly break a lot more 
code than changing the Python implementation.

--

___
Python tracker 

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



[issue42179] Clarify chaining exceptions in tutorial/errors.rst

2020-10-28 Thread Vladimir Ryabtsev


New submission from Vladimir Ryabtsev :

A new section has been added to the page as a result of 
https://bugs.python.org/issue37826. The change: 
https://github.com/python/cpython/commit/dcfe111eb5602333135b8776996332a8dcf59392

The wording it uses (in the beginning of section 8.5), defines chaining as 
setting __cause__ attribute in an exception, and later states that "Exception 
chaining happens automatically when an exception is raised inside an exception 
handler or finally section". This may lead the reader to a wrong idea that 
re-raising an exception without "from" in "except" and "finally" automatically 
sets __cause__. In reality it sets only __context__ attribute, which is similar 
concept to __cause__, but work a bit differently, as explained in 
library/exceptions.rst. I suggest to mention that difference and provide a link 
to the main article.

--
assignee: docs@python
components: Documentation
messages: 379823
nosy: Vladimir Ryabtsev, docs@python
priority: normal
severity: normal
status: open
title: Clarify chaining exceptions in tutorial/errors.rst
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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-28 Thread Tal Einat


Tal Einat  added the comment:

After spending quite a while setting up my dev machine for (hopefully) reliable 
benchmarking, I can say with a high level of certainty that the latest PR 
(GH-22904, commit fe9e9d9c1f1c5f98c797d19e2214d1413701f6de) runs stringbench.py 
significantly faster than the master branch (commit 
fb5db7ec58624cab0797b4050735be865d380823). See attached results.

I've also run the zipf-distributed random string benchmarks provided by Dennis, 
with a slight addition of `random.seed(1)` in the do_timings function. Those 
show significant, consistent improvements on needles of length over 100, but 
not on shorter needles. The results are also found in the attached file.


My conclusion is that the current two-way implementation is certainly better 
for needles of length over 100, but for shorter needles the situation is still 
unclear.


System details:
Dell XPS 9560
Intel i7-7700HQ
Ubuntu 20.04

Steps taken to prepare system for performance tuning:
* Enable CPU isolation for two physical cores
* Disable Intel p-state driver
* Disable turbo-boost
* Run `pyperf system tune`
* Run benchmarks with CPU pinning

--
nosy: +taleinat
Added file: 
https://bugs.python.org/file49545/twoway-benchmark-results-2020-10-28.txt

___
Python tracker 

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



[issue38413] Remove or change "Multithreading" section

2020-10-28 Thread Vladimir Ryabtsev

Vladimir Ryabtsev  added the comment:

Also the footnote requires some minor corrections (formatting and style). I 
suggest the following wording:

To get loadable extension support, your Python must be compiled with 
``-–enable-loadable-sqlite-extensions`` option in ``PYTHON_CONFIGURE_OPTS``.

I believe otherwise it is basically not clear what is said here.

--

___
Python tracker 

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



[issue38413] Remove or change "Multithreading" section

2020-10-28 Thread Vladimir Ryabtsev


Vladimir Ryabtsev  added the comment:

May by I was wrong above and it uses system's Sqlite... But anyway it does not 
cancel the fact that this section contradicts to another one.

--

___
Python tracker 

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



[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue28494.

I concur with Gregory. What we can do -- improve the documentation.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> is_zipfile false positives

___
Python tracker 

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



[issue38413] Remove or change "Multithreading" section

2020-10-28 Thread Vladimir Ryabtsev


Vladimir Ryabtsev  added the comment:

I see no point in researching the version of sqlite, since Python does not 
allow user to specify it, you just use the compiled version that comes with 
Python distribution.

10 years now to the commit that introduced that piece of text: 
https://github.com/python/cpython/commit/c34d76cdc3212615f9a3c2c4b1c542592372b5f8

Let's just remove it, what it says is simply not true.

--

___
Python tracker 

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



[issue35286] wrong result for difflib.SequenceMatcher

2020-10-28 Thread Boris Yang


Change by Boris Yang :


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



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2020-10-28 Thread Ma Lin


Ma Lin  added the comment:

I modify lzma module to use different growth factors, see attached picture 
different_factors.png

1.5x should be the growth factor of _PyBytesWriter under Windows.

So if change _PyBytesWriter to use memory blocks, maybe there will be no 
performance improvement.

Over allocate factor of _PyBytesWriter:

# ifdef MS_WINDOWS
# define OVERALLOCATE_FACTOR 2
# else
# define OVERALLOCATE_FACTOR 4
# endif

(I'm using Windows 10)

--
Added file: https://bugs.python.org/file49544/different_factors.png

___
Python tracker 

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



[issue42172] Typo in test library for test_socket.py

2020-10-28 Thread Akashkumar D Khunt


Change by Akashkumar D Khunt :


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

___
Python tracker 

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