[issue41035] zipfile.Path does not work properly with zip archives where paths start with /

2020-06-20 Thread sorrow


sorrow  added the comment:

>It seems you may have discovered a use-case that violates that expectation, a 
>case where `/a.txt` is identical to `a.txt`.

The thing is: it's not.

>Can you tell me more about your use-case and why zipp.Path/zipfile.Path should 
>support it?

I received a .zip file and zipfile.Path in my code didn't work with it. I did 
some testing and discovered that id does not work properly with these archives. 
It cannot list the contents of such archive.

>Is this behavior a result of a real-world example

Yes, it is.

>(please share details about the origin)

I can't. First, the origin of this archive is not totally clear to me (and I do 
not want to investigate). And second, I'm under NDA.

I provided minimal example where archive created with zipfile.ZipFile itself 
reproduces this behaviour. Just prerpend all paths with / an it does not work.

--

___
Python tracker 

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



[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-20 Thread paul j3


Change by paul j3 :


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



[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-20 Thread paul j3


paul j3  added the comment:

It is an old unresolved issue (which resurfaced a few months ago)

https://bugs.python.org/issue9625
argparse: Problem with defaults for variable nargs when using choices

--
resolution:  -> duplicate

___
Python tracker 

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



[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-20 Thread paul j3


paul j3  added the comment:

The error is raised in ._get_values with this section:

# when nargs='*' on a positional, if there were no command-line
# args, use the default if it is anything other than None
elif (not arg_strings and action.nargs == ZERO_OR_MORE and
  not action.option_strings):
if action.default is not None:
value = action.default
else:
value = arg_strings
self._check_value(action, value)

An empty 'arg_strings' satisfies the nargs='*', so 'value' is set to that, and 
passed to _check_value.

We could avoid this by setting the default to one of the valid choices, e.g. 
'a'.  But then the attribute would be that string, not a list with that string.

I suspect this issue has come up before, since I don't this code has been 
changed in a long time.

--

___
Python tracker 

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



[issue40939] Remove the old parser

2020-06-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +20197
pull_request: https://github.com/python/cpython/pull/21025

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread miss-islington


miss-islington  added the comment:


New changeset 71bb921829c33c30b2e111e18948df8c2b6731e4 by Lysandros Nikolaou in 
branch '3.9':
[3.9] bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar 
(GH-21020) (GH-21024)
https://github.com/python/cpython/commit/71bb921829c33c30b2e111e18948df8c2b6731e4


--
nosy: +miss-islington

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20196
pull_request: https://github.com/python/cpython/pull/21024

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6c4e0bd974f2895d42b63d9d004587e74b286c88 by Lysandros Nikolaou in 
branch 'master':
bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar 
(GH-21020)
https://github.com/python/cpython/commit/6c4e0bd974f2895d42b63d9d004587e74b286c88


--

___
Python tracker 

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



[issue40939] Remove the old parser

2020-06-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d301d9473e9a9b78d6e6678e9fe5ef66d46084e1 by Lysandros Nikolaou in 
branch '3.9':
[3.9] bpo-40939: Deprecate the PyParser_SimpleParse* functions (GH-21012)
https://github.com/python/cpython/commit/d301d9473e9a9b78d6e6678e9fe5ef66d46084e1


--

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

See also test_carloverre() in test_descr.py. I don't recall exactly what this 
was about, but that test is definitely relevant.

--

___
Python tracker 

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



[issue39783] Optimize construction of Path from other Paths by just returning the same object?

2020-06-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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



[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2020-06-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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

___
Python tracker 

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



[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2020-06-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue33927] Allow json.tool to have identical infile and outfile

2020-06-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
components: +Library (Lib)
versions: +Python 3.10, 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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +20195
pull_request: https://github.com/python/cpython/pull/21023

___
Python tracker 

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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +20194
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/21022

___
Python tracker 

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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, the backports have to be done manually, since the 3.8 parser and the 3.10 
parser don't overlap, and 3.9 has both versions...

--

___
Python tracker 

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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Guido van Rossum


Change by Guido van Rossum :


--
status: closed -> open

___
Python tracker 

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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm fixing it -- can you verify? I have no easy way to test this. DO you think 
we should also add a note to the docs that this was broken in 3.8.0-3?

--

___
Python tracker 

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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +20193
pull_request: https://github.com/python/cpython/pull/21021

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-20 Thread Steve Stagg


Steve Stagg  added the comment:

Fix was here:

a75e730075 bpo-40294: Fix _asyncio when module is loaded/unloaded multiple 
times (GH-19542)

Backport commit was:
6b0ca0aeab04d7b7b54086248ca9d5e70f770f2f

>From my end, the issue seems to be resovled on tag v.3.8.3

--

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-20 Thread Steve Stagg


Steve Stagg  added the comment:

I was able to reproduce, follows is the raw LLDB output, I don't think this 
fails on master, will try some bisecting:

* thread #1, name = 'runtest', stop reason = signal SIGSEGV: invalid address 
(fault address: 0x0)
frame #0: 0x77079ae7 
_asyncio.cpython-38d-x86_64-linux-gnu.so`PyInit__asyncio [inlined] 
_Py_INCREF(op=0x) at object.h:459:18
   456  static inline void _Py_INCREF(PyObject *op)
   457  {
   458  _Py_INC_REFTOTAL;
-> 459  op->ob_refcnt++;
   460  }
   461  
   462  #define Py_INCREF(op) _Py_INCREF(_PyObject_CAST(op))
(lldb) bt
* thread #1, name = 'runtest', stop reason = signal SIGSEGV: invalid address 
(fault address: 0x0)
  * frame #0: 0x77079ae7 
_asyncio.cpython-38d-x86_64-linux-gnu.so`PyInit__asyncio [inlined] 
_Py_INCREF(op=0x) at object.h:459:18
frame #1: 0x77079ad6 
_asyncio.cpython-38d-x86_64-linux-gnu.so`PyInit__asyncio at 
_asynciomodule.c:3405
frame #2: 0x55720766 
runtest`_PyImport_LoadDynamicModuleWithSpec(spec=0x76e33780, 
fp=) at importdl.c:164:9
frame #3: 0x5571e471 
runtest`_imp_create_dynamic_impl(module=, spec=0x76e33780, 
file=) at import.c:2220:11
frame #4: 0x5571e60b 
runtest`_imp_create_dynamic(module=0x776ec830, args=0x76e336f8, 
nargs=1) at import.c.h:330:20
frame #5: 0x55645fbe 
runtest`cfunction_vectorcall_FASTCALL(func=0x77753050, 
args=0x76e336f8, nargsf=, kwnames=0x) at 
methodobject.c:421:24
frame #6: 0x556042ca 
runtest`PyVectorcall_Call(callable=0x77753050, tuple=, 
kwargs=) at call.c:199:24
frame #7: 0x55604771 runtest`PyCFunction_Call(func=, 
args=, kwargs=) at call.c:774:12
frame #8: 0x556eabf0 
runtest`do_call_core(tstate=0x5593f3c0, func=0x77753050, 
callargs=0x76e336e0, kwdict=0x76e20ad0) at ceval.c:5007:9
frame #9: 0x556f8897 
runtest`_PyEval_EvalFrameDefault(f=0x559fa330, throwflag=) 
at ceval.c:3559:22
frame #10: 0x556ec25a runtest`PyEval_EvalFrameEx(f=, 
throwflag=) at ceval.c:741:12
frame #11: 0x556ecd40 
runtest`_PyEval_EvalCodeWithName(_co=0x77725860, globals=, 
locals=, args=, argcount=2, 
kwnames=0x, kwargs=0x776bf5b0, kwcount=0, kwstep=1, 
defs=0x, defcount=0, kwdefs=0x, 
closure=0x, name=0x7792fdd0, 
qualname=0x7792fdd0) at ceval.c:4298:14
frame #12: 0x55601dbd 
runtest`_PyFunction_Vectorcall(func=, stack=, 
nargsf=, kwnames=) at call.c:435:12
frame #13: 0x556eb811 runtest`call_function [inlined] 
_PyObject_Vectorcall(kwnames=0x, nargsf=9223372036854775810, 
args=0x776bf5a0, callable=0x77763b90) at abstract.h:127:11
frame #14: 0x556eb79f 
runtest`call_function(tstate=0x5593f3c0, pp_stack=0x7fff79a0, 
oparg=, kwnames=0x) at ceval.c:4987
frame #15: 0x556f834c 
runtest`_PyEval_EvalFrameDefault(f=0x776bf410, throwflag=) 
at ceval.c:3469:23
frame #16: 0x556ec25a runtest`PyEval_EvalFrameEx(f=, 
throwflag=) at ceval.c:741:12
frame #17: 0x5560134e 
runtest`function_code_fastcall(co=, args=0x77fa63a0, 
nargs=2, globals=) at call.c:283:14
frame #18: 0x55601eb6 
runtest`_PyFunction_Vectorcall(func=, stack=, 
nargsf=, kwnames=) at call.c:410:20
frame #19: 0x556eb811 runtest`call_function [inlined] 
_PyObject_Vectorcall(kwnames=0x, nargsf=9223372036854775810, 
args=0x77fa6390, callable=0x776eaa50) at abstract.h:127:11
frame #20: 0x556eb79f 
runtest`call_function(tstate=0x5593f3c0, pp_stack=0x7fff7b80, 
oparg=, kwnames=0x) at ceval.c:4987
frame #21: 0x556f8296 
runtest`_PyEval_EvalFrameDefault(f=0x77fa6210, throwflag=) 
at ceval.c:3486:23
frame #22: 0x556ec25a runtest`PyEval_EvalFrameEx(f=, 
throwflag=) at ceval.c:741:12
frame #23: 0x5560134e 
runtest`function_code_fastcall(co=, args=0x55a18ef8, 
nargs=1, globals=) at call.c:283:14
frame #24: 0x55601eb6 
runtest`_PyFunction_Vectorcall(func=, stack=, 
nargsf=, kwnames=) at call.c:410:20
frame #25: 0x556eb811 runtest`call_function [inlined] 
_PyObject_Vectorcall(kwnames=0x, nargsf=9223372036854775809, 
args=0x55a18ef0, callable=0x777624b0) at abstract.h:127:11
frame #26: 0x556eb79f 
runtest`call_function(tstate=0x5593f3c0, pp_stack=0x7fff7d68, 
oparg=, kwnames=0x) at ceval.c:4987
frame #27: 0x556f83d4 
runtest`_PyEval_EvalFrameDefault(f=0x55a18d70, throwflag=) 
at ceval.c:3500:19
frame #28: 0x556ec25a runtest`PyEval_EvalFrameEx(f=, 
throwflag=) at 

