[issue43317] python -m gzip could use a larger buffer

2021-02-25 Thread Ruben Vorderman


Change by Ruben Vorderman :


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

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> _pysqlite_query_execute() has one coverage gap: lines 478-488 (if 
> (self->statement->in_use)) are never executed.

I wonder if it is possible at all to reach this branch. If it is not, then I'm 
pretty sure Cursor.in_use is redundant, and all code relating to it can be 
removed.

--

___
Python tracker 

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



[issue43318] pdb can't output the prompt message when successfully clear breakpoints by "filename:lineno"

2021-02-25 Thread huzhaojie


Change by huzhaojie :


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

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread Inada Naoki


Inada Naoki  added the comment:

I prefer `sys.exit("message")`.

--
nosy: +methane

___
Python tracker 

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



[issue43318] pdb can't output the prompt message when successfully clear breakpoints by "filename:lineno"

2021-02-25 Thread huzhaojie


New submission from huzhaojie :

In Pdb, when successfully clear breakpoints, the Pdb should output a 
message:"Deleted XXX", but when breakpoints are cleared by filename:lineno, the 
message can't be output.

I think it's related to the following code.

```python
pdb.py:

def do_clear(self, arg):
...
  
if ':' in arg:
# Make sure it works for "clear C:\foo\bar.py:12"
i = arg.rfind(':')
filename = arg[:i]
arg = arg[i+1:]
try:
lineno = int(arg)
except ValueError:
err = "Invalid line number (%s)" % arg
else:
bplist = self.get_breaks(filename, lineno)
err = self.clear_break(filename, lineno)
if err:
self.error(err)
else:
for bp in bplist:
self.message('Deleted %s' % bp)
return
```
self.get_breaks is called to get the breakpoints to be deleted,  the result is 
in bplist. self.clear_break is called to delete the breakpoints in bplist. Each 
element in bplist is a reference to a Breakpoint object, so when all Breakpoint 
objects are removed, the bplist will become an empty list when self.clear_break 
is called, so pdb can't output the prompt message.

It can be simply fixed by following code:
```python
bplist = self.get_breaks(filename, lineno)[:]
```

--
title: pdb can't output the prompt message when successfully clear a breakpoint 
by "filename:lineno" -> pdb can't output the prompt message when successfully 
clear breakpoints by "filename:lineno"

___
Python tracker 

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



[issue43311] bpo-43311: PyInterpreterState_New use thread-specific data tstate before key create .

2021-02-25 Thread junyixie


Change by junyixie :


--
title: PyInterpreterState_New use thread tstate before set. -> bpo-43311: 
PyInterpreterState_New use thread-specific data tstate before key create .

___
Python tracker 

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



[issue43319] A possible misleading expression in the Virtual Environment Tutorial

2021-02-25 Thread cmhzc


Change by cmhzc :


--
assignee: docs@python
components: Documentation
nosy: cmhzc, docs@python
priority: normal
severity: normal
status: open
title: A possible misleading expression in the Virtual Environment Tutorial
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

That sounds perfect, I didn't think of that. I will make a PR.

--

___
Python tracker 

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



[issue12594] Docs for "Using Python on a Macintosh" needs to be updated

2021-02-25 Thread cmhzc

cmhzc  added the comment:

According to the official tutorial on virtual environment,

"""
This will create the tutorial-env directory if it doesn’t exist, and also 
create directories inside it containing a copy of the Python interpreter, **the 
standard library**, and various supporting files.
"""

But according to PEP 405 and the actual behavior of venv, the standard library 
won't be copied. I'm not sure if I'm having a misunderstanding of this 
expression.

--
nosy: +cmhzc
versions:  -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue43319] A possible misleading expression in the Virtual Environment Tutorial

2021-02-25 Thread cmhzc

New submission from cmhzc :

According to the official tutorial on virtual environment,

"""
This will create the tutorial-env directory if it doesn’t exist, and also 
create directories inside it containing a copy of the Python interpreter, **the 
standard library**, and various supporting files.
"""

But according to PEP 405 and the actual behavior of venv, the standard library 
won't be copied. I'm not sure if I'm having a misunderstanding of this 
expression.

--

___
Python tracker 

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



[issue43311] bpo-43311: PyInterpreterState_New use thread-specific data tstate before key create .

2021-02-25 Thread junyixie


junyixie  added the comment:

PyInterpreterState_New call and use PyThreadState *tstate = 
_PyThreadState_GET();

_PyRuntime.gilstate.autoTSSkey has to be initialized before 
pthread_getspecific() or pthread_setspecific() can be used.

_PyRuntime.gilstate.autoTSSkey create in _PyGILState_Init. 
PyInterpreterState_New called before _PyGILState_Init.

--

___
Python tracker 

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



[issue12594] Docs for "Using Python on a Macintosh" needs to be updated

2021-02-25 Thread cmhzc


cmhzc  added the comment:

sorry for posting a wrong message in this issue tracker, this is my first time 
using the Python issue tracker

--

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread Ruben Vorderman


Change by Ruben Vorderman :


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

___
Python tracker 

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



[issue25585] Bad path leads to: ImportError: DLL load failed: %1 is not a valid Win32 application.

2021-02-25 Thread Eryk Sun

Eryk Sun  added the comment:

In 3.8+, the DLL search path for dependent DLLs when importing extension 
modules excludes PATH and the current working directory. So it's far less 
likely for an import to fail with ERROR_BAD_EXE_FORMAT.

