[issue31904] Python should support VxWorks RTOS

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b2d0c66e881301ed8908da3cb41bbf253c449b0c by pxinwr in branch 
'master':
bpo-31904: Fix fifo test cases for VxWorks (GH-20254)
https://github.com/python/cpython/commit/b2d0c66e881301ed8908da3cb41bbf253c449b0c


--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2020-12-01 Thread Julien Palard


Julien Palard  added the comment:

I'll try to track this closely, the drop of `make suspicious` has been merged 
in master, but not backported yet, one week ago.

Up to today, no commit has introduced suspicious warnings (0 false positive, 0 
false negative).

I think I'll soon backport the PR, if no one objects, because the current 
situation is a bit risky: some PR could get merged to master but fail the tests 
during the backport.

--

___
Python tracker 

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



[issue42519] [C API] Upgrade the C API in extension modules

2020-12-01 Thread STINNER Victor


New submission from STINNER Victor :

Python has around 118 extension modules. Most of them are quite old and still 
use the old way to write C extensions. I created this issue as a placeholder to 
modernize the code using my new tool:
https://github.com/pythoncapi/upgrade_pythoncapi

For example, replace PyMem_MALLOC() with PyMem_Malloc(), since PyMem_MALLOC() 
is a deprecated alias.

--
components: C API
messages: 382220
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Upgrade the C API in extension modules
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



[issue42519] [C API] Upgrade the C API in extension modules

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42519] [C API] Upgrade the C API in extension modules

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0 by Victor Stinner in 
branch 'master':
bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586)
https://github.com/python/cpython/commit/00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0


--

___
Python tracker 

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



[issue42519] [C API] Upgrade the C API in extension modules

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22461
pull_request: https://github.com/python/cpython/pull/23587

___
Python tracker 

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



[issue24506] make fails with gcc 4.9 due to fatal warning of unused variable and empty macro in Parser/pgen.c

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

This macro is no longer in the codebase.

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



[issue23946] Invalid timestamps reported by os.stat() when Windows FILETIME structures are mistakenly reset.

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

The code of posixmodule.c looks very different now. It this issue still 
relevant?

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue42519] [C API] Upgrade the C API in extension modules

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 32bd68c839adb7b42af12366ab0892303115d1d1 by Victor Stinner in 
branch 'master':
bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)
https://github.com/python/cpython/commit/32bd68c839adb7b42af12366ab0892303115d1d1


--

___
Python tracker 

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



[issue24429] msvcrt error when embedded

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

This is a python 2.7-only issue.

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



[issue21195] None float format: incomplete documentation

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

Python 2.7-only issue.

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



[issue15104] Unclear language in __main__ description

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

Fixed for Python 3, too late for Python 2.

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

___
Python tracker 

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



[issue42508] macOS IDLE with Tk 8.6.10 in 3.9.1rc1 universal2 installer fails smoke test

2020-12-01 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> patch review

___
Python tracker 

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



[issue42520] add_dll_directory only accepts absolute paths

2020-12-01 Thread Antony Lee


New submission from Antony Lee :

os.add_dll_directory appears to only accept absolute paths, inheriting this 
restriction from AddDllDirectory.  That's absolutely fine, but could perhaps be 
mentioned in the docs 
(https://docs.python.org/3/library/os.html#os.add_dll_directory), especially 
considering that the docs do mention the parallel with `sys.path`, which *does* 
support relative paths.

--
assignee: docs@python
components: Documentation
messages: 382228
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: add_dll_directory only accepts absolute paths
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



[issue31990] Pickling deadlocks in thread with python -m

2020-12-01 Thread Sara Kelley


Sara Kelley  added the comment:

>python3 -m testqueuepickle3.py
>It hangs.

I see this hang too.

If you only specify the module name it does not hang.
python3 -m testqueuepickle3

--
nosy: +serakeri

___
Python tracker 

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



[issue22376] urllib2.urlopen().read().splitlines() opening a directory in a FTP server randomly returns incorrect result

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

2.7 backport is no longer possible.

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



[issue19570] distutils' Command.ensure_dirname fails on Unicode

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

Python 2-only issue.

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



[issue22455] idna/punycode give wrong results on narrow builds

2020-12-01 Thread Irit Katriel


Change by Irit Katriel :


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



[issue17852] Built-in module _io can lose data from buffered files in reference cycles

2020-12-01 Thread miss-islington


miss-islington  added the comment:


New changeset 4a44f53aa85c9400471ab084bc8fd8169065fc41 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-17852: Doc: Fix the tutorial about closing files (GH-23135) (GH-23527)
https://github.com/python/cpython/commit/4a44f53aa85c9400471ab084bc8fd8169065fc41


--

___
Python tracker 

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



[issue22187] commands.mkarg() buggy in East Asian locales

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

Python 2 only issue.

--
nosy: +iritkatriel
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue41837] Upgrade installers to OpenSSL 1.1.1h

