[issue36392] IPv4Interface Object has no attributte prefixlen

2021-12-04 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

The docs for current bugfix releases (3.9+) have clear links from the Interface 
class attribute `network` to the Network class which lists the `prefixlen` 
attribute. I don't think it can be made clearer - there's two ways to find it - 
either searching for `prefixlen` and working backwards from network to 
interface, or following the link from Interface.network.

--
nosy: +andrei.avk, kj
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue44735] Failed venv Activation With "&" In Folder Name

2021-12-04 Thread Eryk Sun


Change by Eryk Sun :


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



[issue44540] venv: activate.bat fails for venv with special characters in PATH

2021-12-04 Thread Eryk Sun


Change by Eryk Sun :


--
stage:  -> needs patch
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue44735] Failed venv Activation With "&" In Folder Name

2021-12-04 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Duplicate of https://bugs.python.org/issue44540

--
nosy: +andrei.avk
superseder:  -> venv: activate.bat fails for venv with special characters in 
PATH

___
Python tracker 

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



[issue45984] Error messages for invalid string prefixes and potential attribute accesses

2021-12-04 Thread theeshallnotknowethme


Change by theeshallnotknowethme :


--
resolution:  -> rejected

___
Python tracker 

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



[issue45984] Error messages for invalid string prefixes and potential attribute accesses

2021-12-04 Thread theeshallnotknowethme


Change by theeshallnotknowethme :


--
resolution: rejected -> 

___
Python tracker 

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



[issue45981] Get raw file name in bytes from ZipFile

2021-12-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

UTF-16 uses null bytes. I'm sure there are other encodings that do, too.

But I don't know if these encodings are permitted or common in zip files.

--

___
Python tracker 

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



[issue45981] Get raw file name in bytes from ZipFile

2021-12-04 Thread Devourer Station


Devourer Station  added the comment:

Null bytes appear in abnormal zip files. (I haven't seen any multibyte encoding 
that represents a character with null bytes)

But non-utf8 encodings are common in normal zip files, as windows uses 
different encodings for different language settings. (On the other hand, Linux 
suggests everyone use UTF8 regardless of their language settings.)

It's a pity that nowadays few software supports specifying encoding when 
extracting archives.
(We have unzip-iconv patch on Linux, even if the patch is never accepted by 
unzip)

Changing the language and rebooting my OS makes no sense, and I don't know why.

--

___
Python tracker 

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



[issue43418] FTPLib error when server returns byte message instead of string

2021-12-04 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Closing as third party. Cowrie overrides ftplib.FTP class and implements 
__init__ in a way that doesn't work properly with some other methods of `FTP` 
class.

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



[issue45980] Why there isn't a “Python 2.2” for PyPI's classifiers?

2021-12-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is not a performance issue. Why did you flag it as performance?

Python 2.2 and 2.1 are so out of date that I'm just going to close this and not 
even ask why you are bothering to write and publish code for Python 2.2 :-)

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: performance -> 
versions:  -Python 3.10, Python 3.11, 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



[issue43474] http.server.BaseHTTPRequestHandler end_header() fails

2021-12-04 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

It seems like sending zero headers is not supported, because:

- if using http/1.0
https://www.rfc-editor.org/rfc/rfc7230#section-6.1  -- Connection: close must 
be sent

- if using http/1.1 -- 
https://docs.python.org/3.11/library/http.server.html#http.server.BaseHTTPRequestHandler.protocol_version

Content-Length must be included.

Therefore closing as not a bug.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

___
Python tracker 

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



[issue44534] unittest.mock.Mock.unsafe doc is garbled

2021-12-04 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11 -Python 3.9

___
Python tracker 

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



[issue45934] python curses newterm implementation

2021-12-04 Thread Éric Araujo

Change by Éric Araujo :


--
stage:  -> needs patch
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



[issue45984] Error messages for invalid string prefixes and potential attribute accesses

2021-12-04 Thread theeshallnotknowethme


theeshallnotknowethme  added the comment:

I actually didn't know bpo-45982 existed.

--

___
Python tracker 

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



[issue45984] Error messages for invalid string prefixes and potential attribute accesses

2021-12-04 Thread Eric V. Smith

