[issue40279] Documentation example of module init function lacks error handling

2020-04-13 Thread Stefan Behnel


New submission from Stefan Behnel :

The example in the docs that shows how to initialise an embedded module gives a 
wrong impression about error handling. Most of the functions that it calls 
return error codes, but those do not get looked at. Innocent users who copy and 
paste the example may miss some of them when adapting the code, thus ending up 
with an unsafe implementation.

The example should at least make it clear where error handling is needed.

https://docs.python.org/3/extending/extending.html#the-module-s-method-table-and-initialization-function

int
main(int argc, char *argv[])
{
wchar_t *program = Py_DecodeLocale(argv[0], NULL);
if (program == NULL) {
fprintf(stderr, "Fatal error: cannot decode argv[0]\n");
exit(1);
}

/* Add a built-in module, before Py_Initialize */
PyImport_AppendInittab("spam", PyInit_spam);

/* Pass argv[0] to the Python interpreter */
Py_SetProgramName(program);

/* Initialize the Python interpreter.  Required. */
Py_Initialize();

/* Optionally import the module; alternatively,
   import can be deferred until the embedded script
   imports it. */
PyImport_ImportModule("spam");

...

PyMem_RawFree(program);
return 0;
}

--
assignee: docs@python
components: Documentation
keywords: easy, newcomer friendly
messages: 366368
nosy: docs@python, scoder
priority: normal
severity: normal
stage: needs patch
status: open
title: Documentation example of module init function lacks error handling
type: enhancement
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



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-04-13 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 8ef875028a3644a329c87ce420a73793e315143f by Ethan Smith in branch 
'master':
bpo-39481: Make weakref and WeakSet generic (GH-19497)
https://github.com/python/cpython/commit/8ef875028a3644a329c87ce420a73793e315143f


--

___
Python tracker 

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



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-04-13 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset cecf049673da6a24435acd1a6a3b34472b323c97 by Ethan Smith in branch 
'master':
bpo-39481: Make functools.cached_property, partial, partialmethod generic 
(#19427)
https://github.com/python/cpython/commit/cecf049673da6a24435acd1a6a3b34472b323c97


--

___
Python tracker 

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



[issue40278] pathlib Path.replace raises OSError when target exists

2020-04-13 Thread Michael Selik


Michael Selik  added the comment:

The docs for ``os.replace`` says "If dst is a directory, OSError will be 
raised."  That's helpful, but the docs for ``pathlib.Path.replace`` make it 
seem like the target will be unconditionally replaced regardless of whether 
it's a file or directory.  Sure, there's the association of the two functions 
in the correspondence table in the pathlib docs, but that's easy to overlook 
when looking up ``pathlib.Path.replace``.

If nothing else, I guess this is a request to alter the docstring.

--

___
Python tracker 

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



[issue40278] pathlib Path.replace raises OSError when target exists

2020-04-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

replace under the hood uses os.replace. The docs for os.replace indicate error 
for certain scenarios where target is a directory : 
https://docs.python.org/3/library/os.html#os.replace . See also some difference 
between os.rename and os.replace : https://bugs.python.org/issue27886

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, pitrou, serhiy.storchaka, xtreak

___
Python tracker 

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



[issue40278] pathlib Path.replace raises OSError when target exists

2020-04-13 Thread Michael Selik


New submission from Michael Selik :

The pathlib module ``Path.replace(target)`` states that "If target points to an 
existing file or directory, it will be unconditionally replaced."  However, 
this does not appear to be true.  I experience an OSError ``[Errno 66] 
Directory not empty`` when attempting to ``replace`` to an existant target.

https://docs.python.org/3/library/pathlib.html#pathlib.Path.replace


I see that others on StackOverflow encounter the same issue.  The top answer 
ignores the Python documentation and recommends removing the target directory 
before replacing.

https://stackoverflow.com/questions/50355180/use-pathlib-to-destructively-rename-one-directory-to-another-existing-directory

--
messages: 366363
nosy: selik
priority: normal
severity: normal
status: open
title: pathlib Path.replace raises OSError when target exists
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



[issue39953] Let's update ssl error codes

2020-04-13 Thread miss-islington


miss-islington  added the comment:


New changeset c496e29c2bd0c29327c93174d5a40d2dc5a09402 by Miss Islington (bot) 
in branch '3.8':
closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against 
old OpenSSL. (GH-19506)
https://github.com/python/cpython/commit/c496e29c2bd0c29327c93174d5a40d2dc5a09402


--

___
Python tracker 

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



[issue40266] Failure to build _ssl module on ubuntu xenial

2020-04-13 Thread miss-islington


miss-islington  added the comment:


New changeset c496e29c2bd0c29327c93174d5a40d2dc5a09402 by Miss Islington (bot) 
in branch '3.8':
closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against 
old OpenSSL. (GH-19506)
https://github.com/python/cpython/commit/c496e29c2bd0c29327c93174d5a40d2dc5a09402


--

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-13 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 584a3cfda4d7a65ea0c1ea1ee541378bb7be46ca by Benjamin Peterson in 
branch 'master':
closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against 
old OpenSSL. (GH-19506)
https://github.com/python/cpython/commit/584a3cfda4d7a65ea0c1ea1ee541378bb7be46ca


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



[issue39953] Let's update ssl error codes

2020-04-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18859
pull_request: https://github.com/python/cpython/pull/19507

___
Python tracker 

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



[issue40266] Failure to build _ssl module on ubuntu xenial

2020-04-13 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 584a3cfda4d7a65ea0c1ea1ee541378bb7be46ca by Benjamin Peterson in 
branch 'master':
closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against 
old OpenSSL. (GH-19506)
https://github.com/python/cpython/commit/584a3cfda4d7a65ea0c1ea1ee541378bb7be46ca


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



[issue40266] Failure to build _ssl module on ubuntu xenial

2020-04-13 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-13 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

On Mon, Apr 13, 2020, at 17:54, Christian Heimes wrote:
> 
> Christian Heimes  added the comment:
> 
> Could you please give me a chance to review PRs for the SSL module? 

The original PR was open for 23 days before I merged it. I happy to here 
feedback at any point during the lifetime of a change, though.

--

___
Python tracker 

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



[issue40266] Failure to build _ssl module on ubuntu xenial

2020-04-13 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
keywords: +patch
pull_requests: +18857
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/19506

___
Python tracker 

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



[issue40277] Improve repr for _tuplegetter objects

2020-04-13 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Formerly, the accessor for named tuples were more informative:

>>> class Pt(NamedTuple):
x: int
y: int

>>> vars(Pt)['x']

>>> vars(Pt)['x'].fget
operator.itemgetter(0)

Currently, it is less informative:

>>> vars(Pt)['x']
<_collections._tuplegetter object at 0x1066a08e0>

The repr should be updated to show how the object could been created:

>>> vars(Pt)['x']
_tuplegetter(0, 'Alias for field number 0')

--
assignee: rhettinger
components: Interpreter Core
keywords: easy (C)
messages: 366357
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Improve repr for _tuplegetter objects
type: enhancement

___
Python tracker 

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



[issue40276] Make member objects inspectable.

2020-04-13 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Given:

class A:
__slots__ = ['x', 'y', 'z')

mo = vars(A)['x']

The field number should be viewable:

>>> mo.offset
0

And the __repr__ should be:

>>> mo


--
components: Interpreter Core
keywords: easy (C)
messages: 366356
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Make member objects inspectable.
type: enhancement
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



[issue39943] Meta: Clean up various issues in C internals

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

Not sure if it's related to changes made recently on this issue, but I started 
to notice these compiler warnings on Windows:



D:\a\cpython\cpython\Modules\sre_lib.h(822,21): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1058,17): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1064,17): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1134,13): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(822,21): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1058,17): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1064,17): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1134,13): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(822,21): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1058,17): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1064,17): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\sre_lib.h(1134,13): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\_sre.c(457,26): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
D:\a\cpython\cpython\Modules\_sre.c(471,26): warning C4090: 'function': 
different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