Currently the error message in Python 3 includes the base name of the extension 
module, e.g. "DLL load failed while importing _spam". No error codes are 
special cased to use custom error messages, so it still includes the localized 
error text from the system, which may contain parameterized inserts (%). 

The common errors when importing an extension module are missing and mismatched 
dependent DLLs: ERROR_MOD_NOT_FOUND (126) and ERROR_PROC_NOT_FOUND (127). The 
system messages for these two errors do not contain inserts. For example, if 
the UI language is Japanese, a missing DLL dependency raises the following 
exception:

ImportError: DLL load failed while importing _spam: 指定されたモジュールが見つかりません。

--
components: +Extension Modules
type:  -> behavior
versions: +Python 3.10, Python 3.9 -Python 2.7

___
Python tracker 

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



[issue26658] test_os fails when run on Windows ramdisk

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

os.stat() was redesigned in issue 37834, which entailed extensive updates 
across the standard library to improve support for Windows reparse points. As 
part of this,  Win32JunctionTests.tearDown() was changed to use a more reliable 
lexists() check, which resolves this issue.

FYI, the new implementation of os.stat() supports an ImDisk virtual disk 
(v2.0.9 from 2015-12). In the following example, "junctest" is a mountpoint 
(junction) in an NTFS filesystem. The filesystem is mounted on an ImDisk 
device, as seen its VOLUME_NAME_NT (2) path:

>>> flags = win32file.FILE_FLAG_OPEN_REPARSE_POINT
>>> flags |= win32file.FILE_FLAG_BACKUP_SEMANTICS
>>> h = win32file.CreateFile('junctest', 0, 0, None, 3, flags, None)
>>> win32file.GetFinalPathNameByHandle(h, 2)
'\\Device\\ImDisk0\\junctest'

stat() traverses the mountpoint:

>>> os.stat('junctest').st_reparse_tag == 0
True

lstat() opens the mountpoint:

>>> os.lstat('junctest').st_reparse_tag == stat.IO_REPARSE_TAG_MOUNT_POINT
True

This version of Imdisk doesn't support the mountpoint manager, so trying to get 
the VOLUME_NAME_DOS (0) name of r"\Device\ImDisk0" (e.g. r"\\?\R:") still fails 
the same as before:

>>> win32file.GetFinalPathNameByHandle(h, 0)
Traceback (most recent call last):
  File "", line 1, in 
pywintypes.error: (1, 'GetFinalPathNameByHandle', 'Incorrect function.')

But os.stat() no longer needs it.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
superseder:  -> readlink on Windows cannot read app exec links

___
Python tracker 

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



[issue26866] Inconsistent environment in Windows using "Open With"

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> I wonder if it is possible at all to reach this branch. If it is not, then 
> I'm pretty sure Cursor.in_use is redundant

Typo: should be Statement.in_use

Corner error cases may cause the _pysqlite_query_execute() loop to exit without 
pysqlite_statement_reset() being called, thus leaving Statement.in_use == 1, 
but when _pysqlite_query_execute() is called again and if there's an active 
statement, pysqlite_statement_reset() will reset in_use to zero, before we ever 
reach the if (self->statement->in_use) { ... } statement.

I can open a separate issue for considering removing Statement.in_use.


> (I assume only valid Statement objects are added to the cache.)

AFAICS, this is true.


We can wait for Berker and/or Serhiy to confirm/correct my assumptions and 
findings.

--

___
Python tracker 

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



[issue26968] glob.glob incorrect results under windows when pathname exists but interpreter does not have access permissions to pathname

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

Issue 28075 extended the os.stat() and os.lstat() implementation to query basic 
stat informatiom from the parent directory if opening the file fails with 
ERROR_ACCESS_DENIED. This change first became available in Python 3.5.3. 

Previously it was only querying the parent directory for the case of 
ERROR_SHARING_VIOLATION, which is unlikely since the open doesn't request and 
data access that requires sharing. It does handle one case that I know of. NTFS 
refuses to share even metadata access for a system paging file such as 
"C:\pagefile.sys".

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
superseder:  -> os.stat fails when access is denied

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset cc3df6368d4f3f6c9c9b716876c7e7b79c7abf3f by Ruben Vorderman in 
branch 'master':
bpo-43316:  gzip: CLI uses non-zero return code on error. (GH-24647)
https://github.com/python/cpython/commit/cc3df6368d4f3f6c9c9b716876c7e7b79c7abf3f


--

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23434
pull_request: https://github.com/python/cpython/pull/24649

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread miss-islington


miss-islington  added the comment:


New changeset 69906c505b139cbd892866dbceeb607eff53ab3b by Miss Islington (bot) 
in branch '3.8':
bpo-43316:  gzip: CLI uses non-zero return code on error. (GH-24647)
https://github.com/python/cpython/commit/69906c505b139cbd892866dbceeb607eff53ab3b


--

___
Python tracker 

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



[issue43318] pdb can't output the prompt message when successfully clear breakpoints by "filename:lineno"

2021-02-25 Thread Irit Katriel


Irit Katriel  added the comment:

Please provide instructions how to reproduce the bug. The patch would need a 
unit test as well.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Look at issue in which the workaround was added. Does it contain some examples?

--

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> Look at issue in which the workaround was added. Does it contain some 
> examples?

I'll check. Thanks.