[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Thanks for the report, Steve. I've now opened a PR that should fix this.

--

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
assignee:  -> lys.nikolaou

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-20 Thread Steve Stagg


Steve Stagg  added the comment:

This appears to have been  introduced in 13915a3100 bpo-36356: Fix memory leak 
in _asynciomodule.c (GH-16598).

Cannot reproduce on master

--

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

On it.

--

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum, pablogsal

___
Python tracker 

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



[issue41053] open() fails to read app exec links

2020-06-20 Thread Kagami Sascha Rosylight


Kagami Sascha Rosylight  added the comment:

It seems libuv and pwsh decided to detect and read them just as symlinks:

https://github.com/libuv/libuv/pull/2812
https://github.com/PowerShell/PowerShell/pull/10331

Could Python do the same?

--

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread miss-islington


miss-islington  added the comment:


New changeset 3ccb96c9782480e5ce646a4a130569fb92f2965d by Gregory P. Smith in 
branch 'master':
bpo-41056: Use the fildes converter for fd to please Coverity. (GH-21011)
https://github.com/python/cpython/commit/3ccb96c9782480e5ce646a4a130569fb92f2965d


--

___
Python tracker 

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



[issue41005] Permission denied: 'xdg-settings' when executing 'jupyter notebook' from command line

2020-06-20 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Can you give more information about your issue here. This part of the code was 
written like this on purpose as the comment says:


# OS X can use below Unix support (but we prefer using the OS X
# specific stuff)


We have to be sure that there is a bug here before changing the code, that 
changing the code will definitely fix the issue and that it won't create others.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Steve Stagg


Steve Stagg  added the comment:

Appears to have been introduced by:

bpo-40334: Produce better error messages on invalid targets (GH-20106) 
 01ece63d42b830df106948db0aefa6c1ba24416a

--

___
Python tracker 

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



[issue41060] `with a as b` segfault in new peg parser

2020-06-20 Thread Steve Stagg

New submission from Steve Stagg :

Hi

Fuzzing found the following:

$ ./python/bin/python3
Python 3.10.0a0 (heads/master:eb0d5c38de, Jun 20 2020, 21:35:36) 
[Clang 10.0.0 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> with a as b
fish: “./python/bin/python3” terminated by signal SIGSEGV (Address boundary 
error)

with stacktrace:
* thread #1, name = 'run', stop reason = signal SIGSEGV: invalid address (fault 
address: 0x20)
  * frame #0: 0x55a08feb run`with_item_rule at parser.c:15382:20
frame #1: 0x55a08e96 run`with_item_rule(p=0x778b9e40) at 
parser.c:4330
frame #2: 0x559d22e9 run`compound_stmt_rule at parser.c:17930:21
frame #3: 0x559d227c run`compound_stmt_rule at parser.c:4139
frame #4: 0x559d1a64 run`compound_stmt_rule(p=) at 
parser.c:1931
frame #5: 0x559d016c run`statements_rule at parser.c:1230:18
frame #6: 0x559d00fb run`statements_rule at parser.c:16156
frame #7: 0x559cff4d run`statements_rule(p=) at 
parser.c:1189
frame #8: 0x559cb2bc run`_PyPegen_parse at parser.c:722:18
frame #9: 0x559cb28d run`_PyPegen_parse(p=0x778b9e40) at 
parser.c:24688
frame #10: 0x559c5349 run`_PyPegen_run_parser(p=0x778b9e40) 
at pegen.c:1083:17
frame #11: 0x559c6458 
run`_PyPegen_run_parser_from_string(str=, 
start_rule=, filename_ob=0x7788db30, flags=, 
arena=) at pegen.c:1201:14
frame #12: 0x555eea84 
run`PyPegen_ASTFromStringObject(str="with'lZ'', globals=0x7788d940, 
locals=0x7788d940, flags=0x) at pythonrun.c:1029:11
frame #14: 0x555a8202 
run`PyRun_SimpleStringFlags(command="with'lZ'', 
argv=) at run.c:19:3
frame #16: 0x77c35002 libc.so.6`__libc_start_main + 242
frame #17: 0x5559568e run`_start + 46

This appears to be similar to: https://bugs.python.org/issue40903, where 
GET_INVALID_TARGET is being called with an Attribute Node, which returns None, 
and this result is passed, unchecked into `PyPegen_get_expr_name`

--
components: Interpreter Core
messages: 371964
nosy: stestagg
priority: normal
severity: normal
status: open
title: `with a as b` segfault in new peg parser
type: crash
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



[issue41053] open() fails to read app exec links

2020-06-20 Thread Eryk Sun


Eryk Sun  added the comment:

By design, appexec links (i.e. app execution aliases) cannot be followed 
automatically. There is no handler for them in the kernel. WinAPI CreateFileW 
fails with ERROR_CANT_ACCESS_FILE (1920), and the underlying NT status value is 
STATUS_IO_REPARSE_TAG_NOT_HANDLED (0xC279). 

Since 3.8, os.stat handles ERROR_CANT_ACCESS_FILE in all cases by trying to 
return the result for the reparse point instead. This at least allows getting 
the st_file_attributes and st_reparse_tag values. For example:

>>> s = os.stat(sys.executable)
>>> s.st_file_attributes & stat.FILE_ATTRIBUTE_REPARSE_POINT
1024
>>> s.st_reparse_tag == stat.IO_REPARSE_TAG_APPEXECLINK
True 

CreateProcessW follows app-exec links manually by reading the reparse point. 
But it's not that simple. The link target under "%ProgramFiles%\WindowsApps" 
isn't unconditionally executable by standard users. In other words, unless a 
particular condition is met, trying to execute the target file fails with 
access denied. Execute access depends on a conditional access-control entry 
(conditional ACEs are supported in the kernel since Windows 8) that grants 
access if the user's access token contains a "WIN://SYSAPPID" attribute that 
identifies the package. Here's the SDDL definition of this ACE for the app 
distribution of Python 3.9:

(XA;ID;0x1200a9;;;BU;(WIN://SYSAPPID Contains 
"PYTHONSOFTWAREFOUNDATION.PYTHON.3.9_QBZ5N2KFRA8P0")

"XA" is an access-allowed callback (conditional) ACE
"ID" means the ACE is inherited from the parent directory
"BU" is the security principal BUILTIN\Users (local group)
Access Mask 0x1200a9:
FILE_GENERIC_READ | FILE_GENERIC_EXECUTE:
SYNCHRONIZE
READ_CONTROL
FILE_READ_ATTRIBUTES
FILE_EXECUTE
FILE_READ_EA
FILE_READ_DATA

If the app is installed for the user, CreateProcessW handles the access denied 
result by creating and impersonating a custom access token to execute the app, 
which includes the required WIN://SYSAPPID security attribute. You can attach a 
debugger to see the security attributes added to the app token:

0:003> !token

[...]

Security Attributes Information:
 00 Attribute Name: WIN://SYSAPPID
Value Type  : TOKEN_SECURITY_ATTRIBUTE_TYPE_STRING
Value[0]: 
PythonSoftwareFoundation.Python.3.9_3.9.179.0_x64__qbz5n2kfra8p0
Value[1]: Python
Value[2]: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0

[...]

--
nosy: +eryksun

___
Python tracker 

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



[issue41059] Large number of Coverity reports for parser.c

2020-06-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

Good catch!

Are all the coverity complaints about this kind of code?

if (_res == NULL && PyErr_Occurred()) {
...
}

(Mostly for Pablo and Lysandros:) This comes from emit_action(). It is preceded 
by a line of the form

_res = ;

Most of the time the action is a function call, so this looks like

_res = ;

But occasionally the action is just pulling a named item from the alternative 
that was just recognized, and those variables are generally known to be 
non-NULL (because otherwise the alternative would fail).

There seem to be a whole bunch of actions of the form {  }. A typical 
example:

else_block[asdl_seq*]: 'else' ':' b=block { b }


We could probably recognize actions that take the form of a single variable and 
suppress the error check for the result.

However, there's a wrinkle. Sometimes a variable may legitimately be NULL when 
an alternative is recognized! This could occur if the name refers to an 
optional item. I even found an example:

| 'class' a=NAME b=['(' z=[arguments] ')' { z }] ':' c=block {

Look closely at the part starting with b=:

 b=['(' z=[arguments] ')' { z }]

In the sub-rule we see z=[arguments] and the action is { z } so it is possible 
that we reach the `_res = z` part while z is NULL.  In my copy of parser.c 
(current master) this is in _tmp_69_rule().

IMO this makes it difficult to omit the error check in exactly the right 
situations. Moreover, isn't it the job of the compiler to optimize code so we 
don't have to? The code generator is complex enough as it is; I would prefer 
not to have to complexificate it just so Coverity won't complain about 
unreachable code (no matter how right it is!).

I know nothing about Coverity any more. Is it possible to exempt this giant 
generated file from warnings about unreachable code?

--

___
Python tracker 

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



[issue41035] zipfile.Path does not work properly with zip archives where paths start with /

2020-06-20 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thanks sorrow for filing a report.

I primarily developed this functionality. As I did, I found the 'zip' format to 
be under-specified, so I used real-world examples as models to infer a spec.

It seems you may have discovered a use-case that violates that expectation, a 
case where `/a.txt` is identical to `a.txt`.

My instinct is that `zipfile.Path` should support 99% of real-world use-cases 
and that other use-cases may not be supported or may require additional 
consideration (wrappers, subclasses) to support.

Can you tell me more about your use-case and why zipp.Path/zipfile.Path should 
support it? Is this behavior a result of a real-world example (please share 
details about the origin) or contrived?

--

___
Python tracker 

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



[issue40065] py39: remove deprecation note for xml.etree.cElementTree

2020-06-20 Thread Ido Michael


Ido Michael  added the comment:

Thanks Tal.

Yes, I also got the impression we want to clean this, sorry Christian.

Please let me know how to follow up on this.

--

___
Python tracker 

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



[issue19670] SimpleCookie Generates Non-RFC6265-Compliant Cookies

2020-06-20 Thread Ido Michael


Ido Michael  added the comment:

Opened a PR:
GH-21017

The documentation in the internal functions was helpful.
Should I also add it once decided on the format in here? 
Doc/library/http.cookies.rst:55

--

___
Python tracker 

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



[issue19670] SimpleCookie Generates Non-RFC6265-Compliant Cookies

2020-06-20 Thread Ido Michael


Change by Ido Michael :


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

___
Python tracker 

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



[issue40939] Remove the old parser

2020-06-20 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20190
pull_request: https://github.com/python/cpython/pull/21016

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread Christian Heimes


Christian Heimes  added the comment:

I figured out how to run coverity scan builds again. It turned out the tool 
chain doesn't like GCC 10. clang 10 works, though.

By the way I'm using login with Github.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue41059] Large number of Coverity reports for parser.c

2020-06-20 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +pablogsal

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20189
pull_request: https://github.com/python/cpython/pull/21015

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread miss-islington


miss-islington  added the comment:


New changeset eb0d5c38de7f970d8cd8524f4163d831c7720f51 by Gregory P. Smith in 
branch 'master':
bpo-41056: Fix a NULL pointer dereference on MemoryError within the ssl module. 
(GH-21009)
https://github.com/python/cpython/commit/eb0d5c38de7f970d8cd8524f4163d831c7720f51


--
nosy: +miss-islington

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20188
pull_request: https://github.com/python/cpython/pull/21014

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +20187
pull_request: https://github.com/python/cpython/pull/21013

___
Python tracker 

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



[issue41059] Large number of Coverity reports for parser.c

2020-06-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
components: +Interpreter Core

___
Python tracker 

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



[issue41059] Large number of Coverity reports for parser.c

2020-06-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :

Here's an example:

*** CID 1464688:  Control flow issues  (DEADCODE)
/Parser/parser.c: 24243 in _tmp_147_rule()
24237 &&
24238 (z = disjunction_rule(p))  // disjunction
24239 )
24240 {
24241 D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s 
succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
24242 _res = z;
>>> CID 1464688:  Control flow issues  (DEADCODE)
>>> Execution cannot reach the expression "PyErr_Occurred()" inside this 
>>> statement: "if (_res == NULL && PyErr_O...".
24243 if (_res == NULL && PyErr_Occurred()) {
24244 p->error_indicator = 1;
24245 D(p->level--);
24246 return NULL;
24247 }
24248 goto done;


A lot of them are of that form, which seems harmless if they are true - it 
means a compiler may deduce the same thing and omit code generation for an 
impossible to trigger error block.  OTOH this could just be a weakness in the 
scanner.  (i don't know how to silence it via markers in the code, but i assume 
it is possible)

You'll need to login to Coverity to see the full report.   
https://scan.coverity.com/projects/python?tab=overview.
(it has been ages since i've logged in, they appear to support Github logins 
now.  yay.)

As the parser.c code is new for 3.9, I'm marking this as deferred blocker.  We 
should pay closer attention to the reports and update the parser generator code 
to generate code that passes analysis cleanly before we exit the beta phase.

--
assignee: gvanrossum
messages: 371956
nosy: gregory.p.smith, gvanrossum, lys.nikolaou, p-ganssle
priority: deferred blocker
severity: normal
stage: needs patch
status: open
title: Large number of Coverity reports for parser.c
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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

those were the three in the email (20 of 106), i need to figure out how to 
login to coverity again to see the rest.

--

___
Python tracker 

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



[issue40939] Remove the old parser

2020-06-20 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20186
pull_request: https://github.com/python/cpython/pull/21012

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +20185
pull_request: https://github.com/python/cpython/pull/21011

___
Python tracker 

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



[issue41057] Division error

2020-06-20 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Further to what Mark said, I'm afraid you are mistaken when you thought that 
"the result was correct" on R. R cheats by not printing the full precision of 
the number, they just stop printing digits, giving a false impression of 
accuracy. You can prove this for yourself:

> 0.4 + 8/100
[1] 0.48
> (0.4 + 8/100) == 0.48
[1] FALSE

So even though the printed result *looks* like 0.48, it actually isn't. If you 
investigate carefully, you will probably find that the number R calculates is 
the same as Python.

And the same as Javascript:

js> 0.4 + 8/100
0.48004

and pretty much every programming language that uses 64-bit floats.


BTW, this is a FAQ:

https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate

There are a ton of other resources on the web explaining this, since it occurs 
virtually everywhere, in every language with fixed-precision floating point 
numbers. For example:

https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

https://randomascii.wordpress.com/2012/05/20/thats-not-normalthe-performance-of-odd-floats/

https://randomascii.wordpress.com/2012/04/05/floating-point-complexities/

--
nosy: +steven.daprano

___
Python tracker 

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



[issue40939] Remove the old parser

2020-06-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 314858e2763e76e77029ea0b691d749c32939087 by Lysandros Nikolaou in 
branch 'master':
bpo-40939: Remove the old parser (Part 2) (GH-21005)
https://github.com/python/cpython/commit/314858e2763e76e77029ea0b691d749c32939087


--

___
Python tracker 

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



[issue41058] pdb reads source files using the locale encoding

2020-06-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue41035] zipfile.Path does not work properly with zip archives where paths start with /

2020-06-20 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +alanmcintyre, serhiy.storchaka, twouters

___
Python tracker 

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



[issue41057] Division error

2020-06-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

This isn't a bug in Python; it's a consequence of the 
what-you-see-is-not-what-you-get nature of binary floating-point.

The behaviour is explained in the tutorial, here: 
https://docs.python.org/3/tutorial/floatingpoint.html

--
nosy: +mark.dickinson
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



[issue41035] zipfile.Path does not work properly with zip archives where paths start with /

2020-06-20 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +jaraco

___
Python tracker 

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



[issue41044] Pegen: double trailing comma on optional+sequence rules at python generator

2020-06-20 Thread miss-islington


miss-islington  added the comment:


New changeset 98621817504add1e985e2526614921bbe0d24fb6 by Miss Islington (bot) 
in branch '3.9':
bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
https://github.com/python/cpython/commit/98621817504add1e985e2526614921bbe0d24fb6


--

___
Python tracker 

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



[issue41058] pdb reads source files using the locale encoding

2020-06-20 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

find_function() in pdb uses the locale encoding for reading source files. It 
should use the encoding specified by the coding cookie or UTF-8 if it is not 
specified.

--
components: Library (Lib)
messages: 371950
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: pdb reads source files using the locale encoding
type: behavior
versions: Python 3.10, 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



[issue41044] Pegen: double trailing comma on optional+sequence rules at python generator

2020-06-20 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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Stefan Behnel

Stefan Behnel  added the comment:

I wasn't sure which is better – solve it or leave it. But it seems a) easy to 
adapt to on user side, and b) solvable in CPython in a way that allows code 
that wants to adapt to work across 3.8.x versions. Only code that does not get 
adapted would risk failure in existing 3.8.x versions, and benefit from a fix 
in future 3.8.x releases.

So, yeah, I think we should fix it then.

--
status: open -> closed

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +20183
pull_request: https://github.com/python/cpython/pull/21009

___
Python tracker 

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



[issue41057] Division error

2020-06-20 Thread Fenn Ehk


New submission from Fenn Ehk :

When performing some basic calculations, the result is wrong.
0.4 + 8/100
Out[43]: 0.48004

0.3 + 8/100
Out[44]: 0.38

I thought it could be processor related and tried the same operation with R, 
but the result was correct. So I tried it on some online repls:
https://repl.it/languages/python3
https://www.learnpython.org/en/Basic_Operators

And the bug is there, it seems to exist in 3.7.6 and 3.8.3 (and probably all 
versions in between
Other examples of the error:
0.3 + 8/100
Out[50]: 0.38

0.4 + 8/100
Out[51]: 0.48004

0.4 + a
Out[52]: 0.48004

0.4 + 9/100
Out[53]: 0.49

0.7 + 9/100
Out[54]: 0.7899

0.7 + 10/100
Out[55]: 0.7999

0.7 + 10/100
Out[56]: 0.7999

0.7 + 11/100
Out[57]: 0.8099

0.7 + 12/100
Out[58]: 0.82

0.8 + 8/100
Out[59]: 0.88

0.8 + 9/100
Out[60]: 0.89

0.6 + 9/100
Out[61]: 0.69

0.7 + 9/100
Out[62]: 0.7899

--
components: Interpreter Core
messages: 371948
nosy: Fenn Ehk
priority: normal
severity: normal
status: open
title: Division error
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue41044] Pegen: double trailing comma on optional+sequence rules at python generator

2020-06-20 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +20182
pull_request: https://github.com/python/cpython/pull/21008

___
Python tracker 

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



[issue41044] Pegen: double trailing comma on optional+sequence rules at python generator

2020-06-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 55460ee6dc9a4f16bd68d6b6be3a8398c7d4a596 by Batuhan Taskaya in 
branch 'master':
bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
https://github.com/python/cpython/commit/55460ee6dc9a4f16bd68d6b6be3a8398c7d4a596


--
nosy: +pablogsal

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue41056] minor NULL pointer and sign issues reported by Coverity