--
nosy: +vstinner

___
Python tracker 

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



[issue39321] AMD64 FreeBSD Non-Debug 3.x: out of swap space (test process killed by signal 9)

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

koobs: Any update on this swap issue?

--

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18856
pull_request: https://github.com/python/cpython/pull/19505

___
Python tracker 

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



[issue40268] Reorganize pycore_pystate.h header

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18855
pull_request: https://github.com/python/cpython/pull/19505

___
Python tracker 

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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-40241: Add pycore_interp.h header (GH-19499)

Oops, this change was for bpo-40268.

--

___
Python tracker 

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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -18854

___
Python tracker 

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



[issue40268] Reorganize pycore_pystate.h header

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

New changeset 0c13e1f96a9487e0efe63c3d3a05ff9738bd7dac by Victor Stinner in 
branch 'master':
bpo-40241: Add pycore_interp.h header (GH-19499)
https://github.com/python/cpython/commit/0c13e1f96a9487e0efe63c3d3a05ff9738bd7dac

--

___
Python tracker 

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



[issue40208] Remove deprecated symtable.SymbolTable.has_exec

2020-04-13 Thread Dong-hee Na


Dong-hee Na  added the comment:

The deletion of this symtable.SymbolTable.has_exec is now landed.
I would like to thank Batuhan and all the reviewers who have participated in 
this issue.

It's time for us to say goodbye to symtable.SymbolTable.has_exec.

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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18854
pull_request: https://github.com/python/cpython/pull/19505

___
Python tracker 

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



[issue40208] Remove deprecated symtable.SymbolTable.has_exec

2020-04-13 Thread Dong-hee Na

Dong-hee Na  added the comment:


New changeset 990ea4200f05fcd8bce3de363f4d7745ae142385 by Batuhan Taşkaya in 
branch 'master':
bpo-40208: Remove deprecated has_exec method of SymbolTable (GH-19396)
https://github.com/python/cpython/commit/990ea4200f05fcd8bce3de363f4d7745ae142385


--
nosy: +corona10

___
Python tracker 

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



[issue39380] ftplib uses latin-1 as default encoding

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

It's now fixed. Thanks Eric V. Smith for suggesting the change and thanks 
Sebastian Pedersen for the very complete implementation (with tests and new 
constructor parameters!).

The default encoding change is documented properly in the "Changes in the 
Python API" section of What's New in Python 3.9.

Hopefully, it was already possible to override the encoding in Python 3.8 and 
older by modifying FTP.encoding class attribute.

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



[issue40274] 3D plotting library doesn't occlude objects by depth/perspective (objects in the scene are printed in layers).

2020-04-13 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue39380] ftplib uses latin-1 as default encoding

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a1a0eb4a394a5ac7a8422616ce1ee4125a3ef74f by Sebastian Pedersen in 
branch 'master':
bpo-39380: Change ftplib encoding from latin-1 to utf-8 (GH-18048)
https://github.com/python/cpython/commit/a1a0eb4a394a5ac7a8422616ce1ee4125a3ef74f


--

___
Python tracker 

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



[issue32894] AST unparsing of infinity numbers

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like the fix works as expected:

>>> from __future__ import annotations
>>> def f(x: A[1e1000, 1e1000j]): pass
... 

>>> f.__annotations__
{'x': 'A[1e309, 1e309j]'}

>>> A=list
>>> eval(f.__annotations__['x'])
list[inf, infj]

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

I would be more interested by an experiment to move ob_refcnt outside PyObject 
to solve the Copy-on-Write issue, especially to measure the impact on 
performances.

--

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-13 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please give me a chance to review PRs for the SSL module? 

Python is still failing to compile with OpenSSL 1.0.2 and LibreSSL. The new 
table contains also wrong values for LibreSSL and OpenSSL 1.0.2.

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

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> gc.freeze() has a similar issue, no? This function also comes from Instagram 
> specific use case ;-)

Not really because this patch is much more impacting. gc.freeze() moves objects 
into a permanent generation making them not participate in the GC so the only 
leaks are cycle-based. With this patch immortal object will leak every strong 
reference that they have even if they don't participate in cycles (but also if 
they participate in cycles).

--

___
Python tracker 

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



[issue32894] AST unparsing of infinity numbers

2020-04-13 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 258f5179f9494189e6a80311c86981d2a88ba9d6 by Batuhan Taşkaya in 
branch 'master':
bpo-32894: Support unparsing of infinity numbers in ast_unparser.c (GH-17426)
https://github.com/python/cpython/commit/258f5179f9494189e6a80311c86981d2a88ba9d6


--
nosy: +vstinner

___
Python tracker 

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