Eric V. Smith  added the comment:

Since the two reported problems are unrelated, this should be two bug reports. 
The first one does seem like a duplicate, as Pablo mentions. I haven’t checked 
to see if the second one already has an issue.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45984] Error messages for invalid string prefixes and potential attribute accesses

2021-12-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Actually, is not technically a duplicate of https://bugs.python.org/issue45982 
but is related.

--
resolution: duplicate -> rejected

___
Python tracker 

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



[issue45906] Python github installation issue

2021-12-04 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please provide your operating system / Linux distro and the steps and 
commands you used to download Python from GitHub. Please also attach config.log 
file.

--

___
Python tracker 

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



[issue45984] Error messages for invalid string prefixes and potential attribute accesses

2021-12-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Duplicate of https://bugs.python.org/issue45982

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



[issue45984] Error messages for invalid string prefixes and potential attribute accesses

2021-12-04 Thread theeshallnotknowethme


Change by theeshallnotknowethme :


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

___
Python tracker 

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



[issue45984] Error messages for invalid string prefixes and potential attribute accesses

2021-12-04 Thread theeshallnotknowethme


New submission from theeshallnotknowethme :

In the current version of CPython, this code:

if datetime.now()strftime(...) != "19:50:00": return

produces this error:

  File "", line 4
if datetime.now()strftime(...) != "19:50:00": return
 
SyntaxError: invalid syntax

This is a potential attribute access, and this bug report proposes it would 
produce this error instead:

  File "", line 4
if datetime.now()strftime(...) != "19:50:00": return
   ^^
SyntaxError: invalid syntax. Perhaps you forgot a dot?

Also, for string prefixes, this is the current error:

>>> kf'dsdsfddsf'
  File "", line 1
kf'dsdsfddsf'
  ^^^
SyntaxError: invalid syntax

This bug report proposes this error instead:

>>> kf'dsdsfddsf'
  File "", line 1
kf'dsdsfddsf'
^^
SyntaxError: invalid string prefix 'kf'

--
components: Parser
messages: 407687
nosy: February291948, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Error messages for invalid string prefixes and potential attribute 
accesses
versions: Python 3.11

___
Python tracker 

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



[issue10483] http.server - what is executable on Windows

2021-12-04 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



[issue45982] Bug in Error messages

2021-12-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue45982] Bug in Error messages

2021-12-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

It doesn't happen anymore with the latest 3.10:

>>> if datetime.now()strftime(...) != "19:50:00": pass
  File "", line 1
if datetime.now()strftime(...) != "19:50:00": pass
 
SyntaxError: invalid syntax

--

___
Python tracker 

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



[issue45982] Bug in Error messages

2021-12-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

It doesn't happen anymore with the latest 3.10:

>>> if datetime.now(),strftime(...) != "19:50:00": pass
  File "", line 1
if datetime.now(),strftime(...) != "19:50:00": pass
 ^
SyntaxError: invalid syntax

--

___
Python tracker 

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



[issue10483] http.server - what is executable on Windows

2021-12-04 Thread mike mcleod


Change by mike mcleod :


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

___
Python tracker 

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



[issue45975] Simplify some while-loops with walrus operator

2021-12-04 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood

___
Python tracker 

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



[issue45975] Simplify some while-loops with walrus operator

2021-12-04 Thread Nick Drozd


Nick Drozd  added the comment:

> Is there any measurable performance benefit from this?

I wouldn't expect any performance changes either way. If it worked out to be 
slower, that would an unpleasant surprise and a good reason to reject this 
change. If it worked out to be faster, well, that would be great!

> Reducing several hundred thousand lines of code by 148 is not a compelling 
> benefit :)

But it's not just any old 148 lines. By my count it includes the removal of 47 
`break` statements. For a change of this nature there's certainly a chance of 
introducing errors. On the other hand, every one of those `break` statements is 
a site of manual loop-handling logic, and those already present some risk of 
introducing errors.

--

___
Python tracker 

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



[issue45982] Bug in Error messages

2021-12-04 Thread Matt Wozniski


Matt Wozniski  added the comment:

> Syntactically, this could be many possible errors: missing comma, missing 
> period, missing parens, missing brackets, etc.