--

___
Python tracker 

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



[issue20140] UnicodeDecodeError in ntpath.py when home dir contains non-ascii signs

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Erlend Egeberg Aasland

Erlend Egeberg Aasland  added the comment:

Introduced by Christian Heimes 2007-12-14 in commit 
380532117c2547bb0dedf6f85efa66d18a9abb88, which is a merge from SVN (?) checkin 
r59471 by Gerhard Häring 
(https://mail.python.org/pipermail/python-checkins/2007-December/063968.html)

This corresponds to 
https://github.com/ghaering/pysqlite/commit/61b3cd9381750bdd96f8f8fc2c1b19f1dc4acef7,
 with a simple test added two commits later, 
https://github.com/ghaering/pysqlite/commit/7b0faed4ababbf1053caa2f5b2efc15929f66c4f
 That test was added to CPython in 2008-03-29 by Gerhard in commit 
e7ea7451a84636655927da4b9731d2eb37d1cf34, and it's still here.

--

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Christian Heimes


Christian Heimes  added the comment:

Back in the day I was of several core devs that took care of syncing code 
between Python 2 and 3 branches with a tool called "svnmerge". Commit 
380532117c2547bb0dedf6f85efa66d18a9abb88 is a svnmerge commit. The tool synced 
changesets in batches, which makes it harder to bisect changes.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue27889] ctypes interfers with signal handling

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


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



[issue43318] pdb can't output the prompt message when successfully clear breakpoints by "filename:lineno"

2021-02-25 Thread huzhaojie


huzhaojie  added the comment:

Accroding to my test, it appears in python 3.8.0 and the latest 3.10 master 
branch, and I think other versions also have this bug.

The steps to reproduce the bug:

1. start pdb: python -m pdb foo.py

2. set a breakpoint on any line of the file:

(Pdb) b 2
Breakpoint 1 at foo.py:2
(Pdb) b
Num Type Disp Enb   Where
1   breakpoint   keep yes   at foo.py:2

3. when clear the breakpoint using breakpoint number, it will get a 
output("Deleted breakpoint 1 at ..."):

(Pdb) cl 1
Deleted breakpoint 1 at foo.py:2

4. set another breakpoint:

(Pdb) b 3
Breakpoint 2 at foo.py:3

5. if breakpoint is cleared using (filename:lineno), it gets nothing:

(Pdb)cl foo.py:2
(Pdb)

--

___
Python tracker 

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



[issue28356] Windows: os.rename different in python 2.7.12 and python 3.5.2

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

The documentation of os.rename() should mention that on Windows the "operation 
will fail if src and dst are on different filesystems". For POSIX, instead of 
"will" it says "may", but the failure is a certainty in Windows since 
MOVEFILE_COPY_ALLOWED isn't used.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage:  -> needs patch
versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 -Python 
2.7

___
Python tracker 

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



[issue28364] Windows - Popen (subprocess.py) does not call _handle.Close() at all

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Ah, at last I found the source of the confusion: The SQLite changelog.

Quoting from msg387619 and https://sqlite.org/changes.html:

> From the SQLite 3.5.3 changelog:
> - sqlite3_step() returns SQLITE_MISUSE instead of crashing when called with a 
> NULL parameter.

I assumed this was correct without even trying it. This short snippet shows 
something else:

int rc = sqlite3_reset(NULL);
printf("reset with NULL: %d %s\n", rc, sqlite3_errstr(rc));

$ ./a.out
reset with NULL: 0 not an error


Gerhard's comment was right and the workaround was right. I'll adjust the 
comment.

Dong-hee Na:
> Hmm by the way the current implementation returns SQLITE_OK if the statement 
> is NULL, but it looks like return SQLITE_MISUSE if we apply this patch.
> Does it not cause any behavior regression? if so we should add news also.

Behaviour stays the same; no regressions introduced. I learned a lot about the 
sqlite3 module, and I relearned I should not trust changelogs/documentation 
without trying stuff myself first.

I'll adjust the erroneous comment and re-request a review, Dong-hee.

--

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> int rc = sqlite3_reset(NULL);
>printf("reset with NULL: %d %s\n", rc, sqlite3_errstr(rc));

Sorry, wrong test:

int rc = sqlite3_step(NULL);
printf("step with NULL: %d %s\n", rc, sqlite3_errstr(rc));

$ ./a.out
step with NULL: 21 bad parameter or other API misuse

--

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

msg387668 was a little bit hasty. I'll try again:

Dong-hee Na:
> Hmm by the way the current implementation returns SQLITE_OK if the statement 
> is NULL, but it looks like return SQLITE_MISUSE if we apply this patch.
> Does it not cause any behavior regression? if so we should add news also.

No, behaviour still stays the same; no regressions introduced. The bug is 
triggered by executing an empty statement. This will pass an empty statement to 
pysqlite_step() in line 519 of Modules/_sqlite/cursor.c. Earlier, this returned 
SQLITE_OK. sqlite3_column_count(NULL) returns 0, so we slide through the rest 
of the loop without much happening. Now, pysqlite_step() returns SQLITE_MISUSE, 
which only results in the statement being reset in line 529, and the error 
cleared in line 530. Then we bail out of the loop.

So, the current comment is correct, the SQLite changelog was correct, the 
workaround and old comment was wrong.

I'm done :)

--

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-25 Thread twoone3