[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

bpo-40255 proposes a concrete implementation of immortal objects: it modifies 
Py_INCREF and Py_DECREF which makes Python up to 1.17x slower.

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

The idea of immortal objects was proposed to solve the bpo-39511 problem.

I dislike immortable for different reasons. Here are some.

Gregory:
> We wound up not deploying it or pushing for it in CPython because the CPU 
> performance implications of adding a branch instruction to Py_INCREC and 
> Py_DECREF were, unsurprisingly, quite high.

Exactly. Copy-on-Write problem affects a minority of users. If PR 19474 is 
enabled by default, all users will pay the overhead even if they never call 
fork() without exec().

1.17x slower on logging_silent or unpickle_pure_python is a very expensive 
price :-(


Pablo:
> Anything that is touched by the immortal object will be leaked. This can also 
> happen in obscure ways if reference cycles are created.

gc.freeze() has a similar issue, no? This function also comes from Instagram 
specific use case ;-)


Steve:
> This isn't actually about removing immortal objects, but removing *mutable* 
> objects that would be shared between subinterpreters. Making some objects 
> immortal, such as interned strings or stateless singletons, would actually 
> benefit this work, as they could then be safely shared between 
> subinterpreters.

>From what I understood, we simply cannot share any object (mutable or not) 
>between two subinterpreters. Otherwise, we will need to put a lock on all 
>Py_INCREF/Py_DECREF operation which would kill performances of running 
>multiple interpreters in parallel. Join bpo-39511 discussion.

--
nosy: +vstinner

___
Python tracker 

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



[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue25680] Selector.select() hangs when there is nothing to select

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue40274] 3D plotting library doesn't occlude objects by depth/perspective (objects in the scene are printed in layers).

2020-04-13 Thread Brian O'Sullivan


Brian O'Sullivan  added the comment:

matplotlib yes
Will do.

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

___
Python tracker 

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



[issue40091] Crash in logging._after_at_fork_child_reinit_locks()

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

I merged my fix into master.