Syntactically, it cannot be a missing comma. Adding the comma is a syntax error.

$ python3 -c 'if datetime.now(),strftime(...) != "19:50:00": pass'
  File "", line 1
if datetime.now(),strftime(...) != "19:50:00": pass
 ^
SyntaxError: invalid syntax

Granted this is a heuristic, but it would be nice if it was able to not suggest 
a change that it would reject as syntactically incorrect.

--
nosy: +godlygeek

___
Python tracker 

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



[issue13236] unittest needs more flush calls

2021-12-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset f42a06ba279c916fb67289e47f9bc60dc5dee4ee by Serhiy Storchaka in 
branch 'main':
bpo-13236: Flush the output stream more often in unittest (GH-29864)
https://github.com/python/cpython/commit/f42a06ba279c916fb67289e47f9bc60dc5dee4ee


--

___
Python tracker 

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



[issue27946] elementtree calls PyDict_GetItem without owning a reference to the dict

2021-12-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The issue is no longer reproduced by the original test because of the cache for 
dict key tables. But it is not gone, and can be reproduced with modified test.

There may be many similar bugs in the Python core end extensions. Adding 
incref/decref in PyDict_GetItem and similar C API functions could fix many of 
them, but perhaps not all, and it would hit performance. I suppose modt of uses 
of PyDict_GetItem are safe.

--
versions: +Python 3.10, Python 3.11, 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



[issue45976] Random._randbelow() loses time by caching an attribute lookup

2021-12-04 Thread Andrew Lin


Andrew Lin  added the comment:

E[calls] reduces down to 2**k / n.  I only just realized from working that out 
that it therefore doesn't quite vary linearly over [2**k, 2**(k+1)), although 
by what weight one wants to average I couldn't say.

Personally if the change adversely impacts performance for any n on any major 
platform I will retract the PR.  I was under the impression based on my own 
machine that this would not happen, but it is only my one machine.

--

___
Python tracker 

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



[issue27946] elementtree calls PyDict_GetItem without owning a reference to the dict

2021-12-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45976] Random._randbelow() loses time by caching an attribute lookup

2021-12-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Notes
=

Without Boundmethod
---
  LOAD FAST self
  LOAD METHOD getrandbits
  LOAD FAST k
  CALL_METHOD 1

Form Boundmethod

   LOAD FAST self
   LOAD ATTR getrandbits
   STORE FAST getrandbits

Call Boundmethod

   LOAD FAST getrandbits
   LOAD FAST k
   CALL FUNCTION 1

Expected Call Frequency
---

n = 1000
r = 0 .. 1024
P(r > n) 24 / 1024 = 2.3%
E[calls] = 1 / (1 - 24/1024) = 1.024

n = 1024
r = 0 .. 2048
P(r > n) = 1024 / 2048 = 50%
E[calls] = 1 / (1 - 1024/2048) = 2.0

--

___
Python tracker 

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



[issue45964] gdb test fails when packaging Python 3.10 for openSUSE/Linux

2021-12-04 Thread Matej Cepl

Matej Cepl  added the comment:

> Matej, does your build system perhaps strip off the shebang of Lib/pdb.py? 
> That would explain why you are getting the function on line 93.

Yes, that’s it. Thank you.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45947] Place dict (and values) pointers at a fixed (negative) offset from the base of the object.

2021-12-04 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj

___
Python tracker 

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



[issue45983] PyType_Spec.name must remain valid after PyType_FromSpec

2021-12-04 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I just noticed this duplicates #45315, sorry about the noise.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> `PyType_FromSpec` does not copy the name

___
Python tracker 

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



[issue45983] PyType_Spec.name must remain valid after PyType_FromSpec

2021-12-04 Thread Ronald Oussoren


New submission from Ronald Oussoren :

The documentation for PyType_Spec and the related functions is not clear about 
the required lifetime of fields of PyType_Spec. 

In particular, PyType_Spec.name must remain valid for the entire lifetime of 
types created with PyType_FromSpec*.  The documentation doesn't mention this.

I ran into this with code that calculates the name as needed an cleans up the 
memory used for the type spec after creating the type. The type appears to work 
fine when looking at it in Python scripts, but the tp_name slot is wrong.