twoone3 <3197653...@qq.com> added the comment:

Run Project1\x64\Release\Project2.exe

--

___
Python tracker 

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



[issue43320] test test_webbrowser "can't locate runnable browser" with enable-optimizations

2021-02-25 Thread Fabian Beitler


New submission from Fabian Beitler :

I downloaded the sources for python 3.8.8 (not tested with Python3.9.2. so 
far)and compiled it 
with enabled-optimisations parameter on a fresh Ubuntu 20.04 machine.

Beside the test_ssl error (there is an existing workaround, but still not happy 
with that one tbh) I could solve, the test "test_webbrowser" fails and I don't 
know how to handle that one.


ERROR: test_synthesize(test_webbrowser.ImportTest)

Traceback (most recent call last):
   File "Path/Python-3.8.8/Lib/test/test_webbrowser.py", line 299, in 
test_synthesize
   webbrowser.get(sys.executable)
File "Path/Python-3.8.8/Lib/webbrowser.py", line 65, in get 
raise Error("could not locate runnable browser")
webbrowser.Error: could not locate runnable browser

--
components: Tests
messages: 387672
nosy: swamper123
priority: normal
severity: normal
status: open
title: test test_webbrowser "can't locate runnable browser" with 
enable-optimizations
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



[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

Here's an example of how to change the isatty() method in Modules/_io/fileio.c 
to check for a console in Windows:

_io_FileIO_isatty_impl(fileio *self)
{
long res;

if (self->fd < 0)
return err_closed();
Py_BEGIN_ALLOW_THREADS
_Py_BEGIN_SUPPRESS_IPH
res = isatty(self->fd);
#ifdef MS_WINDOWS
if (res) {
DWORD mode;
HANDLE h = (HANDLE)_get_osfhandle(self->fd);
// It's a console if GetConsoleMode succeeds or if the last error
// isn't ERROR_INVALID_HANDLE. e.g., if 'con' is opened with 'w'
// mode, the error is ERROR_ACCESS_DENIED.
res = GetConsoleMode(h, &mode) ||
GetLastError() != ERROR_INVALID_HANDLE;
}
#endif
_Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
return PyBool_FromLong(res);
}

--
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.10, Python 3.9 -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-25 Thread Mark Dickinson


Mark Dickinson  added the comment:

@twoone3: Shouldn't you be calling PyGILState_Ensure() before calling into 
Python from the C++ code?

In any case, I'm removing myself from the nosy list on this issue, because I 
don't have access to Windows to try to reproduce.

--

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-25 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-25 Thread twoone3


twoone3 <3197653...@qq.com> added the comment:

After adding GIL, the problem still exists. If you think this problem is 
incomprehensible, it may be because I used Google Translation ..

--
Added file: https://bugs.python.org/file49835/Screenshot_20210225_224118.jpg

___
Python tracker 

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



[issue28824] os.environ should preserve the case of the OS keys ?

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

In Windows, maybe the os.environ mapping could use a case-insensitive subclass 
of str for its keys, such as the following:

@total_ordering
class _CaseInsensitiveString(str):
def __eq__(self, other):
if not isinstance(other, str):
return NotImplemented
return self.upper() == other.upper()

def __lt__(self, other):
if not isinstance(other, str):
return NotImplemented
return self.upper() < other.upper()

def __hash__(self):
return hash(self.upper())

Change encodekey() to use this type. For example:

def encodekey(key):
return _CaseInsensitiveString(encode(key))

in which encode() is still check_str().

--
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.10, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue42914] pprint numbers with underscore

2021-02-25 Thread Stéphane Blondon

Stéphane Blondon  added the comment:

I add the same idea but later than you, so I'm interested by such feature.

Felipe: do you want to add a pull request to this issue (with Serhiy Storchaka 
implementation because it's the simplest one)?

If not, I plan to write it.
I will write it too if there is no reply in one month.

--
nosy: +sblondon

___
Python tracker 

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



[issue43144] test_unicodedata: test_normalization uses network but doesn't depend on network resource

2021-02-25 Thread Ammar Askar


Change by Ammar Askar :


--
nosy: +ammar2
nosy_count: 3.0 -> 4.0
pull_requests: +23435
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24650

___
Python tracker 

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



[issue42914] pprint numbers with underscore

2021-02-25 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue37609] support "UNC" device paths in ntpath.splitdrive

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


Removed file: https://bugs.python.org/file48607/splitdrive.py

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Robert


New submission from Robert :

When PY_SSIZE_T_CLEAN  is not #defined in Py3.10, PyArg_ParseTuple() etc. sets 
a SystemError but the return value says 1 (=SUCCESS)! 
=>  Causes terrific crashes with unfilled variables - instead of a clean Python 
exception.

Background: pywin32 suffers in masses from the drop of int support for the 
s#/y#/et#... formats in PyArg_ParseTuple() etc.  (PY_SSIZE_T_CLEAN is required 
in Py3.10). And only part of the source is already PY_SSIZE_T_CLEAN. Now it is 
very difficult to even run tests and weed out / check, because of freezes 
instead of nice Python exceptions.

=> Instead of preventing such freezes, the PY_SSIZE_T_CLEAN mechanism became 
the opposite: a clever trap, a sword of Damocles :)


The cause is in getargs.c:

=== getargs.c / convertsimple() 