2020-12-01 Thread Christian Heimes


Christian Heimes  added the comment:

You may want to hold off until next week:

https://mta.openssl.org/pipermail/openssl-announce/2020-December/000186.html

OpenSSL 1.1.i is a security-fix release. The highest severity issue fixed in 
this release is HIGH.

--

___
Python tracker 

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



[issue42518] Error Message

2020-12-01 Thread Kshitish


Kshitish  added the comment:

Please do not talk like behave properly. I know here I am wrong but it is not 
way to talk to some one like that. I respect your knowledge but maintain your 
language. Okay! 

I send you new file with full research. Please check it out and thank you

--
resolution: not a bug -> 
status: closed -> open
type: behavior -> security
Added file: https://bugs.python.org/file49641/main.py

___
Python tracker 

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



[issue42521] Debug (-d) mode not working in 3.9

2020-12-01 Thread anthony shaw


New submission from anthony shaw :

I noticed since the new parser implementation, the debug mode in the tokeniser 
is no longer working.

This is the case for 3.9.0 and also 3.9.1rc1. Running python3.9 with a simple 
application like this:

 # Demo application
 def my_function():
   proceed

Does not output anything

> python3.9 -d ~/PycharmProjects/cpython-book-samples/13/test_tokens.py

> 
Produces no output

Whereas python3.10 (the latest alpha) outputs the expected results

--
messages: 382236
nosy: anthony shaw, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Debug (-d) mode not working in 3.9
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



[issue42518] Error Message

2020-12-01 Thread Christian Heimes


Change by Christian Heimes :


--
resolution:  -> not a bug
status: open -> closed
type: security -> behavior

___
Python tracker 

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



[issue42522] [C API] Add Py_Borrow() function: call Py_XDECREF() and return the object

2020-12-01 Thread STINNER Victor


New submission from STINNER Victor :

I'm working on a script to migrate old C extension modules to the latest flavor 
of the Python C API:
https://github.com/pythoncapi/upgrade_pythoncapi

I would like to replace frame->f_code with PyFrame_GetCode(frame). The problem 
is that frame->f_code is a borrowed reference, whereas PyFrame_GetCode() 
returns a strong reference. Having a Py_Borrow() function would help to 
automate migration to PyFrame_GetCode():

static inline PyObject* Py_Borrow(PyObject *obj)
{
Py_XDECREF(obj);
return obj;
}

So frame->f_code can be replaced with Py_Borrow(PyFrame_GetCode(frame)).

Py_Borrow() is similar to Py_XDECREF() but can be used as an expression:

PyObject *code = Py_Borrow(PyFrame_GetCode(frame));

Py_Borrow() is the opposite of Py_XNewRef(). For example, 
Py_Borrow(Py_XNewRef(obj)) leaves the reference count unchanged (+1 and then 
-1).


My pratical problem is that it's not easy not add Py_XDECREF() call when 
converting C code to the new C API.

Example 1:

PyObject *code = frame->f_code;

This one is easy and can be written as:

PyObject *code = PyFrame_GetCode(frame); Py_XDECREF(code);


Example 2:

func(frame->f_code);

This one is more tricky. For example, the following code using a macro is wrong:

#define Py_BORROW(obj) (Py_XDECREF(obj), obj)
func(Py_BORROW(PyFrame_GetCode(frame->f_code)));

since it calls PyFrame_GetCode() twice when proceed by the C preprocessor and 
so leaks a reference:

func(Py_XDECREF(PyFrame_GetCode(frame->f_code)), 
PyFrame_GetCode(frame->f_code));


Attached PR implements Py_Borrow() function as a static inline function.

--
components: C API
messages: 382237
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Add Py_Borrow() function: call Py_XDECREF() and return the object
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



[issue41626] port shebang of tools from python2 to python3

2020-12-01 Thread hai shi


hai shi  added the comment:

I create PR23581 to remove the inner Tools' shebang.

But I am not remove Tools/ssl/make_ssl_data.py, Tools/gdb/libpython.py in 
PR23581.
* To make_ssl_data.py, I guess Christian may give us some guide.
* libpython.py will be installed in kinds of OS, some OS will use or maintain 
python2.7 for a long times. so I perfer like to keep it.

--

___
Python tracker 

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



[issue41626] port shebang of tools from python2 to python3

2020-12-01 Thread hai shi


Change by hai shi :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue42522] [C API] Add Py_Borrow() function: call Py_XDECREF() and return the object

2020-12-01 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue42519] [C API] Upgrade the C API in extension modules

2020-12-01 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue42522] [C API] Add Py_Borrow() function: call Py_XDECREF() and return the object

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue31990] Pickling deadlocks in thread with python -m

2020-12-01 Thread Werner Smidt


Werner Smidt  added the comment:

Sorry for being lacking in providing some OS info.  b

Opensuse Tumbleweed, Linux kernel 5.8.10-1, Intel system