2020-06-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :


*** CID 1464693:  Null pointer dereferences  (REVERSE_INULL)
/Modules/_zoneinfo.c: 1625 in parse_abbr()
1619 ptr++;
1620 }
1621 str_end = ptr;
1622 }
1623 
1624 *abbr = PyUnicode_FromStringAndSize(str_start, str_end - 
str_start);
>>> CID 1464693:  Null pointer dereferences  (REVERSE_INULL)
>>> Null-checking "abbr" suggests that it may be null, but it has already 
>>> been dereferenced on all paths leading to the check.
1625 if (abbr == NULL) {
1626 return -1;
1627 }
1628 
1629 return ptr - p;
1630 }




*** CID 1464687:  Null pointer dereferences  (FORWARD_NULL)
/Modules/_ssl/debughelpers.c: 138 in _PySSL_keylog_callback()
132  * critical debug helper.
133  */
134 if (lock == NULL) {
135 lock = PyThread_allocate_lock();
136 if (lock == NULL) {
137 PyErr_SetString(PyExc_MemoryError, "Unable to allocate 
lock");
>>> CID 1464687:  Null pointer dereferences  (FORWARD_NULL)
>>> Passing null pointer "_obj->exc_type" to "PyErr_Fetch", which 
>>> dereferences it.
138 PyErr_Fetch(_obj->exc_type, _obj->exc_value,
139 _obj->exc_tb);
140 return;
141 }
142 }
143 



*** CID 1464684:  Integer handling issues  (NEGATIVE_RETURNS)
/Modules/clinic/posixmodule.c.h: 6813 in os_fpathconf()
6807 if (fd == -1 && PyErr_Occurred()) {
6808 goto exit;
6809 }
6810 if (!conv_path_confname(args[1], )) {
6811 goto exit;
6812 }
>>> CID 1464684:  Integer handling issues  (NEGATIVE_RETURNS)
>>> "fd" is passed to a parameter that cannot be negative.
6813 _return_value = os_fpathconf_impl(module, fd, name);
6814 if ((_return_value == -1) && PyErr_Occurred()) {
6815 goto exit;
6816 }
6817 return_value = PyLong_FromLong(_return_value);
6818

--
assignee: gregory.p.smith
messages: 371946
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: minor NULL pointer and sign issues reported by Coverity
type: crash
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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-20 Thread miss-islington


miss-islington  added the comment:


New changeset c9f83c173b0cc62d6fcdc363e9ab05f6664ff8f3 by Miss Islington (bot) 
in branch '3.9':
bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970)
https://github.com/python/cpython/commit/c9f83c173b0cc62d6fcdc363e9ab05f6664ff8f3


