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

2020-03-19 Thread hai shi


Change by hai shi :


--
pull_requests: +18444
pull_request: https://github.com/python/cpython/pull/19084

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney


Change by Dennis Sweeney :


Added file: https://bugs.python.org/file48989/pep-.rst

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney


Change by Dennis Sweeney :


Removed file: https://bugs.python.org/file48983/pep-.rst

___
Python tracker 

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



[issue40022] 关于列表的基础算法问题

2020-03-19 Thread yepan Li

New submission from yepan Li :

English is very poor so I use Chinese,
这是一个偶然的发现
lis1 = [1,2,3,4,5,6,7,8,9,10]#定义一个列表
lislen = len(lis1)#获得列表长度 此时lislen(列表1)的值为10
lis2 = []*lislen#定义一个新列表长度和第一个列表不一样但是没有元素
print(lis1)#输出测试一下第一个列表正常
for i in lis1:#用i循环遍历数组1
lis2.insert(lislen,i)#将列表2的第10(lislen)个元素设置为i(i此时为1)
lislen = lislen-lislen#将lislen(10) = 10(lislen) - 10(lislen) == 0
#下一次循环应该是lis2.insert(0,i)但是却造成了最终数组倒值的结果
print(lis2)

--
components: Windows
files: Test01.py
messages: 364648
nosy: paul.moore, steve.dower, tim.golden, yepan Li, zach.ware
priority: normal
severity: normal
status: open
title: 关于列表的基础算法问题
versions: Python 3.8
Added file: https://bugs.python.org/file48988/Test01.py

___
Python tracker 

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



[issue40021] Throwing an Exception results in stack overflow

2020-03-19 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Interpreter aborts when chaining an infinite number of 
exceptions
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



[issue40021] Throwing an Exception results in stack overflow

2020-03-19 Thread ThePokestarFan


ThePokestarFan  added the comment:

I tested the program against my 3.8 installation and got the same error.

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



[issue40021] Throwing an Exception results in stack overflow

2020-03-19 Thread ThePokestarFan


Change by ThePokestarFan :


Added file: https://bugs.python.org/file48987/program.py

___
Python tracker 

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



[issue40021] Throwing an Exception results in stack overflow

2020-03-19 Thread ThePokestarFan


Change by ThePokestarFan :


Added file: https://bugs.python.org/file48986/python2.txt

___
Python tracker 

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



[issue40021] Throwing an Exception results in stack overflow

2020-03-19 Thread ThePokestarFan


Change by ThePokestarFan :


Added file: https://bugs.python.org/file48985/interpter.txt

___
Python tracker 

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



[issue40021] Throwing an Exception results in stack overflow

2020-03-19 Thread ThePokestarFan


New submission from ThePokestarFan :

If I set up a simple recursion exception function, that calls itself every time 
an error is raised, Python throws a SIGABRT and crashes due to a "Stack 
Overflow". 

def x():
try:
raise Exception()
except Exception:
x()

Oddly enough, my system installation of Python 2.7 threw a RuntimeError instead 
of aborting, which is what I expected.

--
components: Interpreter Core, macOS
files: error.log
messages: 364646
nosy: ThePokestarFan, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Throwing an Exception results in stack overflow
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48984/error.log

___
Python tracker 

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



[issue40020] growable_comment_array_add leaks, causes crash

2020-03-19 Thread Alexander Riccio


Change by Alexander Riccio :


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

___
Python tracker 

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



[issue40020] growable_comment_array_add leaks, causes crash

2020-03-19 Thread Alexander Riccio


Alexander Riccio  added the comment:

Sidenote: visual studio was misleading and made this look like a use-after-free 
for a little while, which was interesting.

--
nosy: +pablogsal

___
Python tracker 

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



[issue40020] growable_comment_array_add leaks, causes crash

2020-03-19 Thread Alexander Riccio


New submission from Alexander Riccio :

growable_comment_array_add in parsetok.c incorrectly uses realloc, which leaks 
the array when allocation fails, and then causes a null pointer deref crash 
later when the array is freed in growable_comment_array_deallocate (the array 
pointer is dereferenced, passing null to free is fine).

It's unlikely that this codepath is reached in normal use, since type comments 
need to be turned on (via the PyCF_TYPE_COMMENTS compiler flag), but I've 
managed to replicate the issue by injecting faults with Application Verifier. 
It's easiest to cause it to fail with a very large number of type comments, but 
presumably this could also happen with some form of heap fragmentation.

The buggy code is:

static int
growable_comment_array_add(growable_comment_array *arr, int lineno, char 
*comment) {
if (arr->num_items >= arr->size) {
arr->size *= 2;
arr->items = realloc(arr->items, arr->size * sizeof(*arr->items));
if (!arr->items) {
return 0;
}
}

arr->items[arr->num_items].lineno = lineno;
arr->items[arr->num_items].comment = comment;
arr->num_items++;
return 1;
}


and the correct code would be something like:

static int
growable_comment_array_add(growable_comment_array *arr, int lineno, char 
*comment) {
if (arr->num_items >= arr->size) {
arr->size *= 2;
void* new_items_array = realloc(arr->items, arr->size * 
sizeof(*arr->items));
if (!new_items_array) {
return 0;
}
arr->items = new_items_array;
}

arr->items[arr->num_items].lineno = lineno;
arr->items[arr->num_items].comment = comment;
arr->num_items++;
return 1;
}

--
components: Interpreter Core
messages: 364644
nosy: Alexander Riccio, benjamin.peterson
priority: normal
severity: normal
status: open
title: growable_comment_array_add leaks, causes crash
type: crash
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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Here is a draft PEP -- I believe it needs a Core Developer sponsor now?

--
Added file: https://bugs.python.org/file48983/pep-.rst

___
Python tracker 

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



[issue27307] string.Formatter does not support key/attribute access on unnumbered fields

2020-03-19 Thread Maxwell Bernstein


Maxwell Bernstein  added the comment:

Okay, well it doesn't provide the desired behavior of raising the error when 
switching back and forth between manual and auto numbering, so I am looking 
into that.

--

___
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-03-19 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
keywords: +patch
nosy: +benjamin.peterson
nosy_count: 6.0 -> 7.0
pull_requests: +18441
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19082

___
Python tracker 

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



[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40019: "test_gdb  should better detect when Python is optimized".

--

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-19 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-19 Thread STINNER Victor


New submission from STINNER Victor :

On my PR 19077 which changes Python/ceval.c, test_gdb fails on Travis CI with 
Python compiled with clang -Og.

The -Og optimization level is a compromise between performance and the ability 
to debug Python. The problem is that gdb fails to retrieve some information and 
so test_gdb fails.

I proposed bpo-38350 "./configure --with-pydebug should use -O0 rather than 
-Og", but the status quo is to continue to use -Og by default.

See examples of test_gdb failures from PR 19077 below.

I propose to skip a test if one of the follow pattern is found in gdb output:

* '',
* '(frame information optimized out)',
* 'Unable to read information on python frame',

==
FAIL: test_basic_command (test.test_gdb.PyListTests)
Verify that the "py-list" command works
--
(...)

AssertionError: (...)

'Breakpoint 1 at 0x5aabf1: file Python/bltinmodule.c, line 1173.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, builtin_id (self=, v=42) at Python/bltinmodule.c:1173
1173\tPyObject *id = PyLong_FromVoidPtr(v);
Unable to read information on python frame
'

did not end with

'   5
   6def bar(a, b, c):
   7baz(a, b, c)
   8
   9def baz(*args):
 >10id(42)
  11
  12foo(1, 2, 3)
'


==
FAIL: test_bt (test.test_gdb.PyBtTests)
Verify that the "py-bt" command works
--
(...)
AssertionError:

'Breakpoint 1 at 0x5aabf1: file Python/bltinmodule.c, line 1173.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, builtin_id (self=, v=42) at Python/bltinmodule.c:1173
1173\tPyObject *id = PyLong_FromVoidPtr(v);
Traceback (most recent call first):
  
  (frame information optimized out)
  File "/home/travis/build/python/cpython/Lib/test/gdb_sample.py", line 7, in 
bar
baz(a, b, c)
  File "/home/travis/build/python/cpython/Lib/test/gdb_sample.py", line 4, in 
foo
bar(a, b, c)
  (frame information optimized out)
'

did not match

'^.*
Traceback \\(most recent call first\\):
  
  File ".*gdb_sample.py", line 10, in baz
id\\(42\\)
  File ".*gdb_sample.py", line 7, in bar
baz\\(a, b, c\\)
  File ".*gdb_sample.py", line 4, in foo
bar\\(a, b, c\\)
  File ".*gdb_sample.py", line 12, in 
foo\\(1, 2, 3\\)
'

--
components: Tests
messages: 364640
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_gdb  should better detect when Python is optimized
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



[issue40018] test_ssl fails with OpenSSL 1.1.1e

2020-03-19 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

I think this is caused by their EOF change: 
https://github.com/openssl/openssl/issues/10880 read() now sometimes gives you 
the infamous OSError errno 0 rather than b'' at the end of the stream.

--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-19 Thread Ned Deily


Change by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



[issue40018] test_ssl fails with OpenSSL 1.1.1e

2020-03-19 Thread Benjamin Peterson


New submission from Benjamin Peterson :

==
ERROR: test_ciphers (test.test_ssl.SimpleBackgroundTests)
--
Traceback (most recent call last):
  File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2120, in 
test_ciphers
s.connect(self.server_addr)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect
self._real_connect(addr, False)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect
self.do_handshake()
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

==
ERROR: test_connect (test.test_ssl.SimpleBackgroundTests)
--
Traceback (most recent call last):
  File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 1944, in 
test_connect
s.connect(self.server_addr)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect
self._real_connect(addr, False)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect
self.do_handshake()
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

==
ERROR: test_connect_cadata (test.test_ssl.SimpleBackgroundTests)
--
Traceback (most recent call last):
  File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2062, in 
test_connect_cadata
s.connect(self.server_addr)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect
self._real_connect(addr, False)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect
self.do_handshake()
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

==
ERROR: test_connect_capath (test.test_ssl.SimpleBackgroundTests)
--
Traceback (most recent call last):
  File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2041, in 
test_connect_capath
s.connect(self.server_addr)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect
self._real_connect(addr, False)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect
self.do_handshake()
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

==
ERROR: test_connect_with_context (test.test_ssl.SimpleBackgroundTests)
--
Traceback (most recent call last):
  File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2002, in 
test_connect_with_context
s.connect(self.server_addr)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect
self._real_connect(addr, False)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect
self.do_handshake()
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

==
ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests)
--
Traceback (most recent call last):
  File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2107, in 