I cannot explain why, but relating to Sara's answer, if you remove the .join() 
statements at the end, you get the following exception:

/usr/bin/python3: Error while finding module specification for 
'testqueuepickle3.py' (ModuleNotFoundError: __path__ attribute not found on 
'testqueuepickle3' while trying to find 'testqueuepickle3.py')
mynamedtuple(param1='INSIDE thread', param2='namedtuple')


So I guess that it gets stuck after an exception is thrown?  If I call it 
Sara's way, there is no exception thrown. 

Sorry, I know this is a very specific case, but I thank you both for taking the 
time to contribute :-)

--

___
Python tracker 

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



[issue17454] ld_so_aix not used when linking c++ (scipy)

2020-12-01 Thread Irit Katriel


Change by Irit Katriel :


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



[issue4724] setting f_exc_traceback aborts in debug builds

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

2.7-only issue.

--
nosy: +iritkatriel
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue41626] port shebang of tools from python2 to python3

2020-12-01 Thread Christian Heimes


Christian Heimes  added the comment:

make_ssl_data.py is an internal tool that generates internal header files. It's 
rarely used. The tool is not bound to any Python version, too. Feel free to 
change the shebang or leave it as it is. I don't care.

--

___
Python tracker 

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



[issue42518] Error Message

2020-12-01 Thread Kshitish


Kshitish  added the comment:

Look tell why you close this
 

In the argument:
print (5 + 2 == 7 and 10 <= 1232 != 10 ^ 100 <= 100)

10 <= 1232 != 10 ^ 100 <= 100

10 <= 1232 is true
10 ^ 100 <= 100 is false

These two argument compares by != 
So, this statement must be true. 

Overall: print (5 + 2 == 7 and 10 <= 1232 != 10 ^ 100 <= 100)

This is the argument is true but is print false.

--
resolution: not a bug -> 
status: closed -> open
type: behavior -> 

___
Python tracker 

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



[issue42522] [C API] Add Py_Borrow() function: call Py_XDECREF() and return the object

2020-12-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm -1 on adding this API as it is inherently unsafe and is bound to be used in 
locations where its contract is not honoured (especially outside of the core). 

Note that the pre-condition on the argument is that you now only own a 
reference to the object, but that there's also someone else that owns a 
reference.

It is better to bite the bullet and go for correct reference count updates when 
converting to the new PyFrame_GetCode API.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue42518] Error Message

2020-12-01 Thread Paul Moore


Paul Moore  added the comment:

You need to learn about chained comparisons in Python. This is not a bug. 
Please stop reopening it.

--
status: open -> closed

___
Python tracker 

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



[issue42522] [C API] Add Py_Borrow() function: call Py_XDECREF() and return the object

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:

Ronald Oussoren: "I'm -1 on adding this API as it is inherently unsafe and is 
bound to be used in locations where its contract is not honoured (especially 
outside of the core)."

I'm trying to update old C extensions which already rely on borrowed references.

I expect that only my script will use this function. Developers should not call 
it directly, but use strong references. I explained it in the function 
documentation.

Obviously, using strong references is safer, but it's not possible to automate 
the conversion of borrowed references to strong references. Maybe it's possible 
on simple functions, but not in the general code (long functions with loops, 
function calls, goto, etc.).


> Note that the pre-condition on the argument is that you now only own a 
> reference to the object, but that there's also someone else that owns a 
> reference.

Py_Borrow() is unsafe by design and should not be used :-)

Replacing frame->f_code with Py_Borrow(PyFrame_GetCode(frame)) doesn't make the 
code worse nor better in term of reference counting.


> It is better to bite the bullet and go for correct reference count updates 
> when converting to the new PyFrame_GetCode API.

My goal is to automate conversion to new C API. Using strong references is 
really challenging and I expect that it would be done manually.

--

Once a code base is updated to use Py_Borrow(), it might become possible to 
replace automatically some simple patterns to use strong references.

--

___
Python tracker 

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



[issue42523] using windows doc incorrectly states version support

2020-12-01 Thread Numerlor


New submission from Numerlor :

In this paragraph, the using windows doc page dynamically adjusts the version 
to the one that's being looked at by the user, however the statement is no 
longer true for python 3.9 and above as support for vista/7 was dropped

> As specified in PEP 11, a Python release only supports a Windows 
  platform while Microsoft considers the platform under extended 
  support. This means that Python |version| supports Windows Vista 
  and newer. If you require Windows XP support then please install 
  Python 3.4.

--
assignee: docs@python
components: Documentation
messages: 382246
nosy: Numerlor, docs@python
priority: normal
severity: normal
status: open
title: using windows doc incorrectly states version support
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



[issue42522] [C API] Add _Py_Borrow() private function: call Py_XDECREF() and return the object

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:

My proposed function doesn't have to be public. I updated the issue and my PR 
to propose to add a *private* function to clarify that it should not be used 
unless you understand what you do.