--

___
Python tracker 

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



[issue41055] Remove outdated tests for tp_print

2020-06-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue41055] Remove outdated tests for tp_print

2020-06-20 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There are ancient tests for printing some basic types: str (actually a mix of 
Python 2 str and unicode), list, tuple, bool, set, deque, defaultdict. They are 
essentially tests for the tp_print slot. But since the tp_print slot is no 
longer used, they are virtually repeat tests for str or repr. These tests are 
outdated and no longer serve the initial purpose. To avoid confusion it is 
worth to remove them.

--
components: Tests
messages: 371944
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Remove outdated tests for tp_print
type: enhancement
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



[issue40939] Remove the old parser

2020-06-20 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20179
pull_request: https://github.com/python/cpython/pull/21005

___
Python tracker 

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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

But it's a bug, right? The intention for sure is that the cf_feature_version 
field is only used when the PyCF_ONLY_AST flags is set in cf_flags, per the 
docs you cite as [3]. Why wouldn't it be possible to fix that?

--
status: closed -> open

___
Python tracker 

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



[issue41054] Simplify resource compilation on Windows

2020-06-20 Thread Nikita Nemkin


Change by Nikita Nemkin :


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

___
Python tracker 

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



[issue40939] Remove the old parser

2020-06-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

You can delete symbol.py -- it has no use now that the old parser is gone.