--
assignee: docs@python
components: Documentation
messages: 407676
nosy: docs@python, ronaldoussoren
priority: normal
severity: normal
status: open
title: PyType_Spec.name must remain valid after PyType_FromSpec
type: behavior
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



[issue45906] Python github installation issue

2021-12-04 Thread Éric Araujo

Change by Éric Araujo :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue45975] Simplify some while-loops with walrus operator

2021-12-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> As I mentioned in the PR, merging this can make future
> backports to 3.6 and 3.7 more complicated.

That's correct, but it is also true that we do very few of those and the 
likelihood of a conflict with one of these edits is low.

--

___
Python tracker 

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



[issue45934] python curses newterm implementation

2021-12-04 Thread Guido van Rossum

Guido van Rossum  added the comment:

This does not apply to Windows (we don’t support curses there).

--
components: +Library (Lib) -C API, Windows

___
Python tracker 

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



[issue45934] python curses newterm implementation

2021-12-04 Thread Guido van Rossum


New submission from Guido van Rossum :

Since this is an enhancement, it should only target 3.11.--
--Guido (mobile)

--

___
Python tracker 

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



[issue45982] Bug in Error messages

2021-12-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I concur with Eric: the purpose of the error message is a suggestion based in 
the most likely cause. Also  we have recently refined this so I will trigger in 
less uncommon situations.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45982] Bug in Error messages

2021-12-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

Syntactically, this could be many possible errors: missing comma, missing 
period, missing parens, missing brackets, etc.

A human can figure it out based on semantics, but based purely on syntax, I 
think this error message is good enough.

--
components: +Parser -Interpreter Core
nosy: +eric.smith, lys.nikolaou, pablogsal

___
Python tracker 

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



[issue27946] elementtree calls PyDict_GetItem without owning a reference to the dict

2021-12-04 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue45982] Bug in Error messages

2021-12-04 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2021-12-04 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2021-12-04 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue45982] Bug in Error messages

2021-12-04 Thread UnknownLITE


New submission from UnknownLITE :

A dot is missing between `now()` and `strftime` but it is suggesting that most 
probably a comma is missing.

--
components: Interpreter Core
files: Screenshot 2021-12-04 202054.png
messages: 407670
nosy: UnknownLITE
priority: normal
severity: normal
status: open
title: Bug in Error messages
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file50475/Screenshot 2021-12-04 202054.png

___
Python tracker 

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



[issue45981] Get raw file name in bytes from ZipFile

2021-12-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

You would also need to decide what to do with these lines, just before the 
os.sep test:

# Terminate the file name at the first null byte.  Null bytes in file
# names are used as tricks by viruses in archives.
null_byte = filename.find(chr(0))
if null_byte >= 0:
filename = filename[0:null_byte]

I don't think you'd want to do this on an encoded (raw) filename, but on the 
other hand the comment makes a good point.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-04 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 64be8d369b7e3878078dbef466804ae8be49c1cf by Christian Heimes in 
branch 'main':
bpo-45847: Update whatsnew and add place holder entries for missing extensions 
(GH-29914)
https://github.com/python/cpython/commit/64be8d369b7e3878078dbef466804ae8be49c1cf


--

___
Python tracker 

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



[issue45980] Why there isn't a “Python 2.2” for PyPI's classifiers?

2021-12-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

What's the use case for this? Can wheels even be installed in 2.2?

I think it's safe to assume the classifiers are not present because they're 
outdated.

I think https://github.com/pypa/pypi-support/issues would be the best place to 
report this, since it's not a bug in python itself.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45981] Get raw file name in bytes from ZipFile

2021-12-04 Thread Devourer Station

Devourer Station  added the comment:

In file Lib/zipfile.py:
1357>  flags = centdir[5]
1358>  if flags & 0x800:
1359># UTF-8 file names extension
1360>filename = filename.decode('utf-8')
1361>  else:
1362># Historical ZIP filename encoding
1363>filename = filename.decode('cp437')

ZipFile simply decodes all non-utf8 file names by encoding CP437.