PR 19196 fix could be backported to 3.8, sadly I had to reject this PR since it 
introduced new problems :-( This approach (create a new lock at fork) doesn't 
work :-( So I'm not sure how to fix the issue on 3.8 without backporting the 
new _at_fork_reinit() method, but I would prefer to not backport it since I see 
it as a new feature.

--

___
Python tracker 

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



[issue40091] Crash in logging._after_at_fork_child_reinit_locks()

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


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



[issue40091] Crash in logging._after_at_fork_child_reinit_locks()

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4c3da783cffb8471303fbae3e09f3d67b31c3d06 by Victor Stinner in 
branch 'master':
bpo-40091: Fix a hang at fork in the logging module (GH-19416)
https://github.com/python/cpython/commit/4c3da783cffb8471303fbae3e09f3d67b31c3d06


--

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-04-13 Thread STINNER Victor


New submission from STINNER Victor :

test_threading.ThreadJoinOnShutdown.test_reinit_tls_after_fork() does crash on 
AIX: bpo-40068. One of the issue is that logging does crash at fork: bpo-40091. 
The strange thing is that test_threading doesn't use logging. I'm quite sure 
that logging is imported through test.support.

"import test.support" imports not less than 171... That's quite "heavy". It 
includes "heavy" modules like concurrent.futures, asyncio or multiprocessing.

It's maybe time to slice again test.support until submodules to reduce the 
number of imports to the bare minimum. For example, "import test.support" 
imports asyncio, whereas it's only used by very few tests. Maybe we should add 
"test.support.asyncioutils".

$ ./python
Python 3.9.0a5+ (heads/pycore_interp:a1ff2c5cf3, Apr 13 2020, 12:27:13) 
>>> import sys
>>> import test

>>> before=set(sys.modules)
>>> import test.support
>>> after=set(sys.modules)

>>> len(after - before)
171

>>> import pprint
>>> pprint.pprint(sorted(after - before))
['__mp_main__',
 '_asyncio',
 '_bisect',
 '_blake2',
 '_bz2',
 '_collections',
 '_compat_pickle',
 '_compression',
 '_contextvars',
 '_datetime',
 '_elementtree',
 '_functools',
 '_hashlib',
 '_heapq',
 '_lzma',
 '_opcode',
 '_operator',
 '_pickle',
 '_posixsubprocess',
 '_queue',
 '_random',
 '_sha3',
 '_sha512',
 '_socket',
 '_sre',
 '_ssl',
 '_string',
 '_struct',
 '_sysconfigdata_d_linux_x86_64-linux-gnu',
 '_weakrefset',
 'argparse',
 'array',
 'asyncio',
 'asyncio.base_events',
 'asyncio.base_futures',
 'asyncio.base_subprocess',
 'asyncio.base_tasks',
 'asyncio.constants',
 'asyncio.coroutines',
 'asyncio.events',
 'asyncio.exceptions',
 'asyncio.format_helpers',
 'asyncio.futures',
 'asyncio.locks',
 'asyncio.log',
 'asyncio.protocols',
 'asyncio.queues',
 'asyncio.runners',
 'asyncio.selector_events',
 'asyncio.sslproto',
 'asyncio.staggered',
 'asyncio.streams',
 'asyncio.subprocess',
 'asyncio.tasks',
 'asyncio.transports',
 'asyncio.trsock',
 'asyncio.unix_events',
 'base64',
 'binascii',
 'bisect',
 'bz2',
 'collections',
 'collections.abc',
 'concurrent',
 'concurrent.futures',
 'concurrent.futures._base',
 'contextlib',
 'contextvars',
 'copy',
 'copyreg',
 'datetime',
 'difflib',
 'dis',
 'email',
 'email.base64mime',
 'email.charset',
 'email.encoders',
 'email.errors',
 'email.header',
 'email.quoprimime',
 'enum',
 'errno',
 'faulthandler',
 'fnmatch',
 'functools',
 'gc',
 'gettext',
 'glob',
 'grp',
 'gzip',
 'hashlib',
 'heapq',
 'importlib',
 'importlib._bootstrap',
 'importlib._bootstrap_external',
 'importlib.abc',
 'importlib.machinery',
 'importlib.util',
 'inspect',
 'itertools',
 'keyword',
 'linecache',
 'locale',
 'logging',
 'logging.handlers',
 'lzma',
 'math',
 'multiprocessing',
 'multiprocessing.context',
 'multiprocessing.process',
 'multiprocessing.reduction',
 'nntplib',
 'opcode',
 'operator',
 'pickle',
 'platform',
 'pprint',
 'pwd',
 'pyexpat',
 'pyexpat.errors',
 'pyexpat.model',
 'queue',
 'quopri',
 'random',
 're',
 'reprlib',
 'resource',
 'select',
 'selectors',
 'shutil',
 'signal',
 'socket',
 'sre_compile',
 'sre_constants',
 'sre_parse',
 'ssl',
 'string',
 'struct',
 'subprocess',
 'sysconfig',
 'tempfile',
 'test.support',
 'test.support.testresult',
 'threading',
 'token',
 'tokenize',
 'traceback',
 'types',
 'typing',
 'typing.io',
 'typing.re',
 'unittest',
 'unittest.async_case',
 'unittest.case',
 'unittest.loader',
 'unittest.main',
 'unittest.result',
 'unittest.runner',
 'unittest.signals',
 'unittest.suite',
 'unittest.util',
 'urllib',
 'urllib.error',
 'urllib.response',
 'warnings',
 'weakref',
 'xml',
 'xml.etree',
 'xml.etree.ElementPath',
 'xml.etree.ElementTree',
 'zlib']

--
components: Tests
messages: 366337
nosy: vstinner
priority: normal
severity: normal
status: open
title: test.support has way too many imports
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



[issue40274] 3D plotting library doesn't occlude objects by depth/perspective (objects in the scene are printed in layers).

2020-04-13 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm not sure which of the libraries is the 3d plotting library you're referring 
to (maybe matplotlib?), but in any event it doesn't ship with python, so this 
isn't the appropriate bug tracker to report your issue. If it is matplotlib, 
their issue tracker is here: https://github.com/matplotlib/matplotlib/issues

Before reporting it there, you'll want to reproduce the problem with a smaller 
example.

--
nosy: +eric.smith
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-13 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

By the noticed something that looks kind of weird, not sure if it is 
intentional or not but shouldn't this be self instead of gen

static void
gen_dealloc(PyGenObject *gen)
{
PyObject *self = (PyObject *) gen;

_PyObject_GC_UNTRACK(gen);

if (gen->gi_weakreflist != NULL)
PyObject_ClearWeakRefs(self);
_PyObject_GC_TRACK(self);

--

___
Python tracker 

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



[issue40274] 3D plotting library doesn't occlude objects by depth/perspective (objects in the scene are printed in layers).

2020-04-13 Thread Brian O'Sullivan


New submission from Brian O'Sullivan :

3D plotting library doesn't occlude objects by depth/perspective.

When the figure is regenerated during the animation, each additional line and 
points is printed on top of the prior lines and points.

Bug resolution:
 - incorporate occlusions in the 3D plotting / animation library

--
components: Library (Lib)
files: hopf1.py
messages: 366334
nosy: mo-geometry
priority: normal
severity: normal
status: open
title: 3D plotting library doesn't occlude objects by depth/perspective 
(objects in the scene are printed in layers).
type: enhancement
versions: Python 3.6
Added file: https://bugs.python.org/file49060/hopf1.py

___
Python tracker 

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



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-04-13 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 25a6833f7945f14cad83509ec73954d0ad70bdb1 by Chih-Hsuan Yen in 
branch 'master':
bpo-39481: fix test_genericalias on Android (GH-19469)
https://github.com/python/cpython/commit/25a6833f7945f14cad83509ec73954d0ad70bdb1


--

___
Python tracker 

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



[issue40106] multiprocessor spawn

2020-04-13 Thread Ned Deily


Change by Ned Deily :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-13 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

@Michael.Felt can you just insert some prints between these 3 to see what is 
going on (and re-compile)

static void
gen_dealloc(PyGenObject *gen)
{
PyObject *self = (PyObject *) gen;

_PyObject_GC_UNTRACK(gen);

if (gen->gi_weakreflist != NULL)
PyObject_ClearWeakRefs(self);

_PyObject_GC_TRACK(self);


something like this should work: printf("%ld\n", _Py_AS_GC(self)->_gc_next);

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread Steve Dower


Steve Dower  added the comment:

> There is a trend right now to try to remove immortal objects (started by 
> Victor and others) like static types and transforming them to heap types.

This isn't actually about removing immortal objects, but removing *mutable* 
objects that would be shared between subinterpreters. Making some objects 
immortal, such as interned strings or stateless singletons, would actually 
benefit this work, as they could then be safely shared between subinterpreters.

But as you say, the added complexity here is starting to seem like it'll cost 
more than it's worth...

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> If it's easy to set up, it might be interesting to see if there's a 
> difference if (e.g.) all interned strings are marked as immortal, or all 
> small ints. Or type objects. Maybe set a flag during initialization and treat 
> everything created before that as immortal.

I can look into it, the main problem is that every run of the pyperformance 
test suite takes several hours, even more with --full-pgo :(  I will try to set 
up some automation for that when I have some free cycles

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks, Eddie for sharing the patch. I think this is an interesting discussion: 
for instance, in the core dev sprint at Microsoft I recall that we had a quick 
discussion about having immortal references. 

After analyzing the patch, and even assuming that we add conditional 
compilation, here are some of the things I feel uneasy about:

- Anything that is touched by the immortal object will be leaked. This can also 
happen in obscure ways
  if reference cycles are created.

- As Eddie mentions in the PR, this does not fully cover all cases as objects 
that become tracked by the GC
  after they are modified (for instance, dicts and tuples that only contain 
immutable objects). Those objects will
  still, participate in reference counting after they start to be tracked.

- As Gregory mentions, if immortal objects are handed to extension modules 
compiled with the other version of the
  macros, the reference count can be corrupted. This may break the garbage 
collector algorithm that relies on the
  the balance between strong references between objects and its reference count 
to do the calculation of the isolated cycles.
  This without mentioning that this defies the purpose of the patch in those 
cases, as a single modification of the reference 
  the count will trigger the copy of the whole memory page where the object 
lives.

- The patch modifies very core mechanics of Python for the benefit of a 
restricted set of users (as Gregory mentions): no 
  threads, POSIX and forking.

- Is not clear to me that leaking memory is the best way to solve this problem 
compared to other solutions (like having the 
  the reference count of the objects separated from them).
  objects separated from them.

There is a trend right now to try to remove immortal objects (started by Victor 
and others) like static types and transforming them to heap types. I am afraid 
that having the restriction that the interpreter and the gc needs to be aware
of immortal types can raise considerably the maintenance costs of already 
complicated pieces of the CPython VM.

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread Steve Dower


Steve Dower  added the comment:

If it's easy to set up, it might be interesting to see if there's a difference 
if (e.g.) all interned strings are marked as immortal, or all small ints. Or 
type objects. Maybe set a flag during initialization and treat everything 
created before that as immortal.

There's definitely going to be overhead, but assuming the branch is there we 
may as well use it to optimise our own operations.

--

___
Python tracker 

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread Eryk Sun


Eryk Sun  added the comment:

> You mean the CI agent is doing it? Because there's nowhere in 
> Python that should be doing it.

The ProcessParameters->DllPath value is inherited until a process in the tree 
reverts to the original search path via SetDllDirectoryW(NULL), so it can be 
any ancestor process, not just the immediate parent process.

> I'd rather not blanket change this option in the test suite (except to 
> turn it on :) ), so that code snippet probably needs to shrink down 
> into a one-liner that can go with the "-c" just for these tests.

The test could call GetDllDirectoryW [1] to save and restore the previous 
value. Unfortunately, GetDllDirectoryW returns 0 for both the default case 
(NULL) and when the working directory is disabled by setting an empty string 
(""). It would have to assume one or the other.

Otherwise if you just want a one-liner: "import ctypes; 
ctypes.windll.kernel32.SetDllDirectoryW(None)".

[1]: 
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getdlldirectoryw

--

___
Python tracker 

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



[issue35569] OSX: Enable IPV6_RECVPKTINFO

2020-04-13 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

System state


CPU: use 12 logical CPUs: 1,3,5,7,9,11,13,15,17,19,21,23
Perf event: Maximum sample rate: 1 per second
ASLR: Full randomization
Linux scheduler: Isolated CPUs (12/24): 1,3,5,7,9,11,13,15,17,19,21,23
Linux scheduler: RCU disabled on CPUs (12/24): 1,3,5,7,9,11,13,15,17,19,21,23
CPU Frequency: 0,2,4,6,8,10,12,14,16,18,20,22=min=1600 MHz, max= MHz; 
1,3,5,7,9,13,15,17,19,21,23=min=max= MHz
Turbo Boost (MSR): CPU 1,3,5,7,9,11,13,15,17,19,21,23: disabled
IRQ affinity: irqbalance service: inactive
IRQ affinity: Default IRQ affinity: CPU 0,2,4,6,8,10,12,14,16,18,20,22
IRQ affinity: IRQ affinity: IRQ 0,2=CPU 0-23; IRQ 1,3-15,17,20,22-23,28-51=CPU 
0,2,4,6,8,10,12,14,16,18,20,22

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I run the pyperformance test suite with PGO + LTO + full cpu isolation in the 
speed.python.org machine and these were the results:

+-+--+---+
| Benchmark   | master   | 
immortal_refs_patch   |
+=+==+===+
| pidigits| 289 ms   | 290 ms: 
1.01x slower (+1%)|
+-+--+---+
| pickle  | 20.2 us  | 20.3 us: 
1.01x slower (+1%)   |
+-+--+---+
| xml_etree_parse | 253 ms   | 258 ms: 
1.02x slower (+2%)|
+-+--+---+
| json_loads  | 52.0 us  | 53.1 us: 
1.02x slower (+2%)   |
+-+--+---+
| scimark_fft | 708 ms   | 723 ms: 
1.02x slower (+2%)|
+-+--+---+
| python_startup_no_site  | 7.83 ms  | 8.04 ms: 
1.03x slower (+3%)   |
+-+--+---+
| scimark_sparse_mat_mult | 9.28 ms  | 9.57 ms: 
1.03x slower (+3%)   |
+-+--+---+
| unpickle| 28.0 us  | 28.9 us: 
1.03x slower (+3%)   |
+-+--+---+
| regex_effbot| 4.70 ms  | 4.86 ms: 
1.03x slower (+3%)   |
+-+--+---+
| xml_etree_iterparse | 178 ms   | 184 ms: 
1.04x slower (+4%)|
+-+--+---+
| python_startup  | 11.5 ms  | 12.0 ms: 
1.04x slower (+4%)   |
+-+--+---+
| scimark_monte_carlo | 212 ms   | 221 ms: 
1.04x slower (+4%)|
+-+--+---+
| pathlib | 38.6 ms  | 40.5 ms: 
1.05x slower (+5%)   |
+-+--+---+
| sqlite_synth| 7.85 us  | 8.26 us: 
1.05x slower (+5%)   |
+-+--+---+
| sqlalchemy_imperative   | 62.9 ms  | 66.2 ms: 
1.05x slower (+5%)   |
+-+--+---+
| richards| 138 ms   | 145 ms: 
1.05x slower (+5%)|
+-+--+---+
| crypto_pyaes| 199 ms   | 210 ms: 
1.06x slower (+6%)|
+-+--+---+
| nbody   | 249 ms   | 265 ms: 
1.06x slower (+6%)|
+-+--+---+
| raytrace| 937 ms   | 995 ms: 
1.06x slower (+6%)|
+-+--+---+
| deltablue   | 13.4 ms  | 14.2 ms: 
1.06x slower (+6%)   |
+-+--+---+
| tornado_http| 276 ms   | 295 ms: 
1.07x slower (+7%)|
+-+--+-

[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread Steve Dower


Steve Dower  added the comment:

You mean the CI agent is doing it? Because there's nowhere in Python that 
should be doing it.

I'd rather not blanket change this option in the test suite (except to turn it 
on :) ), so that code snippet probably needs to shrink down into a one-liner 
that can go with the "-c" just for these tests.

--

___
Python tracker 

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



[issue35569] OSX: Enable IPV6_RECVPKTINFO

2020-04-13 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Added (Mac OS specific) unit tests.

--
Added file: 
https://bugs.python.org/file49059/0002-bpo-35569-Add-unit-tests.patch

___
Python tracker 

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread Eryk Sun


Eryk Sun  added the comment:

> it seems the search order we're getting for _sqlite3.dll (.pyd) is:
>
> * app directory
> * SQL server install directory (?)
> * Windows/System32
> * Windows
> * %PATH% (which is truncated at 2190 chars)

Thank you. It finally makes sense. The parent process is calling 
SetDllDirectoryW [1], which also replaces the current working directory in the 
DLL search path of child processes (inherited via the PEB 
ProcessParameters->DllPath) [2]: 

Note: The standard search order of the process will also be 
affected by calling the SetDllDirectory function in the parent
process before start of the current process.

In that case, all we have to do is restore the original search path by calling 
SetDllDirectoryW(NULL). For example:

import ctypes
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
if not kernel32.SetDllDirectoryW(None):
raise ctypes.WinError(ctypes.get_last_error())


[1]: 
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setdlldirectoryw
[2]: 
https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#alternate-search-order-for-desktop-applications

--

___
Python tracker 

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



[issue40273] mappingproxy isn't reversible

2020-04-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This seems reasonable.

+1

--
keywords: +easy (C)
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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread Steve Dower


Steve Dower  added the comment:

Okay, I've wasted enough time on this. Let's just disable the test permanently 
and say that the winmode=0 behaviour is system-specific and is not tested.

--

___
Python tracker 

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread Steve Dower


Steve Dower  added the comment:

So I collected more info, and it seems the search order we're getting for 
_sqlite3.dll (.pyd) is:

* app directory
* SQL server install directory (?)
* Windows/System32
* Windows
* %PATH% (which is truncated at 2190 chars)

And then we never look in CWD. I wonder if it's being excluded because it's 
under %TEMP%?

I can't reproduce it either with a long PATH or with it in TEMP, so there may 
be a policy setting involved. Trying again with the test not using TEMP (it 
shouldn't be using the real TEMP anyway...)

--

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-13 Thread Anthony Sottile


Anthony Sottile  added the comment:

this is still broken even with the latest patch: 
https://bugs.python.org/issue40266

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue40266] Failure to build _ssl module on ubuntu xenial

2020-04-13 Thread Anthony Sottile

Anthony Sottile  added the comment:

yes, it is still broken, now with fewer errors:

2020-04-13T15:06:34.7330649Z x86_64-linux-gnu-gcc -pthread -fPIC -Wdate-time 
-D_FORTIFY_SOURCE=2 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall -g -fstack-protector -Wformat -Werror=format-security -std=c99 -Wextra 
-Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -fvisibility=hidden -I../Include/internal 
-I../Include -IObjects -IPython -I. -I/usr/include/x86_64-linux-gnu 
-I/tmp/code/Include -I/tmp/code/build-static -c /tmp/code/Modules/_ssl.c -o 
build/temp.linux-x86_64-3.9/tmp/code/Modules/_ssl.o
2020-04-13T15:06:34.8649844Z In file included from 
/tmp/code/Modules/_ssl.c:136:0:
2020-04-13T15:06:34.8651190Z /tmp/code/Modules/_ssl_data.h:650:28: error: 
‘ERR_LIB_ASYNC’ undeclared here (not in a function)
2020-04-13T15:06:34.8651651Z  {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, 101},
2020-04-13T15:06:34.8651920Z ^
2020-04-13T15:06:34.8661090Z /tmp/code/Modules/_ssl_data.h:1510:29: error: 
‘ERR_LIB_CT’ undeclared here (not in a function)
2020-04-13T15:06:34.8661535Z  {"BASE64_DECODE_ERROR", ERR_LIB_CT, 108},
2020-04-13T15:06:34.8661802Z  ^
2020-04-13T15:06:34.8676472Z /tmp/code/Modules/_ssl_data.h:2650:24: error: 
‘ERR_LIB_KDF’ undeclared here (not in a function)
2020-04-13T15:06:34.8676957Z  {"INVALID_DIGEST", ERR_LIB_KDF, 100},
2020-04-13T15:06:34.8677361Z ^

--
status: closed -> open

___
Python tracker 

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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-13 Thread Michael Felt

Michael Felt  added the comment:

After my build I have the following:

$ ./python -m test.pythoninfo|grep -E 'CFLAGS|CC|OPT|LDFLAGS'
Objects/genobject.c:127: _PyObject_GC_TRACK: Assertion "!(((PyGC_Head
*)(op)-1)->_gc_next != 0)" failed: object already tracked by the garbage
collector
Enable tracemalloc to get the memory block allocation traceback