We should probably also update the regeneration targets in the Makefile. (At 
least review them.)

--

___
Python tracker 

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



[issue41054] Simplify resource compilation on Windows

2020-06-20 Thread Nikita Nemkin


New submission from Nikita Nemkin :

Every Windows project has a custom target (included from pyproject.props) that 
generates a header with definitions for resource files.

Those definitions (PYTHON_DLL_NAME and FIELD3) can be passed directly to 
resource compiler.

Another definition (MS_DLL_ID) doesn't need to be a resource at all. It was 
used in the past to initialize PyWin_DLLVersionString in dl_nt.c, but that code 
is now dead.

--
components: Windows
messages: 371941
nosy: nnemkin, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Simplify resource compilation on Windows
type: enhancement
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



[issue40939] Remove the old parser

2020-06-20 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I'm currently testing a commit that removes all these files on my fork, before 
I push it upstream. A question that I'm not 100% sure about is if we can 
already remove the symbol module. I guess it's okay since it got deprecated in 
3.9 (bpo-40759) and the old parser is also out, but just to make sure.

--

___
Python tracker 

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



[issue41053] open() fails to read app exec links

2020-06-20 Thread Kagami Sascha Rosylight


New submission from Kagami Sascha Rosylight :

After installing Python from Microsoft Store, this fails:

```
>>> open('C:\\Users\\Kagami\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\python.exe')
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument: 
'C:\\Users\\Kagami\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\python.exe'
```

This causes virtualenv to fail on it:

```
INFO: Traceback (most recent call last):
INFO:   File 
"C:/Users/Kagami/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/9a6d8fc/mozjs\third_party\python\virtualenv\virtualenv.py",
 line 2349, in 
INFO: main()
INFO:   File 
"C:/Users/Kagami/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/9a6d8fc/mozjs\third_party\python\virtualenv\virtualenv.py",
 line 703, in main
INFO: create_environment(home_dir,
INFO:   File 
"C:/Users/Kagami/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/9a6d8fc/mozjs\third_party\python\virtualenv\virtualenv.py",
 line 925, in create_environment
INFO: py_executable = os.path.abspath(install_python(
INFO:   File 
"C:/Users/Kagami/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/9a6d8fc/mozjs\third_party\python\virtualenv\virtualenv.py",
 line 1239, in install_python
INFO: shutil.copyfile(executable, py_executable)
INFO:   File "C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\lib\shutil.py",
 line 261, in copyfile
INFO: with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
INFO: OSError: [Errno 22] Invalid argument: 
'C:\\Users\\Kagami\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\python.exe'
```

--
components: Windows
messages: 371939
nosy: paul.moore, saschanaz, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: open() fails to read app exec links
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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2020-06-20 Thread Stefan Behnel