--
title: [C API] Add Py_Borrow() function: call Py_XDECREF() and return the 
object -> [C API] Add _Py_Borrow() private function: call Py_XDECREF() and 
return the object

___
Python tracker 

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



[issue42521] Debug (-d) mode not working in 3.9

2020-12-01 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Hi Anthony,

could it be that your 3.9 is not a debug build, while the others are? We only 
enable parser debug ouput when Python has been build --with-pydebug.

Building the 3.9.0 tag --with-pydebug works fine for me.

--

___
Python tracker 

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



[issue42522] [C API] Add _Py_Borrow() private function: call Py_XDECREF() and return the object

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:

In the meanwhile, I modified my upgrade_pythoncapi.py tool to include 
pythoncapi_compat.h, and I added _Py_Borrow() and _Py_XBorrow() to 
pythoncapi_compat.h:

* https://github.com/pythoncapi/upgrade_pythoncapi
* https://github.com/pythoncapi/pythoncapi_compat

--

___
Python tracker 

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



[issue42522] [C API] Add _Py_Borrow() private function: call Py_XDECREF() and return the object

2020-12-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

A private function is less problematic, but still far from ideal. Any use of 
the function is IMHO a code smell that should be refactored. 

I'm primarily against this function in the public API because it will be used 
where it isn't appropriate because it looks convenient (such as 
``somefuntion(Py_Borrow(PyUnicode_FromUTF8(...)))``).

--

___
Python tracker 

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



[issue23946] Invalid timestamps reported by os.stat() when Windows FILETIME structures are mistakenly reset.

2020-12-01 Thread Eryk Sun


Eryk Sun  added the comment:

> The code of posixmodule.c looks very different now.

The conversion code was moved to FILE_TIME_to_time_t_nsec() in 
Python/fileutils.c. 

time_t is a signed 64-bit integer type, so there's no immediate problem storing 
1601-01-01 as the negative (pre-epoch) Unix timestamp -11644473600. But there 
are indirect problems with using negative Unix timestamps in Windows. In 
particular, datetime.fromtimestamp doesn't support them:

>>> datetime.fromtimestamp(-11644473600)
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument

--
nosy: +eryksun
status: pending -> open

___
Python tracker 

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



[issue42522] [C API] Add _Py_Borrow() private function: call Py_XDECREF() and return the object

2020-12-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

BTW. Have you considered using coccinelle 
 instead of a python script?

I have no experience with the tool, but it is meant to be used for code 
transformation ("semantic patches").  I only know of the tool because of 
articles on LWN.net, I haven't tried using it yet.

--

___
Python tracker 

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



[issue40060] socket.TCP_NOTSENT_LOWAT is missing in official macOS builds

2020-12-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The work in #441100 is merged into master and 3.9, including an (experimental) 
"universal2" build of the latter in 3.9.1rc1 that is build with the latest SDK.

I'm therefore closing this issue.

--
dependencies:  -Support macOS 11 and Apple Silicon Macs
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue42522] [C API] Add _Py_Borrow() private function: call Py_XDECREF() and return the object

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:

> BTW. Have you considered using coccinelle 
>  instead of a python script?

I wrote Python code just because I like Python. There are likely other more 
advanced tools like coccinelle, but Python users are more used to install 
Python scripts and Python is portable.

--

___
Python tracker 

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



[issue42521] Debug (-d) mode not working in 3.9

2020-12-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I cannot reproduce it either in 3.9. Building 3.9 in debug mode and using -d 
works as expected

--

___
Python tracker 

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



[issue42521] Debug (-d) mode not working in 3.9

2020-12-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Also, note the -d flag activates the debug mode **in the parser**, not in the 
tokenizer.

--

___
Python tracker 

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



[issue42522] [C API] Add _Py_Borrow() private function: call Py_XDECREF() and return the object

2020-12-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I totally understand, I would have done the same.  Coccinelle looks like an 
interesting tool for refactorings like this, but I prefer to write Python 
scripts (and often just refactor manually).

--

___
Python tracker 

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



[issue37221] PyCode_New API change breaks backwards compatibility policy

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22463
pull_request: https://github.com/python/cpython/pull/23595

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22465
pull_request: https://github.com/python/cpython/pull/23598

___
Python tracker 

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



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22467
pull_request: https://github.com/python/cpython/pull/23598

___
Python tracker 

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



[issue37194] Move new vector private declarations to the internal C API

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22466
pull_request: https://github.com/python/cpython/pull/23598

___
Python tracker 

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