In file Lib/zipfile.py:
352>  # This is used to ensure paths in generated ZIP files always use
353>  # forward slashes as the directory separator, as required by the
354>  # ZIP format specification.
355>  if os.sep != "/" and os.sep in filename:
356>filename = filename.replace(os.sep, "/")

And it replaces every '\\' with '/' on windows.

Consider we have a file named '\x97\x5c\x92\x9b', which is '予兆' in Japanese 
encoded in SHIFT_JIS.
You may have noticed the problem:

  '\x5c' is '\\'(backslash) in ASCII

So you will see ZipFile decodes the bytes by CP437, and replaces all '\\' with 
'/'.
And the Japanese character '予' is replaced partially, it is no longer itself.

Someone says we can replace '/' with '\\' back, and decode it by CP437 to get 
the raw bytes.
But what if both '/'('\x2f') and '\\'('\x5c') appear in the raw filename?

Simply replacing '\\' in a bytestream without knowning the encoding is by no 
means a good way.
Maybe we can provide a rawname field in the ZipInfo struct?

--

___
Python tracker 

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



[issue45981] Get raw file name in bytes from ZipFile

2021-12-04 Thread Devourer Station


New submission from Devourer Station :

It's quite annoying that ZipFile corrupts the filename by simply replacing '\\' 
with '/', not providing the raw file name in bytes to us.

--
components: Library (Lib)
messages: 407665
nosy: accelerator0099
priority: normal
severity: normal
status: open
title: Get raw file name in bytes from ZipFile
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



[issue45980] Why there isn't a “Python 2.2” for PyPI's classifiers?

2021-12-04 Thread chen-y0y0


chen-y0y0  added the comment:

And NOT ONLY Python 2.2, there aren't also Python 2.1 or earlier version.

--

___
Python tracker 

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



[issue45980] Why there isn't a “Python 2.2” for PyPI's classifiers?

2021-12-04 Thread chen-y0y0

New submission from chen-y0y0 :

The output:
Upload failed (400): Invalid value for classifiers. Error: Classifier ' 
Programming Language :: Python :: 2.2' is not a valid classifier.
error: Upload failed (400): Invalid value for classifiers. Error: Classifier ' 
Programming Language :: Python :: 2.2' is not a valid classifier.
So, why is there no Python 2.2? Is it because it is outdated or because it is 
discriminated against?

--
components: Distutils
messages: 407663
nosy: dstufft, eric.araujo, prasechen
priority: normal
severity: normal
status: open
title: Why there isn't a “Python 2.2” for PyPI's classifiers?
type: performance
versions: Python 3.10, Python 3.11, 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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-04 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28139
pull_request: https://github.com/python/cpython/pull/29914

___
Python tracker 

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



[issue45823] python stopped working

2021-12-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

The reproducer is absent, closing

--
nosy: +asvetlov
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45934] python curses newterm implementation

2021-12-04 Thread Julius Hamilton


Change by Julius Hamilton :


--
nosy: +Guido.van.Rossum, juliushamilton100

___
Python tracker 

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



[issue45979] Fix Tkinter tests with old Tk

2021-12-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +epaine

___
Python tracker 

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



[issue45979] Fix Tkinter tests with old Tk

2021-12-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45979] Fix Tkinter tests with old Tk

2021-12-04 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Some recently added tests are not compatible with old Tk versions. I have build 
all 8.5 and 8.6 versions and build and test Tkinter against them. The proposed 
PR makes tests passes on Tk versions 8.5.4 to 8.5.19 and 8.6.0 to 8.6.12. There 
are some issues with running the pure Tk shell for versions < 8.5.4 so I 
skipped them.

--
components: Tests, Tkinter
messages: 407661
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix Tkinter tests with old Tk
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45978] deepfreeze opaquely fails on Windows when building from Visual Studio

2021-12-04 Thread Christian Heimes


Christian Heimes  added the comment:

Main requires a recent version of Python in order to bootstrap the build 
process. I just re-introduced _bootstrap_python for configure & make builds in 
bpo-45950. Could somebody with a Windows system re-add _bootstrap_python to 
Windows build process? bpo-45850 and bpo-45873 have more context.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28953] Use `raise from` when raising new IncompleteRead

2021-12-04 Thread Ram Rachum


Ram Rachum  added the comment:

Okay, works for me.

--

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2021-12-04 Thread David Jack


David Jack  added the comment:

Thank you for the information. That will definitely be helpful. 
https://pcoptimizerpro.com/

--

___
Python tracker 

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



[issue28953] Use `raise from` when raising new IncompleteRead

2021-12-04 Thread Irit Katriel


Irit Katriel  added the comment:

Exception message text is not part of the api. The type is.

--

___
Python tracker 

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



[issue45978] deepfreeze opaquely fails on Windows when building from Visual Studio

2021-12-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Actually, it seems $(PythonForBuild) is already used everywhere, it's just that 
$(PythonForBuild) is giving the empty string when VS uses it.

On the other hand, PCBuild/build.bat sets $(PythonForBuild) by calling out to 
find_python.bat, and that works great.

So perhaps the VS build should just be made to invoke find_python.bat.

--

___
Python tracker 

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



[issue28953] Use `raise from` when raising new IncompleteRead

2021-12-04 Thread Ram Rachum


Ram Rachum  added the comment:

This might work here, but you'd need to be sure there isn't any important code 
that looks at the IncompleteRead exception and expects the data to be in its 
message.

Also I hope that various tools like IDEs would learn quickly that they need to 
display the note in their traceback views, otherwise all of these notes would 
be hidden from many people.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-04 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 4045392e0e3446362841b3336497cb6eeccfcd23 by Christian Heimes in 
branch 'main':
bpo-45847: Port _ctypes partly to PY_STDLIB_MOD (GH-29747)
https://github.com/python/cpython/commit/4045392e0e3446362841b3336497cb6eeccfcd23


--

___
Python tracker 

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



[issue45978] deepfreeze opaquely fails on Windows when building from Visual Studio

2021-12-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Sure enough, if I go to "Choose Default Apps by File Type" in Windows settings 
and associate ".py" --> "Notepad", then Visual studio keeps opening Notepad 
windows during build.

Can the Visual Studio build configurations be made to run python scripts as 
"SOME_SPECIFIC_PYTHON_EXECUTABLE ./script.py" or perhaps "py ./script.py" 
instead of just "./script.py"?

--

___
Python tracker 

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



[issue45695] Out-of-tree builds are not tested.

2021-12-04 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset cee07b162843694e8166ad8715162d4d5886b50f by Christian Heimes in 
branch 'main':
bpo-45695: Test out-of-tree builds on GHA (GH-29904)
https://github.com/python/cpython/commit/cee07b162843694e8166ad8715162d4d5886b50f


--

___
Python tracker 

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



[issue28953] Use `raise from` when raising new IncompleteRead

2021-12-04 Thread Irit Katriel

Irit Katriel  added the comment:

It’s meant for thing you want to add to the msg after the exception was 
created. The PR here seems to create a new exception of the same type in order 
to chain it with an additional msg. I’m suggesting that it might be sufficient 
to attach a note to the existing exception instead.

--

___
Python tracker 

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



[issue45978] deepfreeze opaquely fails on Windows when building from Visual Studio

2021-12-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I think I've been getting similar issues for a little while that I've been able 
to work around until now. If I git checkout 3.10 and then hit the "Local 
Windows Debugger" button, I get this:

Build started...
1>-- Build started: Project: pythoncore, Configuration: Debug x64 --
1>Killing any running python_d.exe instances...
1>Regenerate opcode.h opcode_targets.h
1>C:\Users\sween\Source\Repos\temp\cpython\PCbuild\regen.targets(62,5): error 
MSB3073: The command " Tools\scripts\generate_opcode_h.py Lib\opcode.py 
Include\opcode.h" exited with code 103.
1>Done building project "pythoncore.vcxproj" -- FAILED.
2>-- Build started: Project: _ctypes, Configuration: Debug x64 --
3>-- Build started: Project: python, Configuration: Debug x64 --
== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==

However, if I then run .\PCbuild\build.bat, and then hit the "Local Windows 
Debugger" button, the build succeeds.

Is there some difference in which python executable is chosen to run .py files 
between build.bat versus what Visual Studio does?

--

___
Python tracker 

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



[issue45975] Simplify some while-loops with walrus operator