Stefan Behnel  added the comment:

I was made aware [1] that the addition of the "cf_feature_version" field broke 
the backwards compatibility of the "PyRun_StringFlags()" function [2]. Unlike 
what the docs of "PyCompilerFlags" [3] suggest, the new field is not ignored 
there but must now be set in order to enable the syntax features of the running 
Python version.

Background: A Cython user was trying "exec()" on code with f-strings in Py3.8 
and got a SyntaxError, because "cf_feature_version" had not been initialised.

I can see two types of existing code being affected:

1) applications or modules that execute user provided Python code (as in the 
bug report) for which users expect the syntax of the currently running Python 
runtime to be available.

2) code that used to work in Py3.6/7 using the available Python syntax features 
and now runs into newly introduced syntax restrictions in Py3.8, such as 
f-strings no longer being available.

Since Py3.8 has been out for a while with this change, and there were 
apparently little complaints in addition to issue 37072, should we just update 
the documentation of "PyCompilerFlags" and "PyRun_StringFlags()" to mention the 
change there?

[1] https://github.com/cython/cython/issues/3695
[2] https://docs.python.org/3/c-api/veryhigh.html#c.PyRun_StringFlags
[3] https://docs.python.org/3/c-api/veryhigh.html#c.PyCompilerFlags

--
nosy: +scoder

___
Python tracker 

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



[issue41052] Opt out serialization/deserialization for heap type

2020-06-20 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue41052] Opt out serialization/deserialization for heap type

2020-06-20 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +shihai1991

___
Python tracker 

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



[issue41052] Opt out serialization/deserialization for heap type

2020-06-20 Thread Dong-hee Na


New submission from Dong-hee Na :

See https://bugs.python.org/issue40077#msg371813

We noticed that heap type has different behavior about 
serialization/deserialization.

Basically it can occur the regression issues.

Two things needed.
1. opt out serialization/deserialization for converted modules.
2. Add unit tests to check whether their serialization is blocked.
3. If the module is already ported to 3.9 backport patch is needed.
Long term
- Add the object.reduce() and/or update pickle can be smarter

--
components: C API
messages: 371937
nosy: corona10, vstinner
priority: normal
severity: normal
status: open
title: Opt out serialization/deserialization for heap type
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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-20 Thread miss-islington


miss-islington  added the comment:


New changeset 861efc6e8fe7f030b1e193989b13287b31385939 by Lysandros Nikolaou in 
branch 'master':
bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970)
https://github.com/python/cpython/commit/861efc6e8fe7f030b1e193989b13287b31385939


--
nosy: +miss-islington

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20176
pull_request: https://github.com/python/cpython/pull/21001

___
Python tracker 

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



[issue41024] doc: Explicitly mention use of 'enum.Enum' as a valid container for 'choices' argument of 'argparse.ArgumentParser.add_argument'

2020-06-20 Thread miss-islington

miss-islington  added the comment:


New changeset 344c2a75c1c13de781962a3f80552e66a4c89024 by Vincent Férotin in 
branch 'master':
bpo-41024: doc: Explicitly mention use of 'enum.Enum' as a valid container for 
'… (GH-20964)
https://github.com/python/cpython/commit/344c2a75c1c13de781962a3f80552e66a4c89024