#define REQUIRE_PY_SSIZE_T_CLEAN \
if (!(flags & FLAG_SIZE_T)) { \
PyErr_SetString(PyExc_SystemError, \
"PY_SSIZE_T_CLEAN macro must be defined for '#' 
formats"); \
return NULL; \
}
#define RETURN_ERR_OCCURRED return msgbuf

===


=> The return NULL is further processed as no msg NULL -> no error.  
=> Perhaps it should be a `return converterr(...)` or `return 
sstc_system_error(...)` !?

--
components: Interpreter Core
messages: 387678
nosy: kxrob
priority: normal
severity: normal
status: open
title: PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing 
data (when PY_SSIZE_T_CLEAN  not #define'd)
type: crash
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



[issue43322] Inconsistent '#include' notation in extensions tutorial doc

2021-02-25 Thread Matthew Hughes


New submission from Matthew Hughes :

Just a small thing in these docs, there is a mix of "#include 
", e.g. 
https://github.com/python/cpython/blame/master/Doc/extending/newtypes_tutorial.rst#L243
 and '#include "structmember.h"', mostly in the included samples e.g. 
https://github.com/python/cpython/blob/master/Doc/includes/custom2.c#L3. Should 
these all be the same?

--
assignee: docs@python
components: Documentation
messages: 387679
nosy: docs@python, mhughes
priority: normal
severity: normal
status: open
title: Inconsistent '#include' notation in extensions tutorial doc
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



[issue28708] Low FD_SETSIZE limit on Windows

2021-02-25 Thread Anastasia Stefanyuk


Anastasia Stefanyuk  added the comment:

Hello! This piece of code is kind of a pain to solve, I guess you can somehow 
use the information here: 
https://mobilunity.com/blog/hire-sap-full-stack-developer/ - this will 
definitely help in some way or another.

--
nosy: +stefanyuk.ana

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


--
Removed message: https://bugs.python.org/msg387680

___
Python tracker 

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



[issue22302] Windows os.path.isabs UNC path bug

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

> figure out whether to do `Path.cwd() / path`

Thus a UNC path is absolute, i.e. any path that starts with 2 or more slashes, 
and all other paths are relative unless they have both a drive and a root. For 
example:

def isabs(s):
"""Test whether a path is absolute"""
s = os.fspath(s)
seps = _get_bothseps(s)
if len(s) > 1 and s[0] in seps and s[1] in seps:
return True
drive, rest = splitdrive(s)
if drive and rest:
return rest[0] in seps
return False

This also fixes the mistaken result that a rooted path such as "/spam" is 
absolute. When opened directly, a rooted path is relative to the drive of the 
current working directory. When accessed indirectly as the target of a symlink, 
a rooted path is relative to the volume device of the opened path. 

An example of the latter is a symlink named "link" that targets "\". If it's 
accessed as E:\link, it resolves to E:\. If it's accessed as 
C:\Mount\VolumeE\link, it resolves instead to C:\. The relative link resolves 
differently depending on the path traversed to access it. (Note that when 
resolving the target of a relative symlink, mountpoints such as "VolumeE" that 
are traversed in the opened path do not get replaced by their target path, 
unlike directory symlinks, which do get replaced by their target path. This 
behavior is basically the same as the way mountpoints and symlinks are handled 
in Unix.)

--
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 
3.7

___
Python tracker 

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



[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

This issue affects Windows 7 and earlier, so I'm changing the affected version 
to Python 3.8, the last version to support Windows 7. I don't have access to 
Windows 7 currently. If someone has access to an updated Windows 7 installation 
(all required and optional updates) and has the free time to check this, please 
confirm whether resolving forwarded functions still fails when "python3.dll" is 
loaded with LOAD_WITH_ALTERED_SEARCH_PATH. Also, check the newer flags added by 
KB2533623: LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR. 
The update to support these flags may align the behavior with Windows 8.1 and 
10.

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

___
Python tracker 

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



[issue30460] file opened for updating cannot write after read

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


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



[issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> works for me
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



[issue26111] On Windows, os.scandir will keep a handle on the directory until the iterator is exhausted

2021-02-25 Thread Steve Dower


Steve Dower  added the comment:

> FYI, in Windows 10, deleting files and directories now tries a POSIX delete

Yeah, FWIW, I haven't been able to get clear guidance on what I can/cannot 
publicly announce we've done in this space. But since you've found it I guess I 
can say sorry that I couldn't announce it more loudly! :)

A number of our other issues should be able to be closed soon once the changes 
get out in the open.

--

___
Python tracker 

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



[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Steve Dower


Steve Dower  added the comment:

I'm not sure we ever meant for LoadLibrary("python3.dll") to actively load the 
concrete python3X.dll. The APIs are the same, so you can (should) LoadLibrary 
the one that you want.

It's when you use static imports in extensions that it matters, but in that 
case it's ensured that both python3X.dll and python3.dll are already loaded.

I guess somewhere we just need to specify that python3.dll is for python3.lib, 
and not for LoadLibrary? I'm not even sure where the existing documentation is 
that we would change.

--

___
Python tracker 

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



[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2021-02-25 Thread Anders Kaseorg

New submission from Anders Kaseorg :

We ran into a UnicodeEncodeError exception using email.parser to parse this 
email 
,
 with full headers available in the raw archive 
.  The 
offending header is hilariously invalid:

Content-Type: text/plain; charset*=utf-8”''utf-8%E2%80%9D

but I’m filing an issue since the parser is intended to be robust against 
invalid input.  Minimal reproduction:

>>> import email, email.policy
>>> email.message_from_bytes(b"Content-Type: text/plain; 
>>> charset*=utf-8\xE2\x80\x9D''utf-8%E2%80%9D", policy=email.policy.default)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.10/email/__init__.py", line 46, in 
message_from_bytes
return BytesParser(*args, **kws).parsebytes(s)
  File "/usr/local/lib/python3.10/email/parser.py", line 123, in parsebytes
return self.parser.parsestr(text, headersonly)
  File "/usr/local/lib/python3.10/email/parser.py", line 67, in parsestr
return self.parse(StringIO(text), headersonly=headersonly)
  File "/usr/local/lib/python3.10/email/parser.py", line 57, in parse
return feedparser.close()
  File "/usr/local/lib/python3.10/email/feedparser.py", line 187, in close
self._call_parse()
  File "/usr/local/lib/python3.10/email/feedparser.py", line 180, in _call_parse
self._parse()
  File "/usr/local/lib/python3.10/email/feedparser.py", line 256, in _parsegen
if self._cur.get_content_type() == 'message/delivery-status':
  File "/usr/local/lib/python3.10/email/message.py", line 578, in 
get_content_type
value = self.get('content-type', missing)
  File "/usr/local/lib/python3.10/email/message.py", line 471, in get
return self.policy.header_fetch_parse(k, v)
  File "/usr/local/lib/python3.10/email/policy.py", line 163, in 
header_fetch_parse
return self.header_factory(name, value)
  File "/usr/local/lib/python3.10/email/headerregistry.py", line 608, in 
__call__
return self[name](name, value)
  File "/usr/local/lib/python3.10/email/headerregistry.py", line 196, in __new__
cls.parse(value, kwds)
  File "/usr/local/lib/python3.10/email/headerregistry.py", line 453, in parse
kwds['decoded'] = str(parse_tree)
  File "/usr/local/lib/python3.10/email/_header_value_parser.py", line 126, in 
__str__
return ''.join(str(x) for x in self)
  File "/usr/local/lib/python3.10/email/_header_value_parser.py", line 126, in 

return ''.join(str(x) for x in self)
  File "/usr/local/lib/python3.10/email/_header_value_parser.py", line 798, in 
__str__
for name, value in self.params:
  File "/usr/local/lib/python3.10/email/_header_value_parser.py", line 783, in 
params
value = value.decode(charset, 'surrogateescape')
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 5-7: 
surrogates not allowed

--
components: email
messages: 387685
nosy: andersk, barry, r.david.murray
priority: normal
severity: normal
status: open
title: UnicodeEncodeError: surrogates not allowed when parsing invalid charset
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

> The APIs are the same, so you can (should) LoadLibrary the one 
> that you want.

The issue is that python3.dll doesn't depend on python3x.dll in the normal way. 
For example, LoadLibraryExW("path/to/python3.dll", NULL, 
LOAD_WITH_ALTERED_SEARCH_PATH) doesn't automatically load "python38.dll". But 
the forwarded functions depend on "python38.dll", e.g. "Py_Main (forwarded to 
python38.Py_Main)". The loader doesn't try to load "python38.dll" until the 
application tries to resolve a forwarded function such as "Py_Main", which in 
the LoadLibraryExW case is the time that GetProcAddress(hpython3, "Py_Main") is 
called. 

It turns out, when I tested this in 2017, that the loader in Windows 7 doesn't 
remember the activation context from loading "python3.dll" and thus will fail 
to find "python38.dll", which in turn makes the GetProcAddress() call fail. In 
contrast, the loader in Windows 10 knows to search for "python38.dll" in the 
directory of "python3.dll".

--

___
Python tracker 

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



[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Eryk Sun


Change by Eryk Sun :


--
Removed message: https://bugs.python.org/msg387686

___
Python tracker 

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



[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

> I'm not sure we ever meant for LoadLibrary("python3.dll") to 
> actively load the concrete python3X.dll.

IIRC, Paul Moore was doing something like this to create a script runner that 
loads "python3.dll", which runs as a regular application, not as a launcher for 
"python.exe". He didn't want to tie the executable to a particular 
"python3x.dll" or include the DLLs in the application directory beside the 
executable. I think he had the embedded distribution(s) in a subdirectory. 
That's solvable by defining an assembly in the subdirectory, which gets 
declared in the application manifest. But I think he wanted to keep it simple. 
So he was just manually loading "python3.dll" and calling GetProcAddress() to 
look up Py_Main(), which works in Windows 8+. Alternatively, for this kind of a 
script runner, the script itself can declare the version of Python it needs in 
a shebang (assuming a single architecture for the executable and Python), and 
the executable can then manually load the required Python DLL from a 
subdirectory, or other known location.

--

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Addendum to msg387641:
> The latter only leaves a valid Cursor->statement->st pointer (sqlite3_stmt 
> pointer) if the Statement object was successfully created, and the 
> sqlite3_stmt successfully prepared.

sqlite3_prepare_v2() actually returns SQLITE_OK but sets the statement pointer 
to NULL, if given an empty string or a comment. Only the sqlite3_prepare_v2() 
return code is checked in order to determine if pysqlite_statement_create() was 
successful or not.

--

___
Python tracker 

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



[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Steve Dower


Steve Dower  added the comment:

Yeah, but in that scenario, it is just as good to LoadLibrary("python39.dll") 
and use it as if it was LoadLibrary("python3.dll") because the interaction 
model is identical.

The only reason to load python3.dll explicitly is if you are not keeping it 
adjacent to python39.dll, and so you need to pre-load it before the interpreter 
tries to import a native module. It doesn't provide any benefit for the host 
app other than not having to know what DLL you're loading, and most of us 
consider a critical security vulnerability rather than a feature ;)

--

___
Python tracker 

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



[issue43324] asyncio

2021-02-25 Thread Hasan


New submission from Hasan :

Added socket getfqdn and gethostbyaddr functions with threadpoolexecutor to 
asyncio library

--
messages: 387690
nosy: AliyevH
priority: normal
severity: normal
status: open
title: asyncio
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



[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Paul Moore


Paul Moore  added the comment:

No, because I want to work with whatever version of Python the user puts there. 
Yes, I could search for "python3*.dll" and load the one I find, but I'm writing 
this in C, and I get a migraine whenever I have to write more than about 15 
lines of C code these days :-)

It's not a big deal either way, though. That project turned out to be too much 
effort to be worth it, so it's now mostly just a proof-of-concept experiment.

> most of us consider a critical security vulnerability rather than a feature

:-) Given that my execution model is "run a user-supplied Python script with a 
user-supplied interpreter" I think any attacker has far easier ways of 
compromising things than hijacking python3.dll...

--

___
Python tracker 

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



[issue43324] asyncio

2021-02-25 Thread Hasan


Change by Hasan :


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

___
Python tracker 

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



[issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values.

2021-02-25 Thread Anthony Flury


New submission from Anthony Flury :

A frequent bug for beginners is to assume that 'is' is somehow 'better' then 
'==' when comparing values, and it is certainly a cause for confusion amongst 
beginners as to why:

   [1,2] is [1,2] evaluates to False but
   'a' is 'a' evaluates to True

and many similar examples.

As far as I can see the first mention of the 'is' operator is under Section 5 - 
More on conditionals : 
https://docs.python.org/3/tutorial/datastructures.html?highlight=comparison#comparing-sequences-and-other-types;
 and it is mentioned thus : 

  The operators is and is not compare whether two objects are really
  the same object; this only matters for mutable objects like lists.

As we know though this statement is misleading - it suggests that 'is' can be 
used to compare immutable values (ints, strings, tuples) etc, and while for 
some values of some immutables (small ints, shortish strings) 'is' can be used 
as an equivalent of '==' it wont be clear from this 'statement' that 'is' is 
simply not a safe way to compare values.

There needs to be a warning here about 'is' and how it is not an equivalent to 
'==' in any general sense.

--
assignee: docs@python
components: Documentation
messages: 387692
nosy: anthony-flury, docs@python
priority: normal
severity: normal
status: open
title: Documentation should warn that 'is' is not a safe comparison operator 
for most values.
type: enhancement

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-25 Thread twoone3


Change by twoone3 <3197653...@qq.com>:


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
resolution: works for me -> wont fix
type:  -> behavior

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-25 Thread Steve Dower


Steve Dower  added the comment:

Sorry, I can't help. My employer has strict rules about reviewing GPL code like 
that in your linked repository.

I'd suggest checking your thread management in native code. Each new thread 
created in Python will create a new native thread, and they're all trying to 
acquire the GIL, so make sure you release it. I have no idea how you are 
waiting for the threads to complete their work, but you'll need to release the 
GIL while waiting (and maybe periodically reacquire it to check).

In general, I find it's best to treat embedded CPython as running as a separate 
process, even if it's just in separate threads. If you try and mix arbitrary 
Python code into your own application, things like this happen all the time. 
Whereas if you are doing inter-thread communication as if there are no shared 
objects, you'll often be fine.

--

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 91ea37c84af2dd5ea92802a4c2adad47861ac067 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43290: Remove workaround from pysqlite_step() (GH-24638)
https://github.com/python/cpython/commit/91ea37c84af2dd5ea92802a4c2adad47861ac067


--

___
Python tracker 

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



[issue43290] [sqlite3] remove legacy code from pysqlite_step

2021-02-25 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-25 Thread twoone3


twoone3 <3197653...@qq.com> added the comment:

That's a pity. I'm going to send the Python source code to my project to 
compile it, and see if it can solve the problem. Of course, I can also try 
compiling it into a static library

--

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Inada Naoki


Inada Naoki  added the comment:

Thank you for reporting.

@vstinner Can we provide a nice C traceback too?

--
nosy: +vstinner

___
Python tracker 

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



[issue43314] [sqlite3] remove pre SQLite 3.7.7 support code

2021-02-25 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 3150754f91fc1d15e3888e22c065672838a9c069 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43314: Remove SQLITE_OPEN_URI ifdef (GH-24637)
https://github.com/python/cpython/commit/3150754f91fc1d15e3888e22c065672838a9c069


--

___
Python tracker 

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



[issue43314] [sqlite3] remove pre SQLite 3.7.7 support code

2021-02-25 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +23437
pull_request: https://github.com/python/cpython/pull/24652

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset adea9b86a97794ca75054603497c195d5ba39aa5 by Miss Islington (bot) 
in branch '3.9':
bpo-43316:  gzip: CLI uses non-zero return code on error. (GH-24647)
https://github.com/python/cpython/commit/adea9b86a97794ca75054603497c195d5ba39aa5


--

___
Python tracker 

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



[issue13559] Use sendfile where possible in httplib

2021-02-25 Thread Alex Willmer


Alex Willmer  added the comment:

I would like to take a stab at this. Giampaolo, would it be okay if I made a 
pull request updated from your patch? With the appropriate "Co-authored-by: 
Author Name " line.

--
nosy: +Alex.Willmer

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 9525a18b5bb317d9fb206c992ab62aa41559b0c8 by Inada Naoki in branch 
'master':
bpo-43316: gzip: Fix sys.exit() usage. (GH-24652)
https://github.com/python/cpython/commit/9525a18b5bb317d9fb206c992ab62aa41559b0c8


--

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23438
pull_request: https://github.com/python/cpython/pull/24653

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23439
pull_request: https://github.com/python/cpython/pull/24654

___
Python tracker 

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



[issue43295] datetime.strptime emits IndexError on parsing 'z' as %z

2021-02-25 Thread itchyny


itchyny  added the comment:

@noormichael Thank you for submitting a patch, I confirmed the original issue 
is fixed. I'm ok this ticket is closed. Regarding the second issue, I learned 
it is a Turkish character (thanks!), but the error is same type so will not 
cause such a critical issue.

--

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread miss-islington


miss-islington  added the comment:


New changeset 540749ed6d8e29a11368bc7f343baf7b7ea7e4a8 by Miss Islington (bot) 
in branch '3.9':
bpo-43316: gzip: Fix sys.exit() usage. (GH-24652)
https://github.com/python/cpython/commit/540749ed6d8e29a11368bc7f343baf7b7ea7e4a8


--

___
Python tracker 

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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread Inada Naoki


Change by Inada Naoki :


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



[issue43316] python -m gzip handles error incorrectly

2021-02-25 Thread miss-islington


miss-islington  added the comment:


New changeset 07ab490a7a966ce00a61bf56ccd0604434b143a5 by Miss Islington (bot) 
in branch '3.8':
bpo-43316: gzip: Fix sys.exit() usage. (GH-24652)
https://github.com/python/cpython/commit/07ab490a7a966ce00a61bf56ccd0604434b143a5


--

___
Python tracker 

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



[issue43278] unnecessary leading '\n' from Py_GetCompiler() when build with different complier

2021-02-25 Thread Joseph Shen


Change by Joseph Shen :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue43144] test_unicodedata: test_normalization uses network but doesn't depend on network resource

2021-02-25 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset c6ccdfb479cb0a4a491575ef0bafaa0d29daae1a by Ammar Askar in branch 
'master':
bpo-43144: Mark unicodedata's test_normalization as requiring network (GH-24650)
https://github.com/python/cpython/commit/c6ccdfb479cb0a4a491575ef0bafaa0d29daae1a


--

___
Python tracker 

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



[issue43144] test_unicodedata: test_normalization uses network but doesn't depend on network resource

2021-02-25 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43326] About Zipfile

2021-02-25 Thread Fcant

New submission from Fcant :

When I Unzip a package using the zipfile module, the package’s filename has a 
newline character, which causes the Unzip to fail, so the UNZIP filename needs 
to be processed

--
components: Library (Lib)
files: Fcant_2021-02-26_11-26-37.jpg
messages: 387705
nosy: Fcscanf
priority: normal
severity: normal
status: open
title: About Zipfile
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49836/Fcant_2021-02-26_11-26-37.jpg

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Inada Naoki


Inada Naoki  added the comment:

I checked the warning, and now I think Python traceback is fine.

PyArg_Parse*() is used on top of the C function. So python traceback is enough 
to find which function is using '#' without Py_SSIZE_T_CLEAN.

--

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-02-25 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane
nosy_count: 17.0 -> 18.0
pull_requests: +23442
pull_request: https://github.com/python/cpython/pull/24657

___
Python tracker 

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



[issue43278] unnecessary leading '\n' from Py_GetCompiler() when build with different complier

2021-02-25 Thread miss-islington


miss-islington  added the comment:


New changeset 28a30bc2e2d5a02d42e65ff7b7c6968fa966279d by Joseph Shen in branch 
'master':
closes bpo-43278: remove unnecessary leading '\n' from COMPILER when build with 
GCC/Clang (GH-24606)
https://github.com/python/cpython/commit/28a30bc2e2d5a02d42e65ff7b7c6968fa966279d


--
nosy: +miss-islington
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



[issue27820] Possible bug in smtplib when initial_response_ok=False

2021-02-25 Thread Pandu E POLUAN


Pandu E POLUAN  added the comment:

PR available on GitHub and it's already more than one month since the PR was 
submitted, so I'm pinging this issue.

--

___
Python tracker 

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



[issue43144] test_unicodedata: test_normalization uses network but doesn't depend on network resource

2021-02-25 Thread miss-islington


miss-islington  added the comment:


New changeset 6c4c11763fad106e43cdcfdbe3bd33ea2765a13f by Miss Islington (bot) 
in branch '3.9':
bpo-43144: Mark unicodedata's test_normalization as requiring network (GH-24650)
https://github.com/python/cpython/commit/6c4c11763fad106e43cdcfdbe3bd33ea2765a13f


--

___
Python tracker 

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



[issue43144] test_unicodedata: test_normalization uses network but doesn't depend on network resource

2021-02-25 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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