[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22464
pull_request: https://github.com/python/cpython/pull/23598

___
Python tracker 

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



[issue42524] pdb access to return value

2020-12-01 Thread Romuald Brunet


New submission from Romuald Brunet :

When using the pdb module, there is currently no way to easy access the current 
return value of the stack

This return value is accessed by the 'retval command'

I propose using the currently unused argument to allow storing the return value 
in the local variables, accessible via the debugger

For example:


def foo():
debugger()
return ComplexObject()

def bar():
return foo()

(pdb) retval

(pdb) retval zz
(pdb) zz.attribute
'some value'

--
components: Library (Lib)
messages: 382259
nosy: Romuald
priority: normal
severity: normal
status: open
title: pdb access to return value
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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:

I created the https://github.com/pythoncapi/upgrade_pythoncapi project which 
updates automatically a C extension to newer C API. For example, it uses 
Py_TYPE(), Py_SIZE(), Py_REFCNT(), Py_SET_SIZE(), Py_SET_SIZE() and 
Py_SET_REFCNT() functions.

--

___
Python tracker 

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



[issue37221] PyCode_New API change breaks backwards compatibility policy

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1867b462de427bcb8dfbcd256028410aea6ae929 by Victor Stinner in 
branch 'master':
bpo-37221: PyCode_New() didn't change in Python 3.8 (GH-23595)
https://github.com/python/cpython/commit/1867b462de427bcb8dfbcd256028410aea6ae929


--

___
Python tracker 

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



[issue37221] PyCode_New API change breaks backwards compatibility policy

2020-12-01 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +22468
pull_request: https://github.com/python/cpython/pull/23599

___
Python tracker 

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



[issue37221] PyCode_New API change breaks backwards compatibility policy

2020-12-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22469
pull_request: https://github.com/python/cpython/pull/23600

___
Python tracker 

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



[issue42524] pdb access to return value

2020-12-01 Thread Romuald Brunet


Change by Romuald Brunet :


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

___
Python tracker 

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



[issue19478] Add ability to prefix posix semaphore names created by multiprocessing module

2020-12-01 Thread Irit Katriel


Irit Katriel  added the comment:

Fixed in 3.4, won't be fixed in 2.7.

--
nosy: +iritkatriel
resolution:  -> fixed
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



[issue42525] Optimize class/module level annotation

2020-12-01 Thread Yurii Karabas


New submission from Yurii Karabas <1998uri...@gmail.com>:

This issue is inspired by https://bugs.python.org/issue42202

We can do smth similar for class/module level annotations.

Inada Naoki what do you think regarding that?

--
components: Interpreter Core
messages: 382263
nosy: methane, uriyyo
priority: normal
severity: normal
status: open
title: Optimize class/module level annotation
type: resource usage
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



[issue37221] PyCode_New API change breaks backwards compatibility policy

2020-12-01 Thread miss-islington


miss-islington  added the comment:


New changeset d9d63f13cf5b6b896c245099c42b08f6da083d05 by Miss Islington (bot) 
in branch '3.8':
bpo-37221: PyCode_New() didn't change in Python 3.8 (GH-23595)
https://github.com/python/cpython/commit/d9d63f13cf5b6b896c245099c42b08f6da083d05


--

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-12-01 Thread Andy Lester


Change by Andy Lester :


--
nosy:  -petdance

___
Python tracker 

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



[issue42526] Exceptions in asyncio.Server callbacks are not retrievable

2020-12-01 Thread Tom


New submission from Tom :

Consider this program:

import asyncio

async def handler(r, w):
raise RuntimeError

async def main():
server = await asyncio.start_server(handler, host='localhost', 
port=1234)
r, w = await asyncio.open_connection(host='localhost', port=1234)
await server.serve_forever()
server.close()

asyncio.run(main())

The RuntimeError is not retrievable via the serve_forever coroutine. To my
knowledge, there is no feature of the asyncio API which causes the server to
stop on an exception and retrieve it. I have also tried wrapping serve_forever
in a Task, and waiting on the coro with FIRST_EXCEPTION.

This severely complicates testing asyncio servers, since failing tests hang
forever if the failure occurs in a callback.

It should be possible to configure the server to end if a callback fails, e.g.
by a 'stop_on_error' kwarg to start_server (defaulting to False for
compatibility).

I know this isn't a technical problem, since AnyIO, which uses asyncio, does
this by default. This equivalent program ends after the exception:

import anyio

async def handler(client):
raise RuntimeError

async def main():
async with anyio.create_task_group() as tg:
listener = await anyio.create_tcp_listener(local_host='localhost', 
local_port=1234)
await tg.spawn(listener.serve, handler)
async with await anyio.connect_tcp('localhost', 1234) as client:
pass

anyio.run(main)

--
components: asyncio
messages: 382265
nosy: asvetlov, tmewett, yselivanov
priority: normal
severity: normal
status: open
title: Exceptions in asyncio.Server callbacks are not retrievable
versions: Python 3.7

___
Python tracker 

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



[issue42526] Exceptions in asyncio.Server callbacks are not retrievable

2020-12-01 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

This is a deliberate decision.
An exception in handling one client connection should not break another 
connected client.

--

___
Python tracker 

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



[issue37221] PyCode_New API change breaks backwards compatibility policy

2020-12-01 Thread miss-islington


miss-islington  added the comment:


New changeset ed4614386f210964840daa1f7cbddbbd575f7a49 by Miss Islington (bot) 
in branch '3.9':
bpo-37221: PyCode_New() didn't change in Python 3.8 (GH-23595)
https://github.com/python/cpython/commit/ed4614386f210964840daa1f7cbddbbd575f7a49


--

___
Python tracker 

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



[issue15674] PEP 3121, 384 Refactoring applied to _thread module

2020-12-01 Thread hai shi


Change by hai shi :


--
versions: +Python 3.10 -Python 3.4

___
Python tracker 

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



[issue42527] UnicodeEncode error in BaseHttpRequestHandler class when send unicode data.

2020-12-01 Thread Yanfeng Wang


New submission from Yanfeng Wang :

My environment:
system: MacOS 10.15.x
python: 3.9.0

when I inherit the BaseHTTPRequestHandler class, and call the 
send_error(error_di, msg) method in my own class's do_GET override function:
the msg argument can't accept unicode string, an UnicodeEncodeError of 
'latin-1' encoding error with ordinal call failed of out of range(255).

I tracked the code, and found in the implementation of this class, the data was 
sent through a encode call with 'latin-1' hard coded in. in the file: server.py 
near line 507. 
BTW, I tried u'my string'.encode('utf-8'), and it didn't work, another 
TypeError in module html __init__.py line 19.

If I commented the original hard code 'latin-1' line and replace with the hard 
code encoding to 'utf-8', all will be fine.
 
Thanks for your read anyone who cares or takes care of this issue.

--
components: Unicode
messages: 382268
nosy: ezio.melotti, vstinner, wangyanfeng.p
priority: normal
severity: normal
status: open
title: UnicodeEncode error in BaseHttpRequestHandler class when send unicode 
data.
type: behavior
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



[issue42528] Improve the docs of most Py*_Check{,Exact} API calls

2020-12-01 Thread Antonio Cuni


New submission from Antonio Cuni :

I think that none of these API calls can fail, but only few of them are
documented as such. E.g. PyNumber_Check contains the sentece "This function 
always succeeds" but PyBytes_Check does not.

--
assignee: docs@python
components: Documentation
messages: 382269
nosy: antocuni, docs@python
priority: normal
severity: normal
status: open
title: Improve the docs of most Py*_Check{,Exact} API calls
type: enhancement

___
Python tracker 

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



[issue42522] [C API] Add _Py_Borrow() private function: call Py_XDECREF() and return the object

2020-12-01 Thread Christoph Reiter


Christoph Reiter  added the comment:

I find it confusing that the function is called Py_Borrow() but steals the 
reference.

--
nosy: +lazka

___
Python tracker 

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



[issue42528] Improve the docs of most Py*_Check{,Exact} API calls

2020-12-01 Thread Antonio Cuni


Change by Antonio Cuni :


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

___
Python tracker 

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



[issue40800] asyncio.sleep(0) should "yield" back to the event loop, but it doesn't behave as expected

2020-12-01 Thread Bar Harel


Bar Harel  added the comment:

It relinquishes control for exactly one event loop cycle.

You'll see that it takes two or three cycles and then gets cancelled correctly.

The reason being is that recovery from your `await asyncio.sleep(1)` takes two 
or three cycles. (Under the hood, a few `asyncio.call_soon()` are called in a 
chain and only 1 is executed each cycle).

This is not a bug, but rather intended behavior. You should probably use 
`asyncio.to_thread()` or preferably run cpu-intensive code on a different 
process.

@triage Please close as not-a-bug.

--
nosy: +bar.harel

___
Python tracker 

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



[issue40800] asyncio.sleep(0) should "yield" back to the event loop, but it doesn't behave as expected

2020-12-01 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Agree, not a bug.

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



[issue42525] Optimize class/module level annotation

2020-12-01 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Would it require a substantial amount of changes? If so, I don't think this is 
a critical optimization since nearly-all of class definitions happens on the 
module level and evaluated on the import time only once.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue42526] Exceptions in asyncio.Server callbacks are not retrievable