object address  : 30084150
object refcount : 0
object type : 20013710
object type name: generator
object repr : 

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: core initialized

Current thread 0x0001 (most recent call first):
  File "", line 1593 in _setup
  File "", line 1634 in _install
  File "", line 1189 in
_install_external_importers
ksh: 22151670 IOT/Abort trap(coredump)

See attached file for the script capture.

On 11/04/2020 15:13, Batuhan Taskaya wrote:
> Batuhan Taskaya  added the comment:
>
> I've just compiled python with (xlc 16.1.0, debug build) and can't experience 
> that compile failure, can you give a specific spot that failure happens?
>
> -bash-4.4$ ./python -m test.pythoninfo|grep -E 'CFLAGS|CC|OPT|LDFLAGS'
> sysconfig[CC]: /opt/IBM/xlc/16.1.0/bin/xlc_r
> sysconfig[CFLAGS]: -DNDEBUG -O
> sysconfig[CONFIG_ARGS]: 'CC=/opt/IBM/xlc/16.1.0/bin/xlc_r'
> sysconfig[OPT]: -DNDEBUG -O
> sysconfig[PY_CFLAGS]: -DNDEBUG -O
> sysconfig[PY_CFLAGS_NODIST]: -I./Include/internal
> sysconfig[PY_STDMODULE_CFLAGS]: -DNDEBUG -O -I./Include/internal -I. 
> -I./Include
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: https://bugs.python.org/file49058/issue40170.txt