test_get_server_certificate
_test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA)
  File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2272, in 
_test_get_server_certificate
pem = ssl.get_server_certificate((host, port), ca_certs=cert)
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1484, in 
get_server_certificate
with context.wrap_socket(sock) as sslsock:
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1040, in _create
self.do_handshake()
  File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

==
ERROR: test_session_handling 

[issue40017] Please support CLOCK_TAI in the time module.

2020-03-19 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



[issue40017] Please support CLOCK_TAI in the time module.

2020-03-19 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

I think we could certainly take a patch to expose that constant if libc/kernel 
headers expose it.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue25878] CPython on Windows builds with /W3, not /W4

2020-03-19 Thread Steve Dower


Steve Dower  added the comment:

Thanks for all that work!

We definitely don't want a noisy build to be merged, but if you submit a PR 
with only your most confident suppressions then it'll be easier for us to look 
at the others and see which are scary/not-scary.

--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-19 Thread Steve Dower


Steve Dower  added the comment:

So ultimately this is a major sysconfig design flaw, and it likely requires a 
rewrite.

The mix of information sources between _sysconfigdata (even when overriding the 
name and PYTHONPATH) and the Makefile, and the order in which you can rely them 
to be loaded (you can't) and the fact that INSTALL_SCHEMES depends on _neither_ 
(it only uses the running interpreter's sys module) means you can't possibly 
get a coherent view of the settings for anything other than the running 
interpreter.

Since we need something else for cross-compiling, we should either fix 
sysconfig so that it's possible to override the source of information reliably, 
or we avoid using it completely for building the CPython extension modules. The 
former would likely help third-party cross-compilation more.

I'm not sure who needs to be in on this, so I'll post to python-dev before 
going any further.

--

___
Python tracker 

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



[issue25878] CPython on Windows builds with /W3, not /W4

2020-03-19 Thread Alexander Riccio


Alexander Riccio  added the comment:

Ok, so I finally have some proper time to work on this. How would people (who 
are higher up in python than me, obviously) feel about suppressing most of the 
warnings via a user macro in Visual Studio? I've found that it's quite easy to 
add a macro to the project properties (i.e. pyproject), and have it import into 
the "Disable specific warnings" build options. This keeps our build files 
hand-crafted (let's keep the hipsters happy!), and consistent. By doing this, I 
can get it down to ~100 warnings, which are essentially code that we may want 
to keep an eye on.

The following warnings are essentially always spurious for python. C4100 is
everywhere, and is nearly always benign, but would still require a lot of
careful inspection to determine it its truly on purpose. C4127 is fine since C
doesn't have `constexpr`, let alone `if constexpr`, and it's just easier to
use if statements than  `#ifdef`s everywhere. C4152 is used in every module
exports array. 

C4100 (unreferenced formal parameter) 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4100?view=vs-2019
C4115 'type' : named type definition in parentheses 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-1-and-4-c4115?view=vs-2019
C4127 conditional expression is constant 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4127?view=vs-2019
C4131 'function' : uses old-style declarator 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4131?view=vs-2019
C4152 non standard extension, function/data ptr conversion in expression 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4152?view=vs-2019

These are usually spurious, since zero-sized arrays are common across the C
world, and is one of several ways of implementing dynamic structs (e.g. unsized
arrays, ANYSIZE_ARRAY, etc...). C4204 and C4221 exist all over the place, and
are probably fine as long as we don't make any lifetime mistakes, which of
course is a solved problem in C. Instances of C4244 should each be individually
inspected carefully since they could be bugs, but there are way too many of
them to allow the warning right now. 

C4200 nonstandard extension used : zero-sized array in struct/union 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-2-and-4-c4200?view=vs-2019
C4201 nonstandard extension used : nameless struct/union 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4201?view=vs-2019
C4204 nonstandard extension used : non-constant aggregate initializer 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4204?view=vs-2019
C4221 nonstandard extension used : 'identifier' : cannot be initialized using 
address of automatic variable 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4221?view=vs-2019
C4232 nonstandard extension used : 'identifier' : address of dllimport 
'dllimport' is not static, identity not guaranteed 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4232?view=vs-2019
 
C4244 'conversion' conversion from 'type1' to 'type2', possible loss of data 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-3-and-4-c4244?view=vs-2019
C4245 'conversion' : conversion from 'type1' to 'type2', signed/unsigned 
mismatch 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4245?view=vs-2019


Instances of C4389 should each be individually inspected carefully since they
could be bugs, but there are way too many of them to allow the warning right 
now.

C4389 'operator' : signed/unsigned mismatch 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4389?view=vs-2019


Instances of C4456 and C4457 are likely ok given the length of many CPython
functions, but should be inspected for mistakes. There are lots of places
where `i` and such are used as variables, and it's there's no way to know
if the author intended it.
C4456 declaration of 'identifier' hides previous local declaration 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4456?view=vs-2019
C4457 declaration of 'identifier' hides function parameter 
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4457?view=vs-2019


Instances of C4701 occur pretty frequently around code that initializes C
objects with the funky PyArg_ParseTuple format string mechanism, since the
compiler has no built in support for understanding custom format strings.
Personally, I would support zero-initializing these variables. Would it break

[issue40017] Please support CLOCK_TAI in the time module.

2020-03-19 Thread Russell Owen


New submission from Russell Owen :

It is becoming common (at least in astronomy) to want to use TAI as a time 
standard because it is a uniform time with no leap seconds, and differs from 
UTC (standard computer clock time) by an integer number of seconds that 
occasionally changes.

Linux offers a clock for TAI time: CLOCK_TAI. It would be very helpful to have 
this constant in the time module, e.g. for calling time.clock_gettime

Caveat: linux CLOCK_TAI will return UTC time if the leap second table has not 
been set up. Both ntp and ptp can be configured to maintain this table. So this 
is a caveat worth mentioning in the docs. But I hope it is not sufficient 
reason to deny the request.

--
components: Library (Lib)
messages: 364633
nosy: r3owen
priority: normal
severity: normal
status: open
title: Please support CLOCK_TAI in the time module.
type: enhancement
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



[issue39969] Remove Param expression context from AST

2020-03-19 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Batuhan: You maybe want to propose a fix there. It shouldn't be hard to fix 
> the issue.

Serhiy has an open PR about adding some dummy classes that will represent 
recent deletions like Suite, Param and AugStore/Load. 
https://github.com/python/cpython/pull/19056

--

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum


Ram Rachum  added the comment:

I'm gonna look past the rudeness, and I'll just say that if I was tripped up by 
this, after 11 years of working with Python and the re module, then people in a 
beginner or intermediate level could be tripped  up by this as well. 

Here's another, simpler suggestion for preventing confusion. Replace this line 
in the docstring:

(?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below).

With this line:

(?aiLmsux) Apply flags to the entire pattern, allowing 
   small tweaks to the matching logic (details below).

There's no reason to mention the letters there because they're already 
mentioned. And it's helpful to add a short explanation, like the other entries 
in that list.

--

___
Python tracker 

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



[issue27307] string.Formatter does not support key/attribute access on unnumbered fields

2020-03-19 Thread Maxwell Bernstein


Maxwell Bernstein  added the comment:

Looks like the patch solves my problem, so I am going to update my PR sometime 
today.

--

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a36adfa6bbf5e612a4d4639124502135690899b8 by Victor Stinner in 
branch 'master':
bpo-39877: 4th take_gil() fix for daemon threads (GH-19080)
https://github.com/python/cpython/commit/a36adfa6bbf5e612a4d4639124502135690899b8


--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a36adfa6bbf5e612a4d4639124502135690899b8 by Victor Stinner in 
branch 'master':
bpo-39877: 4th take_gil() fix for daemon threads (GH-19080)
https://github.com/python/cpython/commit/a36adfa6bbf5e612a4d4639124502135690899b8


--

___
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: main regrtest process killed by SIGKILL (Signal 9)

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:

The bug still occurs time to time. AMD64 FreeBSD Non-Debug 3.x:
https://buildbot.python.org/all/#/builders/214/builds/475

--

___
Python tracker 

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



[issue39994] Redundant code in pprint module.

2020-03-19 Thread Palak Kumar Jha


Change by Palak Kumar Jha :


--
nosy: +fdrake
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



[issue33327] Add a method to move messages to IMAPlib

2020-03-19 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



[issue40000] Improve AST validation for Constant nodes

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:

> _PyType_Name(Py_TYPE(value)))

Why truncating the type name in the error message? The qualified name (don't 
call _PyType_Name()) should provide more information, no?

--

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not see any issue except that you was careless when read the documentation.

--

___
Python tracker 

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



[issue39969] Remove Param expression context from AST

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:

FYI this change broke the chameleon project:
https://github.com/malthe/chameleon/issues/303

Batuhan: You maybe want to propose a fix there. It shouldn't be hard to fix the 
issue.

--
nosy: +vstinner

___
Python tracker 

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



[issue27307] string.Formatter does not support key/attribute access on unnumbered fields

2020-03-19 Thread Maxwell Bernstein


Maxwell Bernstein  added the comment:

I'll take a look at the patch and see if this solves my problem. If it does, 
I'll update my PR with tests.

--

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum


Ram Rachum  added the comment:

Oops, my mistake. Any other idea how to solve this discrepancy?

--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-19 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18437
pull_request: https://github.com/python/cpython/pull/19080

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-19 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18438
pull_request: https://github.com/python/cpython/pull/19080

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

They are.

--

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum


Ram Rachum  added the comment:

Well, these aren't the textbook case of a constant, since they're enums, and 
not defined in the global namespace.

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18436
pull_request: https://github.com/python/cpython/pull/19079

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is very inconvenient to use single-letter lowercase names for constants. It 
contradicts PEP 8:

https://www.python.org/dev/peps/pep-0008/#constants

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum


Ram Rachum  added the comment:

As you can see I left the old uppercase enums defined, to avoid breaking 
backward compatibility. We could make them trigger a DeprecationWarning.

--

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum


Change by Ram Rachum :


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

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum


New submission from Ram Rachum :

Today I was tripped up by an inconsistency in the `re` docstring. I wanted to 
use DOTALL as a flag inside my regex, rather than as an argument to the 
`compile` function. Here are two lines from the docstring:

(?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below).
...
S  DOTALL  "." matches any character at all, including the newline.

The DOTALL flag appears as an uppercase S in 2 places, and as a lowercase s in 
one place. This is confusing, and I initially tried using the uppercase S only 
to get an error.

I'm attaching a PR to this ticket.

--
components: Library (Lib)
messages: 364617
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Clarify flag case in `re` module
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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-19 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18433
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19077

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-19 Thread miss-islington


miss-islington  added the comment:


New changeset 13397ee47d23fda2e8d4bef40c1df986457673d1 by Hai Shi in branch 
'master':
bpo-39824: Convert PyModule_GetState() to get_module_state() (GH-19076)
https://github.com/python/cpython/commit/13397ee47d23fda2e8d4bef40c1df986457673d1


--
nosy: +miss-islington

___
Python tracker 

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



[issue40014] os.getgrouplist() can fail on macOS

2020-03-19 Thread Ned Deily


Change by Ned Deily :


--
title: os.getgrouplist() fails on macOS of GH Actions (Azure) -> 
os.getgrouplist() can fail on macOS

___
Python tracker 

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



[issue40014] os.getgrouplist() fails on macOS of GH Actions (Azure)

2020-03-19 Thread Ned Deily

Ned Deily  added the comment:

This error has to do with the number of groups a particular user is associated 
with. We’ve squashed similar bugs in the past but it looks like something has 
changed again in recent releases of macOS. It’s not Azure specific.

--

___
Python tracker 

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



[issue40015] logging.Logger.disabled field is redundant

2020-03-19 Thread Venkatesh-Prasad Ranganath


Venkatesh-Prasad Ranganath  added the comment:

`logging.Logger.disabled` field is used in logging.config module to disable 
loggers during configuration.  Since the field is not redundant, the issue is 
invalid and, hence, should be closed.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.9

___
Python tracker 

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



[issue27307] string.Formatter does not support key/attribute access on unnumbered fields

2020-03-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

It would be good if someone could convert this to a pull request and beef up 
the tests.

--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-19 Thread hai shi


Change by hai shi :


--
pull_requests: +18432
pull_request: https://github.com/python/cpython/pull/19076

___
Python tracker 

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



[issue40015] logging.Logger.disabled field is redundant

2020-03-19 Thread Venkatesh-Prasad Ranganath


New submission from Venkatesh-Prasad Ranganath :

`logging.Logger.disabled` field is assigned `False` while initializing 
`logging.Logger` instance and never updated.  However, this field is also 
involved in two checks: 
https://github.com/python/cpython/blob/da1fe768e582387212201ab8737a1a5f26110664/Lib/logging/__init__.py#L1586
 and 
https://github.com/python/cpython/blob/da1fe768e582387212201ab8737a1a5f26110664/Lib/logging/__init__.py#L1681
 that are executed in the context of every logging method.  So, these checks 
are likely to contribute to unnecessary computation while logging.

Further, since the library documentation does not mention this field, the field 
is probably not part of the public API of the logging library.  So, the field 
seems to be redundant.

Given the checks on the hot paths are redundant as the field never changes 
value and fields is not part of the public API, removing it will help improve 
logging performance and simplify the code base.

--
components: Library (Lib)
messages: 364612
nosy: rvprasad
priority: normal
severity: normal
status: open
title: logging.Logger.disabled field is redundant
type: performance
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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5a3a71dddbe80edc75a3a74ce3b7978cf8635901 by Victor Stinner in 
branch 'master':
bpo-40010: Optimize signal handling in multithreaded applications (GH-19067)
https://github.com/python/cpython/commit/5a3a71dddbe80edc75a3a74ce3b7978cf8635901


--

___
Python tracker 

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



[issue40014] os.getgrouplist() fails on macOS of GH Actions (Azure)

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:

These errors are really strange.

Steve Dower: are you aware of anything recent change on the macOS job of Azure 
Pipelines / GH Actions.

pythoninfo:
---
os.uname: posix.uname_result(sysname='Darwin', nodename='Mac-1422.local', 
release='19.3.0', version='Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 
PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64', machine='x86_64')

platform.architecture: 64bit

platform.platform: macOS-10.15.3-x86_64-i386-64bit
---


> example: 
> https://github.com/python/cpython/pull/19073/checks?check_run_id=519539592

./python.exe -m test.pythoninfo
ERROR: collect_pwd() failed
Traceback (most recent call last):
  File 
"/Users/runner/runners/2.165.2/work/cpython/cpython/Lib/test/pythoninfo.py", 
line 761, in collect_info
collect_func(info_add)
  File 
"/Users/runner/runners/2.165.2/work/cpython/cpython/Lib/test/pythoninfo.py", 
line 336, in collect_pwd
groups = os.getgrouplist(entry.pw_name, entry.pw_gid)
OSError: [Errno 0] Error

Collection failed: exit with error


> PR 19075

test_posix.test_getgrouplist() failed with:

==
ERROR: test_getgrouplist (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File 
"/Users/runner/runners/2.165.2/work/cpython/cpython/Lib/test/test_posix.py", 
line 1028, in test_getgrouplist
self.assertIn(group, posix.getgrouplist(user, group))
OSError: [Errno 25] Inappropriate ioctl for device

--
components: +macOS
nosy: +ned.deily, ronaldoussoren, steve.dower
title: os.getgrouplist can raise OSError during the Display build info -> 
os.getgrouplist() fails on macOS of GH Actions (Azure)
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



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

2020-03-19 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 77248a28896d39cae0a7e084965b9ffc2624b7f4 by Dong-hee Na in branch 
'master':
bpo-1635741: Port _collections module to multiphase initialization (GH-19074)
https://github.com/python/cpython/commit/77248a28896d39cae0a7e084965b9ffc2624b7f4


--

___
Python tracker 

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



[issue40014] os.getgrouplist can raise OSError during the Display build info

2020-03-19 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue40014] os.getgrouplist can raise OSError during the Display build info

2020-03-19 Thread Dong-hee Na


Dong-hee Na  added the comment:

or adding  might be great just like getpwuid

--

___
Python tracker 

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



[issue40014] os.getgrouplist can raise OSError during the Display build info

2020-03-19 Thread Dong-hee Na


New submission from Dong-hee Na :

example: 
https://github.com/python/cpython/pull/19073/checks?check_run_id=519539592

I suggest to not to add information for os.getgrouplist
if the OSError is raised.

--
components: Tests
messages: 364607
nosy: corona10, vstinner
priority: normal
severity: normal
status: open
title: os.getgrouplist can raise OSError during the Display build info
type: enhancement

___
Python tracker 

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



[issue27307] string.Formatter does not support key/attribute access on unnumbered fields

2020-03-19 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +tekknolagi

___
Python tracker 

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



[issue27307] string.Formatter does not support key/attribute access on unnumbered fields

2020-03-19 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue39985] str.format and string.Formatter subscript behaviors diverge

2020-03-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

In fact, this is a duplicate of issue27307, so I'm going to close this.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> string.Formatter does not support key/attribute access on 
unnumbered fields

___
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-03-19 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +18430
pull_request: https://github.com/python/cpython/pull/19074

___
Python tracker 

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



[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-03-19 Thread szb512


szb512  added the comment:

I'll update my PR to include some changes for windows.

--
nosy: +alittleman512

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-03-19 Thread Matej Cepl


Change by Matej Cepl :


--
pull_requests: +18428
pull_request: https://github.com/python/cpython/pull/19073

___
Python tracker 

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



[issue33327] Add a method to move messages to IMAPlib

2020-03-19 Thread Matej Cepl


Change by Matej Cepl :


--
keywords: +patch
pull_requests: +18427
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/19072

___
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-03-19 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +18426
pull_request: https://github.com/python/cpython/pull/19071

___
Python tracker 

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



[issue39985] str.format and string.Formatter subscript behaviors diverge

2020-03-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

Can you see if the patch in issue27307 solves your problem?

--

___
Python tracker 

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



[issue40012] Avoid Python 2 documentation to appear in Web search results

2020-03-19 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +mdk

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-19 Thread Stefan Krah


Stefan Krah  added the comment:

The lower MAX_PREC for 32-bit could be the reason.

On the other hand, historically, suncc and xlc have had a lot of
problems with the 64-bit build. The winner is suncc, which seriously
miscompiled libmpdec without a whole litany of flags:

https://bugs.python.org/issue15963#msg170661


This is why I keep insisting on experimenting with obscure flags,
but of course the actual cause may be different.

--

___
Python tracker 

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



[issue40000] Improve AST validation for Constant nodes

2020-03-19 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-03-19 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-03-19 Thread miss-islington


miss-islington  added the comment:


New changeset ec8a973f7cf080d9c0679f058b2371f0b7c7862c by Miss Islington (bot) 
in branch '3.8':
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL 
(GH-18968)
https://github.com/python/cpython/commit/ec8a973f7cf080d9c0679f058b2371f0b7c7862c


--

___
Python tracker 

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-03-19 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +18425
pull_request: https://github.com/python/cpython/pull/19070

___
Python tracker 

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-03-19 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 9052f7a41b90f2d34011c8da68f9a4facebc8a97 by Batuhan Taşkaya in 
branch 'master':
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL 
(GH-18968)
https://github.com/python/cpython/commit/9052f7a41b90f2d34011c8da68f9a4facebc8a97


--

___
Python tracker 

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



[issue40000] Improve AST validation for Constant nodes

2020-03-19 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 0ac59f93c0e3f91fd994d7245578cce65654fb22 by Batuhan Taşkaya in 
branch 'master':
bpo-4: Improve error messages when validating invalid ast.Constant nodes 
(GH-19055)
https://github.com/python/cpython/commit/0ac59f93c0e3f91fd994d7245578cce65654fb22


--
nosy: +pablogsal

___
Python tracker 

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



[issue39656] shebanged scripts can escape from `venv` depending on how it was created

2020-03-19 Thread Vinay Sajip


Change by Vinay Sajip :


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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-03-19 Thread hai shi


Change by hai shi :


--
pull_requests: +18424
pull_request: https://github.com/python/cpython/pull/19069

___
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-03-19 Thread hai shi


Change by hai shi :


--
pull_requests: +18423
pull_request: https://github.com/python/cpython/pull/19069

___
Python tracker 

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



[issue40013] CSV DictReader parameter documentation

2020-03-19 Thread Moshe Sambol


New submission from Moshe Sambol :

The csv.DictReader constructor takes two optional parameters, restkey and 
restval. restkey is documented well, but restval is not:

"If a row has more fields than fieldnames, the remaining data is put in a list 
and stored with the fieldname specified by restkey (which defaults to None). If 
a non-blank row has fewer fields than fieldnames, the missing values are 
filled-in with None."

Since restval is not mentioned here, the reader may assume that the next 
sentence applies to it:

"All other optional or keyword arguments are passed to the underlying reader 
instance."

But this is not the case for restval.

I suggest that the text be amended to 

"If a non-blank row has fewer fields than fieldnames, the missing values are 
filled-in with the value of restval (which defaults to None)."

--
assignee: docs@python
components: Documentation
messages: 364598
nosy: Moshe Sambol, docs@python
priority: normal
severity: normal
status: open
title: CSV DictReader parameter documentation
versions: 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



[issue31046] ensurepip does not honour the value of $(prefix)

2020-03-19 Thread Matej Cepl


Change by Matej Cepl :


--
pull_requests: +18422
pull_request: https://github.com/python/cpython/pull/19068

___
Python tracker 

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



[issue40012] Avoid Python 2 documentation to appear in Web search results

2020-03-19 Thread Peter Bittner


New submission from Peter Bittner :

Currently, when you do a Web search (e.g. using Google, Bing, Yahoo!, 
DuckDuckGo, et al.) for a Python module or function call you'll find a link to 
the related Python 2 documentation first.

How to reproduce:

1. Search for simply "os.environ" in your favorite search engine.
2. Find a link to the Python documentation in the first 3 results. Typically, 
this will point to the Python 2 docs first.

(Side note: Google seems to now actively manipulate the results ranking Python 
3 results higher. Apparently, this is the only popular search engine behaving 
like that.)

Expected result:

- When searching for Python modules, functions, builtins, etc. on the Web, no 
search results for Python 2 should pop up at all if the same content exists for 
Python 3

Possible implementation:

- Add a "noindex" meta tag to the header of the generated HTML documentation
- see https://support.google.com/webmasters/answer/93710

--
messages: 364597
nosy: bittner
priority: normal
severity: normal
status: open
title: Avoid Python 2 documentation to appear in Web search results
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-19 Thread Bharat Solanki


Bharat Solanki  added the comment:

Hi Tim,

Thank you for clearing that up.

I ran the same code in 2.7 and 3.7 on Windows, Its showing the same error.
Yes, Its running in Linux-y systems. It depends on OS.

Regards,
Bharat

On Thu, Mar 19, 2020 at 2:25 AM Tim Peters  wrote:

>
> Tim Peters  added the comment:
>
> u1 is a global _only_ in a process that runs `function()`, which declares
> u1 global and assigns it a value.  You have no sane expectation that a
> worker process (none of which run `function()`) will know anything about it.
>
> Are you sure you're running 2.7 and 3.7 on the same machine?  It's
> impossible that this code ever "worked" under Windows, but it might under
> Linux-y systems, which use `fork()` to create worker processes.
>
> The traceback you showed was obviously run under Windows.  Under Python
> 2.7.11 on Windows, I get the same kind of error:
>
> NameError: global name 'u1' is not defined
>
> This is the code:
>
> from multiprocessing import Pool
> import traceback
>
> class Utils:
> def __init__(self):
>self.count = 10
>
> def function():
> global u1
> u1 = Utils()
> l1 = range(3)
> process_pool = Pool(1)
> try:
> process_pool.map(add, l1, 1)
> process_pool.close()
> process_pool.join()
> except Exception as e:
> process_pool.terminate()
> process_pool.join()
> print(traceback.format_exc())
> print(e)
>
> def add(num):
>  total = num + u1.count
>  print(total)
>
> if __name__ == "__main__":
> function()
>
> --
> nosy: +tim.peters
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40007] An attempt to make asyncio.transport.writelines (selector) use Scatter I/O

2020-03-19 Thread tzickel


tzickel  added the comment:

BTW, if wanted a much more simpler PR can be made, where writelines simply 
calls sendmsg on the input if no buffer exists, and if not only then concats 
and acts like the current code base.

--

___
Python tracker 

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



[issue39974] A race condition with GIL releasing exists in stringlib_bytes_join

2020-03-19 Thread Bruce Merry


Bruce Merry  added the comment:

+tzickel I'd suggest reading the discussion in issue 36051, and maybe raising a 
new issue about it if you still have concerns. In short, dropping the GIL in 
more bytes.join cases wouldn't necessarily be wrong, but it might break code 
that made the assumption that bytes.join is atomic even though that's never 
been claimed.

--

___
Python tracker 

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