2021-12-04 Thread Irit Katriel


Irit Katriel  added the comment:

As I mentioned in the PR, merging this can make future backports to 3.6 and 3.7 
more complicated.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue45978] deepfreeze opaquely fails on Windows when building from Visual Studio

2021-12-04 Thread Dennis Sweeney


New submission from Dennis Sweeney :

I'd love to know if there is something I'm doing wrong, but with recent 
deepfreeze changes, my Visual Studio 2019 setup has been having trouble build 
things. It seems PCBuild/build.bat works perfectly and all tests pass and 
everything, but using the GUI in Visual Studio 2019 to build with the "Local 
Windows Debugger" green play button leads to a build failure. It gives the 
following output:

Build started...
1>-- Build started: Project: _freeze_module, Configuration: Debug x64 --
1>_freeze_module.vcxproj -> 
C:\Users\sween\Source\Repos\temp\cpython\PCbuild\amd64\_freeze_module_d.exe
1>C:\Users\sween\Source\Repos\temp\cpython\PCbuild\_freeze_module.vcxproj(413,5):
 error MSB3073: The command " 
"C:\Users\sween\Source\Repos\temp\cpython\Tools\scripts\deepfreeze.py" 
"C:\Users\sween\Source\Repos\temp\cpython\Python\frozen_modules\importlib._bootstrap.h"
 "-m" "importlib._bootstrap" -o 
"C:\Users\sween\Source\Repos\temp\cpython\PCbuild\obj\311amd64_Debug\_freeze_module\importlib._bootstrap.g.h""
 exited with code 103.
1>Done building project "_freeze_module.vcxproj" -- FAILED.
== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==

I wonder if it has something to do with how .py files are set to open? 
(shouldn't that be made not to matter?)

Attached are my more detailed steps to reproduce the failure.

--
components: Build, Windows
files: reproducer.txt
messages: 407648
nosy: Dennis Sweeney, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: deepfreeze opaquely fails on Windows when building from Visual Studio
type: compile error
versions: Python 3.11
Added file: https://bugs.python.org/file50474/reproducer.txt

___
Python tracker 

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



[issue37198] _parse_localename fail to parse 'en_IL'

2021-12-04 Thread Christian Heimes


Change by Christian Heimes :


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



[issue40467] subprocess: replacement shell on windows with executable="..." arg

2021-12-04 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.11 -Python 3.7

___
Python tracker 

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



[issue40467] subprocess: replacement shell on windows with executable="..." arg

2021-12-04 Thread Eryk Sun


Eryk Sun  added the comment:

> it might be nice if it's possible to give some sort of useful 
> warning/error when this happens -- perhaps say that specifying 
> both shell=True and executable="..." isn't supported on Windows?

The `shell` parameter is documented as follows for Windows:

On Windows with shell=True, the COMSPEC environment variable 
specifies the default shell. The only time you need to specify 
shell=True on Windows is when the command you wish to execute is 
built into the shell (e.g. dir or copy). You do not need
shell=True to run a batch file or console-based executable.

It wouldn't hurt to clarify that the COMSPEC shell has to support `/c`. This is 
required by CreateProcessW(), which uses COMSPEC to run BAT and CMD files.

The discussion about using `executable` with `shell` could be extended for 
Windows. But this would also require new behavior. For example:

Original:

if shell:
startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = _winapi.SW_HIDE
comspec = os.environ.get("COMSPEC", "cmd.exe")
args = '{} /c "{}"'.format (comspec, args)

Proposed:

if shell:
startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = _winapi.SW_HIDE
if executable is not None:
cmd = executable
else:
cmd = os.path.normpath(os.environ.get("COMSPEC", "cmd.exe"))
if "\\" in cmd:
executable = cmd
args = '"{}" /c "{}"'.format(cmd, args)

> if comspec.endswith('sh.exe') or comspec.endswith('sh'):
> args = '{} -c "{}"'.format (comspec, args) 

sh is not a valid COMSPEC shell. To use sh automatically, subprocess would have 
to support and prefer the SHELL [1] environment variable in Windows -- and in 
POSIX for that matter.

---
[1] 
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03

--
nosy: +eryksun

___
Python tracker 

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