___
Python tracker 

___Script command is started on Mon Apr 13 06:29:37 CDT 2020.
$ .kxlc16-envc166xlc16
$ echo $PATH $CC
/opt/IBM/xlc/16.1.0/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java7_64/jre/bin:/usr/java7_64/bin:/home/aixtools/bin
 xlc_r
$ updategit
Checking out files: 100% (160/160), done.
Previous HEAD position was 0003c2d... bpo-40096: Support 
__attribute__((__noreturn__)) on xlc (GH-19204)
Switched to branch 'master'
Your branch is up-to-date with 'upstream/master'.
remote: Enumerating objects: 610, done.K
remote: Counting objects: 100% (610/610), done.K
remote: Compressing objects: 100% (2/2), done.K
remote:nTotale775:(delta(608),7reused 609 (delta 608), pack-reused 165K
Receiving objects: 100% (775/775), 533.45 KiB | 0 bytes/s, done.
Resolving deltas: 100% (645/645), completed with 287 local objects.
>From https://github.com/python/cpython
   38aefc5..0c13e1f  master -> upstream/master
   8a0a500..7a41638  2.7-> upstream/2.7
   44c1cdd..0a9ec9f  3.7-> upstream/3.7
   f7b0259..ee691b0  3.8-> upstream/3.8
 * [new tag] v2.7.18rc1 -> v2.7.18rc1
>From https://github.com/python/cpython
 * branchmaster -> FETCH_HEAD
Updating 38aefc5..0c13e1f
Checking out files: 100% (195/195), done.
Fast-forward
 Doc/c-api/gcsupport.rst |  
 18 
 Doc/howto/unicode.rst   |  
  5 
 Doc/library/dis.rst |  
  6 
 Doc/library/multiprocessing.rst |  
 13 
 Doc/library/socket.rst  |  
 11 
 Doc/library/ssl.rst |  
  3 
 Doc/library/threading.rst   |  
  8 -
 Doc/whatsnew/3.9.rst|  
 28 
 Include/Python.h|  
  1 
 Include/cpython/abstract.h  |  
 10 
 Include/cpython/objimpl.h   |  
111 
 Include/cpython/pystate.h   |  
  7 
 Include/errcode.h   |  
  1 
 Include/genericaliasobject.h|  
 14 
 Include/internal/pycore_abstract.h  |  
 22 
 Include/internal/pycore_ceval.h |  
 11 
 Include/internal/pycore_gc.h|  
 69 ++
 Include/internal/pycore_interp.h|  
183 
 Include/internal/pycore_object.h|  
 11 
 Include/internal/pycore_pymem.h |  
  3 
 Include/internal/pycore_pystate.h   |  
298 -
 Include/internal/pycore_runtime.h  

[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-13 Thread Zackery Spytz


Change by Zackery Spytz :


--
versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.6

___
Python tracker 

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread Steve Dower


Steve Dower  added the comment:

> I don't understand what's going on here if %PATH% is interfering.

Yeah, as shown by the fact my fix didn't fix it :)

I'm going to try adding some more diagnostics around this to find out exactly 
where it's failing. I suspect it's a dependency, rather than the direct file.

--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-13 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 3.0 -> 4.0
pull_requests: +18853
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19502

___
Python tracker 

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



[issue40273] mappingproxy isn't reversible

2020-04-13 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue40273] mappingproxy isn't reversible

2020-04-13 Thread jack1142


Change by jack1142 :


--
type:  -> enhancement

___
Python tracker 

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



[issue40273] mappingproxy isn't reversible

2020-04-13 Thread jack1142


New submission from jack1142 :

Starting in version 3.8, dicts are reversible so it would make sense if mapping 
proxy were also reversible. Especially that `reversed(proxied_dict.keys())` 
does work.

--
messages: 366315
nosy: jack1142
priority: normal
severity: normal
status: open
title: mappingproxy isn't reversible
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



[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2020-04-13 Thread Ray Donnelly


Ray Donnelly  added the comment:

I took the liberty of filing this: https://bugs.python.org/issue40263

Cheers.

--
nosy: +Ray Donnelly

___
Python tracker 

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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-13 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Oh, looks like the problem is --without-computed-gotos, I just tried 2 times 
one is with --without-computed-gotos and one is not. I could successfully 
reproduce the problem with it. I'll continue triaging.

--

___
Python tracker 

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



[issue40263] ValueError exception on _winapi.WaitForMultipleObjects

2020-04-13 Thread Ray Donnelly


Ray Donnelly  added the comment:

https://github.com/python/cpython/pull/19501

--

___
Python tracker 

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



[issue40263] ValueError exception on _winapi.WaitForMultipleObjects

2020-04-13 Thread Ray Donnelly


Change by Ray Donnelly :


--
nosy: +Ray.Donnelly
nosy_count: 5.0 -> 6.0
pull_requests: +18852
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19501

___
Python tracker 

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



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-04-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

No, I did not check other changes. These two just looked too suspicious.

--

___
Python tracker 

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



[issue40271] Allow shell like paths in

2020-04-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

How would you work with a file in the "~" directory?

Python is a programming language. It provides you builtin blocks which you can 
combine to get the desired behavior. If you what "~" at the start of the path 
be expanded to your home directory, you call os.path.expanduser() explicitly. 
If you want it mean the literal "~" directory, you do not call 
os.path.expanduser(). Calling it implicitly would break existing code, require 
you to use ugly workarounds if you don't want to expand "~", and introduce 
possible security issues.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-04-13 Thread Ethan Smith


Ethan Smith  added the comment:

Hm, yeah it appears my methodology was too loose. Thank you for catching
these. I will go through and test the rest (if you haven't yet) later today
and make a PR to revert anything that needs it. Thanks! (and sorry)

On Mon, Apr 13, 2020 at 2:12 AM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> I tested the following example:
>
> import ipaddress, mmap
>
> x: ipaddress.IPv4Network[int]
> y: mmap.mmap[int]
>
> MyPy produces errors:
>
> t.py:4: error: "IPv4Network" expects no type arguments, but 1 given
> t.py:5: error: "mmap" expects no type arguments, but 1 given
>
> This is because mmap and IPv4Network are not generic types in typeshed.
> _BaseNetwork and _mmap are generic types, but IPv4Network and mmap are
> normal classes. The former are implementation detail of typeshed. _mmap
> does not exist in the stdlib, and _BaseNetwork in typeshed and the stdlib
> are different things.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2020-04-13 Thread Fran Boon


Fran Boon  added the comment:

What is happening with this bug?
I am amazed that nearly 4 years on it doesn't seem to have been resolved.
The issue took me a fairly long time to debug the cause of, but once known the 
issue seems relatively simple to resolve & there are a couple of Pull Requests 
which fix the issue. This is my first time looking into the core of Python's 
own development (which I guess is a testament to how well this normally works), 
so I may be being naive, but what is the blocker here? Is there anything I can 
do to help? Test/Review existing PRs? (They both look good to me)
Create a new PR? (Seems unnecessary)

I really am genuinely keen to help resolve this for at least Python 3.7+ (Am 
aware that 3.6 is security fixes only)

--
nosy: +Fran Boon

___
Python tracker 

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread Eryk Sun


Eryk Sun  added the comment:

> But I'm not sure why that is getting loaded earlier than the 
> current directory. Is that the behaviour we went for here?

I don't understand what's going on here if %PATH% is interfering. The current 
directory (%__CD__%) should be checked before %PATH% with the standard DLL 
search order for desktop applcations. That's what I've observed in practice and 
how it's documented [1]:

SafeDllSearchMode enabled:

1. %__APPDIR__%
2. %SystemRoot%\System32
3. %SystemRoot%\System
4. %SystemRoot%
5. %__CD__%
6. %PATH%

SafeDllSearchMode disabled:

1. %__APPDIR__%
2. %__CD__%
3. %SystemRoot%\System32
4. %SystemRoot%\System
5. %SystemRoot%
6. %PATH%

[1]: 
https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#search-order-for-desktop-applications

--

___
Python tracker 

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



[issue40271] Allow shell like paths in

2020-04-13 Thread Gavin D'souza


Gavin D'souza  added the comment:

Thank you @xtreak, I'm aware of "os.path.expanduser" and have used it 
extensively; I created this issue if we could do something about handling this 
internally in zipfile too.

--

___
Python tracker 

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



[issue40112] AIX: xlc - default path changed and no longer recognized

2020-04-13 Thread Michael Felt


Michael Felt  added the comment:

Thank you!

On 09/04/2020 17:33, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
> I backported the fix to 3.8 to fix AIX 3.8 buildbots.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-13 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +18851
pull_request: https://github.com/python/cpython/pull/19500

___
Python tracker 

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



[issue40176] unterminated string literal tokenization error messages could be better

2020-04-13 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Fair point. I changed error messages to what you suggested

>>> (300) * 6 + ca(e, 2 +"dsadsa)
  File "", line 1
(300) * 6 + ca(e, 2 +"dsadsa)
 ^
SyntaxError: unterminated string literal

>>> (300) * 6 + ca(e, 2 +'dsadsa)
  File "", line 1
(300) * 6 + ca(e, 2 +'dsadsa)
 ^
SyntaxError: unterminated string literal


>>> (300) * 6 + ca(e, 2 +"""dsadsa
... 
  File "", line 1
(300) * 6 + ca(e, 2 +"""dsadsa
 ^
SyntaxError: unterminated triple-quoted string literal

--

___
Python tracker 

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



[issue40271] Allow shell like paths in

2020-04-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

You can use os.path.expanduser to expand tilde. Other os functions don't do it 
implicitly.

>>> import os
>>> os.path.exists("~/stuff")
False
>>> os.path.exists(os.path.expanduser("~/stuff"))
True

--
nosy: +xtreak

___
Python tracker 

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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0c13e1f96a9487e0efe63c3d3a05ff9738bd7dac by Victor Stinner in 
branch 'master':
bpo-40241: Add pycore_interp.h header (GH-19499)
https://github.com/python/cpython/commit/0c13e1f96a9487e0efe63c3d3a05ff9738bd7dac


--

___
Python tracker 

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



[issue40263] ValueError exception on _winapi.WaitForMultipleObjects

2020-04-13 Thread Steve Dower


Steve Dower  added the comment:

(Created from issue26903)

Yeah, that looks like a reasonable fix :)

--
title: Follow on bug from https://bugs.python.org/issue26903 (ValueError 
exception on _winapi.WaitForMultipleObjects) -> ValueError exception on 
_winapi.WaitForMultipleObjects

___
Python tracker 

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



[issue40272] ModuleNotFoundEror thrown by system python while accessing it specifically via venv python

2020-04-13 Thread Gavin D'souza


New submission from Gavin D'souza :

I have a tool that works as a wrapper over a web framework which in turn 
utilizes a virtualenv environment. So every app to be installed for a project 
is installed in it's own env folder. 

Recently, the virtualenv has been breaking throwing 'ModuleNotFoundError's 
however this issue only persists in macOS. The applications installed in each 
project's env are editable installs. The ModuleNotFoundError's are raised by 
the global python install which is all the more confusing as the commands are 
specifically executing using absolute paths in the env python and should be in 
the env site-packages. Even after successful env installs, activating the env 
and simply typing "import frappe" throws a ModuleNotFoundError. 

Reference commands executed by the wrapper program are like
./env/bin/python -m install -q -U -e ./apps/frappe

have also tried absolute paths but faced the same issue. However, this issue 
doesn't persist while using pyenv on macOS. Linux systems work fine too.

--
components: macOS
messages: 366299
nosy: gavin, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: ModuleNotFoundEror thrown by system python while accessing it 
specifically via venv python
type: behavior
versions: Python 2.7, Python 3.6, 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



[issue40269] Inconsistent complex behavior with (-1j)

2020-04-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

Another related issue is #23229, where Guido says (in msg233963):

> BTW I don't want repr() of a complex number to use the
> complex(..., ...) notation -- it's too verbose.

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-13 Thread Steve Dower


Change by Steve Dower :


--
nosy: +steve.dower

___
Python tracker 

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



[issue40271] Allow shell like paths in

2020-04-13 Thread Gavin D'souza


New submission from Gavin D'souza :

Related library: zipfile

Since zipfile allows relative dotted paths too, should shell-like paths, 
specifically with ~ (tilde) be allowed too?

This feels like unexpected behaviour and confusing for users as method 
"is_zipfile" returns False in case path doesn't exist as well. So, 
zipfile.is_zipfile("~/incorrect/path/to/zip") as well as 
zipfile.is_zipfile("~/path/to/zip") will return False

--
components: Library (Lib)
messages: 366297
nosy: gavin
priority: normal
severity: normal
status: open
title: Allow shell like paths in
type: behavior
versions: Python 2.7, 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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18850
pull_request: https://github.com/python/cpython/pull/19499

___
Python tracker 

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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-13 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, this issue should now be closed. It was easier than expected ;-)

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



[issue40260] modulefinder traceback regression starting on Windows

2020-04-13 Thread Steve Dower


Steve Dower  added the comment:

(+Windows tag)

These should use io.open_code() these days anyway, which always opens in 'rb'.

Could you make that change?

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue40269] Inconsistent complex behavior with (-1j)

2020-04-13 Thread Mark Dickinson


Change by Mark Dickinson :


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

___
Python tracker 

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



[issue40267] Error message differs when an expression is in an fstring

2020-04-13 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



  1   2   >