--
nosy: +miss-islington

___
Python tracker 

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



[issue41051] Flush file after warning is written

2020-06-20 Thread Manuel Jacob


Change by Manuel Jacob :


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

___
Python tracker 

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



[issue41039] Simplify python3.dll build

2020-06-20 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +eryksun

___
Python tracker 

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



[issue41051] Flush file after warning is written

2020-06-20 Thread Manuel Jacob

New submission from Manuel Jacob :

Calling warnings.warn() will write to a file, but not flush it. On Python 3.9+, 
it won’t usually be a problem because the file is most likely stderr, which is 
always line-buffered. However, on older Python versions or if a different file 
is used, the current behavior unnecessarily delays the output of the warning. 
This is especially problematic if the warning is about buffering behavior 
itself, as e.g. caused by `open('/tmp/test', 'wb', buffering=1)`.

--
messages: 371934
nosy: mjacob
priority: normal
severity: normal
status: open
title: Flush file after warning is written

___
Python tracker 

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



[issue41050] class multiprocessing.Value calls set_start_method

2020-06-20 Thread Kernel Plevitsky


New submission from Kernel Plevitsky :

I'm not sure if this is a bug or my carelessness.

I cannot call set_start_method () if multiprocessing.Value() is declared in the 
class above than "if __name__ ==" __main__ ""

The documentation for Value did not describe this.

I have attached a code playing this moment.

Sorry for my English

--
assignee: docs@python
components: Documentation
files: test.py
messages: 371933
nosy: Kernel Plevitsky, docs@python
priority: normal
severity: normal
status: open
title: class multiprocessing.Value calls set_start_method
type: behavior
versions: Python 3.5, Python 3.8
Added file: https://bugs.python.org/file49256/test.py

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-20 Thread Stefan Behnel


Stefan Behnel  added the comment:

I ran into this, too. I agree that the "hackcheck" loop on heap types is 
probably wrong.

https://github.com/python/cpython/blob/04fc4f2a46b2fd083639deb872c3a3037fdb47d6/Objects/typeobject.c#L5947-L5977

It was written at a time (Py2.3?) when (practically) only Python implemented 
types were heap types, not extension types. I think what it tried to do was to 
find the builtin base type of a Python type, and check that no-one played 
tricks on the C slot functions of that C implemented type. With extension types 
implemented as heap types, having a different slot function in there is a 
perfectly valid thing.

I'll call in a couple of people since I'm also not sure how to fix the 
"hackcheck".

I'll also leave Py3.7 in the list of affected Python versions since we still 
have a short week before its final non-secfix-release. :)

--
nosy: +gvanrossum, petr.viktorin, scoder
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



[issue41049] Document pointer comparison in PyObject_RichCompareBool()

2020-06-20 Thread tamuhey


tamuhey  added the comment:

> Hmm, I missed it.  There is already a note in the link you provided

I've read the comment before posting this issue.
But I think there should be the following info:

1. example (float("nan"))
2. the result is inconsistent with PyObject_RichCompare

--

___
Python tracker 

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



[issue41049] Document pointer comparison in PyObject_RichCompareBool()

2020-06-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Hmm, I missed it.  There is already a note in the link you provided"

"""Note If o1 and o2 are the same object, PyObject_RichCompareBool() will 
always return 1 for Py_EQ and 0 for Py_NE."""

--
resolution:  -> out of date
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



[issue40939] Remove the old parser

2020-06-20 Thread Nikita Nemkin


Nikita Nemkin  added the comment:

Shouldn't the following files be deleted too?

Include/bitset.h
Include/grammar.h
Include/graminit.h
Include/parsetok.h
Include/node.h
Python/graminit.c
Parser/node.c

Also declarations:
PyNode_Compile in Include/compile.h
PyParser_SimpleParse* in Include/pythonrun.h

And PyParser_ASTFrom* API need new implementations.

--
nosy: +nnemkin

___
Python tracker 

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



[issue41049] Document pointer comparison in PyObject_RichCompareBool()

2020-06-20 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue41048] read_mime_types() should read the rule file using UTF-8, not the locale encoding

2020-06-20 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Change by Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
:


--
keywords: +patch
nosy: +thatiparthy
nosy_count: 2.0 -> 3.0
pull_requests: +20173
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20998

___
Python tracker 

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



[issue41049] Document pointer comparison in PyObject_RichCompareBool()

2020-06-20 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
title: PyObject_RichCompareBool(nan, nan, eq) can be True -> Document pointer 
comparison in PyObject_RichCompareBool()

___
Python tracker 

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



[issue41049] PyObject_RichCompareBool(nan, nan, eq) can be True

2020-06-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the report. I'll add a note to the C API docs.

--
assignee:  -> rhettinger
components: +Documentation -C API
nosy: +rhettinger
versions:  -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue41049] PyObject_RichCompareBool(nan, nan, eq) can be True

2020-06-20 Thread tamuhey


New submission from tamuhey :

Applying PyObject_RichCompareBool to two `nan`s can be true if the two nans are 
same object, i.e.

```
a = float("nan")
PyObject_RichCompareBool(a, a, Py_EQ) // True
```

I read the document 
(https://docs.python.org/3/c-api/object.html?highlight=pyobject_richcomparebool#c.PyObject_RichCompareBool)
 and understood it is intended, but there should be gentle comment to tell 
users this behaviour.

--
components: C API
messages: 371927
nosy: tamuhey
priority: normal
severity: normal
status: open
title: PyObject_RichCompareBool(nan, nan, eq) can be True
type: enhancement
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue13025] mimetypes should read the rule file using UTF-8, not the locale encoding

2020-06-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

However read_mime_types() still uses the locale encoding. See issue41048.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



  1   2   >