2020-12-01 Thread Tom


Tom  added the comment:

How do you suggest one might test code in a Server callback with asyncio?

Of course, I don't want any old exception to affect another client connection,
only an exception which is uncaught up to the handler coro. And I'm not
suggesting that it happen by default, only that it be possible.

With this, the behaviour would perfectly align with the asyncio.gather
functionality, and its 'return_exceptions' kwarg.

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-01 Thread Karl Nelson


New submission from Karl Nelson :

While trying to use JPype on Windows Python 3.9.0, we are running into an 
bizarre issue with loading the internal module which is written in C.  When 
running a python script the first time the internal module loads correctly.  
However, the second time that script is run the internal module reports "A 
dynamic link library (DLL) initialization routine failed."  If you then erase 
the pyc cache file that is importing the internal module then it works again.  
This only occurs on Windows and was not present using the same source prior 
versions of Python 3.8.

We investigate the byte codes from both version and they are doing the same 
series of actions so the problem appears to be calling the same opcode to 
execute an import.

I make sure all required symbols were found in the libraries and only only copy 
of the internal DLL was the same with and without loading from a pyc.

It may be a change in the requirements of module initialization, but I don't 
know how to proceed.  There was one deprecation warning but correcting that did 
not alter the outcome.  

It appears that the execute path for importing a CPython module takes a 
different path when the script was imported from something compiled on the fly 
as opposed to loading from a pyc.
 

 ```
 import: 'jpype'
 Traceback (most recent call last):
File "D:\bld\jpype1_1605785280189\test_tmp\run_test.py", line 2, in 
  import jpype
File 
"D:\bld\jpype1_1605785280189\_test_env\lib\site-packages\jpype\__init__.py", 
line 18, in 
  import _jpype
 ImportError: DLL load failed while importing _jpype: A dynamic link library 
(DLL) initialization routine failed.
 ```

--
components: Windows
messages: 382275
nosy: Thrameos, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: CPython DLL initialization routine failed from PYC cache file
type: behavior
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



[issue42523] using windows doc incorrectly states version support

2020-12-01 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 2.0 -> 3.0
pull_requests: +22472
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23603

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e483d281bd55be0beee3e62d18e0719175bde671 by pxinwr in branch 
'master':
bpo-31904: Fix test_netrc for VxWorks RTOS (GH-21675)
https://github.com/python/cpython/commit/e483d281bd55be0beee3e62d18e0719175bde671


--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-01 Thread Steve Dower


Steve Dower  added the comment:

There really shouldn't be any difference between those two paths, apart from 
skipping the compile step in the second case.

It sounds like you're pretty well set up for testing, so would you be able to 
try the test while running under either the Visual Studio debugger (easiest way 
is to add an "input()" to your code, run to there, then Debug/Attach and press 
enter to let it continue) or WinDbg if you prefer that? That will give much 
more information about which DLL is actually failing, and possibly why.

--

___
Python tracker 

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



[issue32830] tkinter documentation suggests "from tkinter import *", contradicting PEP8

2020-12-01 Thread Tom Middleton


Tom Middleton  added the comment:

While I agree that it shouldn't be imposed on changing previous code, changing 
the documentation isn't changing the previous code it is encouraging future 
code. I think that the documentation should have a caveat. I'm seeing a lot of 
new code using tkinter with glob import which is obviously from the 
documentation as it suggests doing so. I think that the glob import practice 
should be overall discouraged. I think adding a disclaimer in the documentation 
at the reference to `from tkinter import *` would be sufficient. A reference to 
PEP8 would be good. I'd imagine that most people look up docs and are not as 
familiar with PEP.
Why can't something like that be added to the documentation?

--
nosy: +busfault

___
Python tracker 

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



[issue42528] Improve the docs of most Py*_Check{,Exact} API calls

2020-12-01 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



[issue10486] http.server doesn't set all CGI environment variables

2020-12-01 Thread Senthil Kumaran


Change by Senthil Kumaran :


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

___
Python tracker 

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



[issue42526] Exceptions in asyncio.Server callbacks are not retrievable

2020-12-01 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

You can use try/except in handler() and dispatch the exception whatever you 
want.
It doesn't require a new asyncio version, debug-only flag, etc.

--

___
Python tracker 

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



[issue10486] http.server doesn't set all CGI environment variables

2020-12-01 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

I spent some time reviewing and researching the specification. It also says

   The server is not required to create meta-variables for all the
   header fields that it receives.  

And this in issue, open since 2010, we have issue two different set of 
variables one from Apache and from Nginx. So, it Is not certain if http.server 
should be alinged it any or all, and plus if anything is required.

The discussion on QUERY_STRING was noted, but as Pierre pointed out it was set 
too

for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH',
  'HTTP_USER_AGENT', 'HTTP_COOKIE', 'HTTP_REFERER'):
env.setdefault(k, "")

For cosmetic purpose, I could remove the existing if condition - 
https://github.com/python/cpython/pull/23604

I am not sure if we need to add other variables with an empty string value for 
any reason. 

As a maintainer, I think, we should close this issue.

If there is a bug report, like issue5054, then that is a valid issue, and we 
should fix it.  If there any specific issues raised with parsing or lack of 
"required" meta variable that caused the application to break, even that could 
be fixed.

I am closing this issue with a cosmetic change that stemmed out from the 
discussion - https://github.com/python/cpython/pull/23604

--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue5054] CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed

2020-12-01 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
assignee:  -> orsenthil
versions: +Python 3.10, Python 3.9 -Python 2.6, Python 2.7, Python 3.1, Python 
3.2

___
Python tracker 

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



[issue42521] Debug (-d) mode not working in 3.9

2020-12-01 Thread anthony shaw


anthony shaw  added the comment:

thanks, it would be great if this were documented in the --help section like 
the other options which require a debug build (-X showrefcount)

--

___
Python tracker 

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



[issue42521] Debug (-d) mode not working in 3.9

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:

In PyConfig, I chose to name the option "parser_debug" rather than the very 
generic "debug" name :-)

"""
Parser debug mode. If greater than 0, turn on parser debugging output (for 
expert only, depending on compilation options).

Incremented by the -d command line option. Set to the PYTHONDEBUG environment 
variable value.
"""

https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.parser_debug

--
nosy: +vstinner

___
Python tracker 

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



[issue42521] Debug (-d) mode not working in 3.9

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:

> thanks, it would be great if this were documented in the --help section like 
> the other options which require a debug build (-X showrefcount)

PyConfig.show_ref_count documentation explains that a debug build is required:

"Need a debug build of Python (Py_REF_DEBUG macro must be defined)."

https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.show_ref_count

By the way, it would be nice to add a link on "debug build" to explain how to 
detect if Python is built in debug mode and how to build Python in debug mode.

--

___
Python tracker 

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



[issue42522] [C API] Add _Py_Borrow() private function: call Py_XDECREF() and return the object

2020-12-01 Thread STINNER Victor


STINNER Victor  added the comment:

I had more time to think about this issue.

First, I decided to always include "pythoncapi_compat.h" and so there is no 
strict requirement to add new C API functions to Python.

Second, the _Py_Borrow() function looked nice, but there is a practical issue: 
its return type is always PyObject* which makes it not convenient to "convert" 
a function returning a different type.

For example, I replaced "frame->f_code" with "((PyCodeObject 
*)_Py_Borrow(PyFrame_GetCode(frame)))", but this expression requires 3 levels 
of parenthesis, it's long and it's hard to read :-( The outter parenthesis is 
needed if the modified expresion is used to get a code member, like: 
"frame->f_code->co_name".

I chose another approach: add a "Borrow" variant of the functions that I need.

For example, add _PyFrameGetCodeBorrow() variant of PyFrameGetCode(). This 
function is only added to pythoncapi_compat.h, and so Python doesn't have to be 
modified.

I reject my issue :-)

--
resolution:  -> rejected
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-12-01 Thread Igor Skochinsky


Igor Skochinsky  added the comment:

Attached is a sample program which works on 3.9 but fails linking with 3.10.0a2 

The .so is missing the symbol:

igor@LAPTOP:~/py_limited_api_example$ nm /home/igor/lib/libpython3.9.so | grep 
Py_CompileString
00212720 T Py_CompileString
0020fe30 T Py_CompileStringExFlags
00212730 T Py_CompileStringFlags
0020fd40 T Py_CompileStringObject

igor@LAPTOP:~/py_limited_api_example$ nm /home/igor/lib/libpython3.10.so | grep 
Py_CompileString
00201a40 T Py_CompileStringExFlags
00201980 T Py_CompileStringObject


Please stop breaking the Stable ABI :/

--
Added file: https://bugs.python.org/file49642/py_limited_api_example.zip

___
Python tracker 

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



[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-12-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

>>> Do you want to submit a PR for this?
>
> Sure. Do you think the code I proposed would be suitable?

Yes.  It will need tests and a news entry as well.

--
assignee:  -> rhettinger

___
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-12-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, I wonder if there's a typo here in pythonrun.c:

/* For use in Py_LIMITED_API */
#undef Py_CompileString
PyObject *
PyCompileString(const char *str, const char *filename, int start)
{
return Py_CompileStringFlags(str, filename, start, NULL);
}

Shouldn't that function be named Py_CompileString (i.e. Py_ instead of Py)?

This seems to be old code, but there's normally a macro Py_CompileString() that 
translates to Py_CompileStringFlags() in pythonrun.h:

#ifdef Py_LIMITED_API
PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
#else
#define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, 
f, -1)
.
.
.

--

___
Python tracker 

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



[issue42525] Optimize class/module level annotation

2020-12-01 Thread Inada Naoki


Inada Naoki  added the comment:

I agree with Batuhan.

Although bytecode for class annotations seems inefficient, it is difficult to 
optimize without breaking backward compatibility.
You can write arbitrary code in class/module block which dynamically manipulate 
__annotations__.

```
class Foo:
__annotations__["spam"] = "list"
ham: tuple
```

--

___
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-12-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +22474
pull_request: https://github.com/python/cpython/pull/23606

___
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-12-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Seems that commit 1ed83adb0e95305af858bd41af531e487f54fee7 was deleting some 
functions that were not correctly covered by redirection macros. I have opened 
PR 23606 to restore those as they were.

--

___
Python tracker 

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



[issue42523] using windows doc incorrectly states version support

2020-12-01 Thread Ned Deily


Change by Ned Deily :


--
nosy: +steve.dower

___
Python tracker 

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



[issue42521] Debug (-d) mode not working in 3.9

2020-12-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue41625] Add splice() to the os module

2020-12-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



  1   2   >