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

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset d82f2caf942fa8b94e797a2f116ee54ec303c2df by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port _socket to PY_STDLIB_MOD (GH-29713)
https://github.com/python/cpython/commit/d82f2caf942fa8b94e797a2f116ee54ec303c2df


--

___
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-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 758a23d1c4db97b578bc16e0ea110074d65c4c52 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Fix xxlimited and xxlimited_35 build conditions (GH-29715)
https://github.com/python/cpython/commit/758a23d1c4db97b578bc16e0ea110074d65c4c52


--

___
Python tracker 

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



[issue45561] Run smelly.py and multissltests.py from $(srcdir)

2021-11-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45561] Run smelly.py and multissltests.py from $(srcdir)

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 457e6a6e96b5afad403a0bc892508a77beef4d33 by Neil Schemenauer in 
branch 'main':
bpo-45561: Run smelly.py tool from $(srcdir) (GH-29138)
https://github.com/python/cpython/commit/457e6a6e96b5afad403a0bc892508a77beef4d33


--
nosy: +christian.heimes

___
Python tracker 

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



[issue45875] gzip.decompress performance can be improved with memoryviews

2021-11-22 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

Tried and failed. It seems that the overhead of creating a new memoryview 
object beats the performance gained by it.

--

___
Python tracker 

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

In any case, any change to this would have to be limited to Python 3.11. It is 
not clearly a bug, so this would be an enhancement.

--
type: behavior -> enhancement
versions:  -Python 3.10, 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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hi Joran,

I'm not sure why you think that /s should agree between ASCII and Unicode. That 
seems like an unjustified assumption to me.

You say: "The expectation would be that the re.A (or re.ASCII) flag should not 
impact the matching behavior of a regular expression on strings consisting only 
of ASCII characters."

But I'm not sure why you have that expectation. Is it documented somewhere? The 
docs clearly say that for character classes, "the characters they match depends 
on whether ASCII or LOCALE mode is in force." I am unable to find anything that 
says that the differences are limited only to non-ASCII code points.

I don't think there is any standard definition of "whitespace" in either the 
ASCII standard, or the very many different regex engines (Perl, dot-Net, Java, 
ECMA, etc).

Unicode does have an official whitespace character property, and as far as I 
can see '\x1c' through '\x1f' (File Separator, Group Separator, Record 
Separator and Unit Separator) are not considered whitespace:

https://en.wikipedia.org/wiki/Unicode_character_property#Whitespace

But the str.isspace() method does consider them as whitespace, while 
bytes.isspace() does not.


>>> '\x1c'.isspace()
True
>>> b'\x1c'.isspace()
False

--
nosy: +steven.daprano

___
Python tracker 

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



[issue33489] Newer externals for windows do not always trigger rebuild

2021-11-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Apparently so, which makes this irrelevant.

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



[issue45875] gzip.decompress performance can be improved with memoryviews

2021-11-22 Thread Ruben Vorderman


New submission from Ruben Vorderman :

The current implementation uses a lot of bytestring slicing. While it is much 
better than the 3.10 and earlier implementations, it can still be further 
improved by using memoryviews instead.

Possibly. I will check this out.

--
components: Library (Lib)
messages: 406816
nosy: rhpvorderman
priority: normal
severity: normal
status: open
title: gzip.decompress performance can be improved with memoryviews
type: performance
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



[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

I increased the performance of the patch. I added the file used for 
benchmarking. I also test the FHCRC changes now.

The benchmark tests headers with different flags concatenated to a DEFLATE 
block with no data and a gzip trailer. The data is fed to gzip.decompress. 
Please note that this is the *worst-case* performance overhead. When there is 
actual data to decompress the overhead will get less. When GzipFile is used the 
overhead will get less as well.

BEFORE (Current main branch):
$ ./python benchmark_gzip_read_header.py 
with_fname
average: 3.01, range: 2.9-4.79 stdev: 0.19
with_noflags
average: 2.99, range: 2.93-3.04 stdev: 0.02
All flags (incl FHCRC)
average: 3.13, range: 3.05-3.16 stdev: 0.02


After (bpo-45509 PR):
with_fname
average: 3.09, range: 3.01-4.63 stdev: 0.16
with_noflags
average: 3.1, range: 3.03-3.38 stdev: 0.04
All flags (incl FHCRC)
average: 4.09, range: 4.05-4.49 stdev: 0.04

An increase of .1 microsecond in the most common use cases. Roughly 3%. But now 
the FNAME field is correctly checked for truncation.

With the FHCRC the overhead is increased by 33%. But this is worth it, because 
the header is now actually checked. As it should.

--
Added file: https://bugs.python.org/file50458/benchmark_gzip_read_header.py

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-11-22 Thread Frost Ming


Frost Ming  added the comment:

Hi, I noticed this bug because of the regression of Python 3.9.8. And I 
proposed a better approach in PR 29574.

Maybe the folks here can have a look. Thanks

- Frost

--

___
Python tracker 

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



[issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function

2021-11-22 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I'm not sure about the hang in 3.7 and CVE, but as far as `get_all()` error is 
concerned, it's due to passing the wrong kind of argument as `headers`.

For this (undocumented) method, `headers` should be a Message object created in 
this way, e.g.:

headers = email.message_from_string(
'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
(mtype or 'text/plain', size, modified))


(see 
https://github.com/python/cpython/blob/024209401ebc8a011f242af00efdd8ecece6953d/Lib/urllib/request.py#L1509)

Header obj created in this way does have the `get_all()` method, and I tested 
that the method runs without further errors.

--
nosy: +andrei.avk, kj

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-11-22 Thread Brett Cannon


Brett Cannon  added the comment:

@christian are you using this issue for your pkg-config work, or should I close 
this?

--

___
Python tracker 

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



[issue45850] Port deep-freeze to Windows

2021-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +27954
pull_request: https://github.com/python/cpython/pull/29717

___
Python tracker 

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



[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +27953
pull_request: https://github.com/python/cpython/pull/29717

___
Python tracker 

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



[issue45555] Object stays alive for weak reference if an exception happens in constructor

2021-11-22 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Note also that in addition to not being related to weakref as Pablo said, it's 
also not related to the __init__() -- the exception can be moved to any method 
of the object with the same result.

It may be good to update the title so that it's not misleading?

--
nosy: +andrei.avk

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-11-22 Thread Carol Willing


Carol Willing  added the comment:


New changeset 024209401ebc8a011f242af00efdd8ecece6953d by Julien Palard in 
branch 'main':
bpo-42238: [doc] Announce the future removal of make suspicous. (GH-29652)
https://github.com/python/cpython/commit/024209401ebc8a011f242af00efdd8ecece6953d


--
nosy: +willingc

___
Python tracker 

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



[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-11-22 Thread Brett Cannon


Change by Brett Cannon :


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



[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-11-22 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 99aad31b7ad493d4feea04064bcd6b04061477f9 by Brett Cannon in 
branch '3.10':
[3.10] bpo-45250: fix docs regarding `__iter__` and iterators being 
inconsistently required by CPython (GH-29170) (GH-29650)
https://github.com/python/cpython/commit/99aad31b7ad493d4feea04064bcd6b04061477f9


--

___
Python tracker 

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



[issue28989] .dll files missing

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


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



[issue33489] Newer externals for windows do not always trigger rebuild

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

> When tcl/tk has been upgraded during 3.x alpha/beta periods, tcl/tk seems to 
> have been recompiled when it should be.


Terry, are you saying this was only a problem on 2.7?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue45874] urllib.parse.parse_qsl does not parse empty query string with strict parsing

2021-11-22 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +27952
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29716

___
Python tracker 

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



[issue45874] urllib.parse.parse_qsl does not parse empty query string with strict parsing

2021-11-22 Thread Christian Sattler


New submission from Christian Sattler :

Calling
  urllib.parse.parse_qsl('', strict_parsing=True)
yields an error:
  ValueError: bad query field: ''

The empty string '' is produced by
  urllib.parse.urlencode({})
and also as query string by
  urllib.parse.urlsplit('http://example.org/')
so it should be accepted by urllib.parse.parse_qsl with strict parsing. 

The problem is that parse_qsl(qs, ...) cannot distinguish between zero and one 
query arguments. The call to qs.split(separator) returns the non-empty list 
[''] for qs empty, which means one query argument. However, in this case, we 
want the other semantics.

--
components: Library (Lib)
messages: 406807
nosy: sattler
priority: normal
severity: normal
status: open
title: urllib.parse.parse_qsl does not parse empty query string with strict 
parsing
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



[issue22067] time_test fails after strptime()

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

I am unable to reproduce this on 3.11.

--
nosy: +iritkatriel
resolution:  -> works for me
status: open -> pending

___
Python tracker 

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



[issue45833] NamedTemporaryFile deleted before enclosing context manager exit

2021-11-22 Thread Zachary Ware


Change by Zachary Ware :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue38541] Performance degradation of attribute accesses in Python 3.7.4

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as this is resolved in 3.8 and we won't do anything about 3.7.

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

___
Python tracker 

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



[issue40324] python 3.8.2 idle not opening

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as there isn't enough information here to understand the issue and 
there was no reply to followup questions.

Please create a new issue if you still have a problem and are able to explain 
it more fully.

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



[issue36706] Python script on startup stucks at import

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

Serge, are you still having this problem and if so can you provide the traces? 
If this issue is abandoned I will close it within a couple of weeks.

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

___
Python tracker 

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



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

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27951
pull_request: https://github.com/python/cpython/pull/29715

___
Python tracker 

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



[issue42367] Restore os.makedirs ability to apply mode to all directories created

2021-11-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

A new `intermediate_mode=` kwarg can't _default_ to `mode=` as that would flip 
flop the API's default behavior again and no doubt disrupt someone elses 
3.7-3.10 authored code depending on it. :(

Regardless I do somewhat like `intermediate_mode=` more than the PR's existing 
`recursive_mode=` as it opens up more possible behaviors... Allowing `None` to 
mean "use `mode=`" is desirable as that'll likely be the most common case.  As 
I expect this to be very common, an easier to type name than intermediate_mode 
is desirable.  Brainstorming:

 * mid_mode?
 * submode?
 * imode?

My preference leans towards the latter names. Probably `submode=`.

--

___
Python tracker 

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



[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue45850] Port deep-freeze to Windows

2021-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +27950
pull_request: https://github.com/python/cpython/pull/29714

___
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-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 2dc7d3dda61e7ce07721f46b14c706fbc879dfd6 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port xxlimited and xxlimited_35 to PY_STDLIB_MOD (GH-29707)
https://github.com/python/cpython/commit/2dc7d3dda61e7ce07721f46b14c706fbc879dfd6


--

___
Python tracker 

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



[issue45870] There's no readline module on Windows Python (cmd.Cmd)

2021-11-22 Thread Eryk Sun


Eryk Sun  added the comment:

> The Windows cmd implementation clearly uses readline or 
> some compatible lib under the hood

The REPL shell and input() call PyOS_Readline(). If this call isn't hooked 
(e.g. by the readline module), and stdin is a console file, then it reads a 
line from the console via ReadConsoleW(). If the console's input stream is 
configured in line-input mode, which we assume it is, this function provides 
basic readline-ish support, including a line editor that supports input history 
and aliases. The history is stored in an in-memory buffer in the console, which 
doesn't get save and reused across console sessions. There is no public API to 
get the history contents, and there is no support at all to set it. 

The console/terminal team at Microsoft apparently don't want to do anything 
with the builtin readline support, which is seen as a legacy feature. To the 
contrary, I've even seen them suggest that they're evaluating the addition of a 
new client-side readline library in the native API, which I assume would be 
similar to PowerShell's PSReadLine (e.g. based on ReadConsoleInputW(), and 
supporting a classic console mode in addition to emacs and vi modes).

For now, I suggest patching pyreadline for your own use. In the reported issue, 
I see it's trying to use collections.Callable. Instead it should import 
collections.abc and use collections.abc.Callable.

--
nosy: +eryksun

___
Python tracker 

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



[issue45843] Optimizing constant comparisons/contains

2021-11-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue45865] Old syntax in unittest

2021-11-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Eric.

--
nosy: +serhiy.storchaka
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



Re: frozenset can be altered by |=

2021-11-22 Thread Marco Sulla
Yes, and you do this regularly. Indeed integers, for example, are immutables and

a = 0
a += 1

is something you do dozens of times, and you simply don't think that
another object is created and substituted for the variable named `a`.

On Mon, 22 Nov 2021 at 14:59, Chris Angelico  wrote:
>
> On Tue, Nov 23, 2021 at 12:52 AM David Raymond  
> wrote:
> > It is a little confusing since the docs list this in a section that says 
> > they don't apply to frozensets, and lists the two versions next to each 
> > other as the same thing.
> >
> > https://docs.python.org/3.9/library/stdtypes.html#set-types-set-frozenset
> >
> > The following table lists operations available for set that do not apply to 
> > immutable instances of frozenset:
> >
> > update(*others)
> > set |= other | ...
> >
> > Update the set, adding elements from all others.
>
> Yeah, it's a little confusing, but at the language level, something
> that doesn't support |= will implicitly support it using the expanded
> version:
>
> a |= b
> a = a | b
>
> and in the section above, you can see that frozensets DO support the
> Or operator.
>
> By not having specific behaviour on the |= operator, frozensets
> implicitly fall back on this default.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-22 Thread Guido van Rossum


New submission from Guido van Rossum :

Now that we've got a way (for Windows) to deep-freeze without building a 
bootstrap Python binary, we should do the same for UNIX.

--
components: Build
messages: 406798
nosy: gvanrossum
priority: normal
severity: normal
stage: needs patch
status: open
title: Stop using bootstrap_python for deep-freeze in UNIX builds
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



[issue45850] Port deep-freeze to Windows

2021-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[Python-announce] [RELEASE] pyspread 2.0

2021-11-22 Thread Martin Manns


pyspread 2.0


This is the first stable release of pyspread that runs under Python 3 
(>=3.6).


Apart from version changes and release file updates, it is feature
identical with version 1.99.8.


About pyspread
==

Pyspread is a non-traditional spreadsheet that is based on and written
in the programming language Python.

The goal of pyspread is to be the most pythonic spreadsheet application.

Pyspread is free software. It is released under the GPL v3.

Project website:   https://pyspread.gitlab.io/
Download page: https://pypi.org/project/pyspread/
Signature for tarball:

https://gitlab.com/pyspread/downloads/-/raw/master/releases/pyspread-2.0.tar.gz.sig
Source code:   https://gitlab.com/pyspread/pyspread


Dependencies


Mandatory:
 * Python (≥ 3.6)
 * numpy (>=1.1)
 * PyQt5 (≥ 5.10, requires PyQt5.Svg)
 * setuptools (>=40.0)
 * markdown2 (>= 2.3)

Recommended:
 * matplotlib (>=1.1.1)
 * pyenchant (>=1.1)
 * pip (>=18)
 * python-dateutil (>= 2.7.0)

For building the apidocs with Sphinx see apidocs/requirements.txt


Enjoy

Martin

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


Re: About get_axes() in Pandas 1.2.3

2021-11-22 Thread Mahmood Naderan via Python-list
>I can help you narrow it down a bit. The problem actually occurs inside
>this function call somehow. You can verify this by doing this:
>
>
>fig,axes = plt.subplots(2,1, figsize=(20, 15))
>
>print ("axes[0].get_figure()=",axes[0].get_figure())
>
>You'll find that get_figure() is returning None, when it should be
>returning Figure(2000x1500). So plt.subplots is not doing something
>properly which was corrected at some point. Oddly enough, with pandas
>1.1.4 and matplotlib 3.2.2 (which is what my system has by default),
>there is no error, although the graph is blank.
>
>In my venv, when I upgrade matplotlib from 3.3.4 to 3.5, the problem
>also goes away.  3.4.0 also works.
>
>Honestly your solution is going to be to provide a virtual environment
>with your script.  That way you can bundle the appropriate dependencies
>without modifying anything on the host system.



Thanks for the feedback. You are right.
I agree that virtualenv is the most safest method at this time.


Regards,
Mahmood


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45850] Port deep-freeze to Windows

2021-11-22 Thread Guido van Rossum


New submission from Guido van Rossum :


New changeset 1037ca5a8ea001bfa2a198e08655620234e9befd by Guido van Rossum in 
branch 'main':
bpo-45850: Implement deep-freeze on Windows (#29648)
https://github.com/python/cpython/commit/1037ca5a8ea001bfa2a198e08655620234e9befd


--

___
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-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27948
pull_request: https://github.com/python/cpython/pull/29713

___
Python tracker 

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Matthew Barnett


Matthew Barnett  added the comment:

For comparison, the regex module says that 0x1C..0x1F aren't whitespace, and 
the Unicode property White_Space ("\p{White_Space}" in a pattern, where 
supported) also says that they aren't whitespace.

--

___
Python tracker 

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



[issue45872] Turtle documentation, write()

2021-11-22 Thread Pavel V


New submission from Pavel V :

There are no parentheses for 'font' argument in turtle.write() documentation

https://docs.python.org/3.10/library/turtle.html#turtle.write

--
assignee: docs@python
components: Documentation
messages: 406795
nosy: docs@python, willyns
priority: normal
severity: normal
status: open
title: Turtle documentation, write()
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



[issue45459] Limited API support for Py_buffer

2021-11-22 Thread Alex Gaynor


Alex Gaynor  added the comment:

I am someone who is interested in having this, but FWIW my motivation is 
slightly more narrow, I only really need abi3-friendly buffer support with 
contiguous 1d buffers. Not sure if there'd be interest in doing a smaller 
version before figuring out the entire Py_buffer API.

--
nosy: +alex

___
Python tracker 

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



Re: About get_axes() in Pandas 1.2.3

2021-11-22 Thread Michael Torrie
On 11/22/21 2:03 AM, Mahmood Naderan via Python-list wrote:
> Hi
> 
> I asked a question some days ago, but due to the lack of minimal
> producing code, the topic got a bit messy. So, I have decided to ask
> it in a new topic with a clear minimum code.
> import pandas as pd
> import csv,sys
> import matplotlib
> import matplotlib.pyplot as plt
> 
> df = pd.read_csv('test.batch.csv')
> print(df)
> 
> print("matplotlib version = ",  matplotlib.__version__)
> print("pandas version = ", pd.__version__)
> print("sys version", sys.version_info)
> 
> fig,axes = plt.subplots(2,1, figsize=(20, 15))
   ^
I can help you narrow it down a bit. The problem actually occurs inside
this function call somehow. You can verify this by doing this:

fig,axes = plt.subplots(2,1, figsize=(20, 15))
print ("axes[0].get_figure()=",axes[0].get_figure())

You'll find that get_figure() is returning None, when it should be
returning Figure(2000x1500). So plt.subplots is not doing something
properly which was corrected at some point. Oddly enough, with pandas
1.1.4 and matplotlib 3.2.2 (which is what my system has by default),
there is no error, although the graph is blank.

In my venv, when I upgrade matplotlib from 3.3.4 to 3.5, the problem
also goes away.  3.4.0 also works.

Honestly your solution is going to be to provide a virtual environment
with your script.  That way you can bundle the appropriate dependencies
without modifying anything on the host system.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 4d6c0c0cce05befa06e0cad7351b1303ac048277 by Irit Katriel in 
branch 'main':
bpo-45871: Refactor except matcher validation into a separate function so that 
it can be reused. Add missing unit test. (GH-29711)
https://github.com/python/cpython/commit/4d6c0c0cce05befa06e0cad7351b1303ac048277


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue45857] PEP 604 Union syntax does not support forward references

2021-11-22 Thread Alex Waygood


Alex Waygood  added the comment:

Thanks, Ken! To clarify: I agree that changing the implementation here would 
probably be a bad way to go: it would be foolish to try to replicate all the 
functionality of the typing module as builtins. I also think the existing 
documentation at https://docs.python.org/3/library/stdtypes.html#union-type is 
actually very good, so I don't think it needs a fundamental rewrite by any 
means.

I do still think a sentence or two could be added to the documentation, 
however, clarifying how to deal with forward references, since the behaviour 
here is different to the older, more established syntax using typing.Union. 
Something like this?

"""
Note: The object on both sides of the | operand must be an object that defines 
the __or__ special method. As the str type does not support __or__, the 
expression `int | "Foo"`, where  "Foo" is a reference to a class not yet 
defined, will fail at runtime. To annotate forward references using union-type 
expressions, present the whole expression as a string, e.g. `"int | Foo"`.
"""

--
status: pending -> open

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



Re: copy.copy

2021-11-22 Thread ast

Le 22/11/2021 à 16:02, Jon Ribbens a écrit :

On 2021-11-22, ast  wrote:




For immutable types, copy(foo) just returns foo.



ok, thx
--
https://mail.python.org/mailman/listinfo/python-list


Re: copy.copy

2021-11-22 Thread Jon Ribbens via Python-list
On 2021-11-22, ast  wrote:
> Hi,
>
> >>> a = 6
> >>> b = 6
> >>> a is b
> True
>
> ok, we all know that Python creates a sole instance
> with small integers, but:
>
> >>> import copy
> >>> b = copy.copy(a)
> >>> a is b
> True
>
> I was expecting False

Why did you expect False?

For immutable types, copy(foo) just returns foo.
-- 
https://mail.python.org/mailman/listinfo/python-list


copy.copy

2021-11-22 Thread ast

Hi,

>>> a = 6
>>> b = 6
>>> a is b
True

ok, we all know that Python creates a sole instance
with small integers, but:

>>> import copy
>>> b = copy.copy(a)
>>> a is b
True

I was expecting False
--
https://mail.python.org/mailman/listinfo/python-list


[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 455ed45d7c30c5f2a31c524b015c48ac85f3d27c by Miss Islington (bot) 
in branch '3.9':
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only 
(GH-29691) (GH-29709)
https://github.com/python/cpython/commit/455ed45d7c30c5f2a31c524b015c48ac85f3d27c


--

___
Python tracker 

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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> iritkatriel

___
Python tracker 

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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Irit Katriel


New submission from Irit Katriel :

The validation will be shared with except* so this refactor is prep for 
implementing PEP-654.

Also need to add the missing unit test for the validation.

--
messages: 406790
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH
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



[issue32582] chr raises OverflowError

2021-11-22 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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 56b5cd52ab58d8f2f11f253ec1bb3e6000d2dbd2 by Miss Islington (bot) 
in branch '3.10':
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only 
(GH-29691) (GH-29708)
https://github.com/python/cpython/commit/56b5cd52ab58d8f2f11f253ec1bb3e6000d2dbd2


--

___
Python tracker 

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



[issue45843] Optimizing constant comparisons/contains

2021-11-22 Thread theeshallnotknowethme


Change by theeshallnotknowethme :


--
title: Optimizing LOAD_CONST followed by COMPARE_OP (or IS_OP) -> Optimizing 
constant comparisons/contains

___
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-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 0e1c2f3ef84572b79fa7d8498a69bc5a56ff0d8d by Christian Heimes in 
branch 'main':
bpo-45847: port _struct to PY_STDLIB_MOD (GH-29706)
https://github.com/python/cpython/commit/0e1c2f3ef84572b79fa7d8498a69bc5a56ff0d8d


--

___
Python tracker 

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Joran van Apeldoorn


Joran van Apeldoorn  added the comment:

Small addition, the sre categories CATEGORY_LINEBREAK and 
CATEGORY_UNI_LINEBREAK also do not agree on ASCII characters.
The first is only '\n' while the second also includes for example '\r' and some 
others. These do not seem to correspond to anything however and are never used 
in sre_parse.py or sre_compile.py.

--

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27946
pull_request: https://github.com/python/cpython/pull/29710

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27945
pull_request: https://github.com/python/cpython/pull/29709

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 4fad314246399b69ef0c57ba8527d9efade99069 by Carl Friedrich 
Bolz-Tereick in branch 'main':
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only 
(GH-29691)
https://github.com/python/cpython/commit/4fad314246399b69ef0c57ba8527d9efade99069


--

___
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-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27943
pull_request: https://github.com/python/cpython/pull/29707

___
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-11-22 Thread Christian Heimes


Christian Heimes  added the comment:

_crypt is powered by pkgconf libcrypt or libxcrypt on Linux. On my system  and 
on Debian, libcrypt.pc is a symlink to libxcrypt.pc. Linux has crypt() and/or 
crypt_r() in . On FreeBSD crypt_r() is in  and libc.

_uuid needs similar special handling. It's , -luuid, and uuid.pc 
on Linux. On BSD it's  and symbols are in libc.

_readline uses either libreadline (readline.pc) or libeditline 
(libeditline.pc). It also needs special handling of tinfo and termcap on some 
platforms.

ndbm, gdbm, and libdb have no pkgconf providers. My PR GH-29534 has some code 
to detect them in configure.

--

___
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-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset eee683cbde499e62fc90ad366f7c45625fe92150 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port audioop, _csv, and _posixsubprocess to PY_STDLIB_MOD_SIMPLE 
(GH-29705)
https://github.com/python/cpython/commit/eee683cbde499e62fc90ad366f7c45625fe92150


--

___
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-11-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

_socket coming up...

--

___
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-11-22 Thread Christian Heimes


Christian Heimes  added the comment:

Not converted yet:

readline
_curses
_curses_panel
_crypt
_socket
_ssl
_hashlib
_dbm
_gdbm
_ctypes
_multiprocessing
_posixshmem
_tkinter
_uuid
xxlimited
xxlimited_35

--

___
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-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset c6dec7e27a82cba33539d07ef8d7346e0a232421 by Christian Heimes in 
branch 'main':
bpo-45847: Port nis module to PY_STDLIB_MOD (GH-29699)
https://github.com/python/cpython/commit/c6dec7e27a82cba33539d07ef8d7346e0a232421


--

___
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-11-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27942
pull_request: https://github.com/python/cpython/pull/29706

___
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-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27941
pull_request: https://github.com/python/cpython/pull/29705

___
Python tracker 

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



[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-11-22 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e by Mark Shannon in 
branch 'main':
bpo-45813: Make sure that frame->generator is NULLed when generator is 
deallocated. (GH-29700)
https://github.com/python/cpython/commit/7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e


--

___
Python tracker 

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



Re: frozenset can be altered by |=

2021-11-22 Thread Chris Angelico
On Tue, Nov 23, 2021 at 12:52 AM David Raymond  wrote:
> It is a little confusing since the docs list this in a section that says they 
> don't apply to frozensets, and lists the two versions next to each other as 
> the same thing.
>
> https://docs.python.org/3.9/library/stdtypes.html#set-types-set-frozenset
>
> The following table lists operations available for set that do not apply to 
> immutable instances of frozenset:
>
> update(*others)
> set |= other | ...
>
> Update the set, adding elements from all others.

Yeah, it's a little confusing, but at the language level, something
that doesn't support |= will implicitly support it using the expanded
version:

a |= b
a = a | b

and in the section above, you can see that frozensets DO support the
Or operator.

By not having specific behaviour on the |= operator, frozensets
implicitly fall back on this default.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset d9cedabeba0d87799f99c0717e81743a1c2d34ce by Christian Heimes in 
branch 'main':
bpo-45847: Port compression libs to PY_STDLIB_MOD (GH-29702)
https://github.com/python/cpython/commit/d9cedabeba0d87799f99c0717e81743a1c2d34ce


--

___
Python tracker 

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



[issue45870] There's no readline module on Windows Python (cmd.Cmd)

2021-11-22 Thread keeely


New submission from keeely :

In the past this was worked around by installing a third-party module:
https://github.com/pyreadline/pyreadline

For Python 3.10, however this module doesn't work.  And pyreadline doesn't seem 
to be maintained anymore, so it's possible it won't get fixed.
https://github.com/pyreadline/pyreadline/issues/73

Consider the following code:

import cmd
import readline

open("history.txt", "w").write("first line\nsecond line\n")

readline.clear_history()
readline.read_history_file("history.txt")

class MyShell(cmd.Cmd):
def __init__(self):
super().__init__()

shell = MyShell()
shell.cmdloop()

This works fine on MacOs Python, also on Linux and on Windows prior to 3.10 
with the readline module added.  It won't work going forward.

The Windows cmd implementation clearly uses readline or some compatible lib 
under the hood, so Python should make it available to developers.

--
components: Library (Lib)
messages: 406778
nosy: keeely
priority: normal
severity: normal
status: open
title: There's no readline module on Windows Python (cmd.Cmd)
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



RE: frozenset can be altered by |=

2021-11-22 Thread David Raymond
>> (venv_3_10) marco@buzz:~$ python
>> Python 3.10.0 (heads/3.10-dirty:f6e8b80d20, Nov 18 2021, 19:16:18)
>> [GCC 10.1.1 20200718] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> a = frozenset((3, 4))
>> >>> a
>> frozenset({3, 4})
>> >>> a |= {5,}
>> >>> a
>> frozenset({3, 4, 5})
> 
> That's the same as how "x = 4; x += 1" can "alter" four into five.
> 
> >>> a = frozenset((3, 4))
> >>> id(a), a
> (140545764976096, frozenset({3, 4}))
> >>> a |= {5,}
> >>> id(a), a
> (140545763014944, frozenset({3, 4, 5}))
> 
> It's a different frozenset.
> 
> ChrisA

Another possible option is instead of

a |= {5,}

change it to

a.update({5,})

If a is a regular set it will update the original object, and if a is a 
frozenset it will raise an AttributeError. Which may not be what you want, but 
at least it won't quietly do something you weren't expecting.

It is a little confusing since the docs list this in a section that says they 
don't apply to frozensets, and lists the two versions next to each other as the 
same thing.

https://docs.python.org/3.9/library/stdtypes.html#set-types-set-frozenset

The following table lists operations available for set that do not apply to 
immutable instances of frozenset:

update(*others)
set |= other | ...

Update the set, adding elements from all others.
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset b451673f93465a27ee61e408190ee61cb9dbd5b6 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port mmap, select, and _xxsubinterpreters to Py_STDLIB_MOD (GH-29703)
https://github.com/python/cpython/commit/b451673f93465a27ee61e408190ee61cb9dbd5b6


--

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset 10343bd98390ef15909e3a19f26a6178162996fd by Miss Islington (bot) 
in branch '3.10':
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but 
init=False (GH-29692)
https://github.com/python/cpython/commit/10343bd98390ef15909e3a19f26a6178162996fd


--

___
Python tracker 

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



[issue45857] PEP 604 Union syntax does not support forward references

2021-11-22 Thread Ken Jin


Ken Jin  added the comment:

I think I saw a similar bug report elsewhere (or maybe I'm misremembering). 
Anyways, Eric is right, the correct way is to wrap the entire thing, so 
"Foo|int" instead of "Foo"|int.

@Alex you brought up some good suggestions, I'll try to address them:

> Arguably, either the implementation should be altered to support forward 
> references

Unfortunately that's more complex than it seems. The original draft PEP 604 
proposed implementation actually imported Union from typing.py, and I recall 
Guido disliking the idea that a builtin type should depend on typing.py. I have 
to agree with that philosophy here. I also don't think the alternative -- 
implementing a builtin ForwardRef type isn't worth the complexity unless our 
situation changes.

> the documentation at 
> https://docs.python.org/3/library/stdtypes.html#union-type should be altered 
> to make clear that ...

The first line says: "A union object holds the value of the | (bitwise or) 
operation on multiple type objects." It says *type objects*, which strings 
don't belong to.

@TNThung does Eric's suggestion work for you? Or do you need something else?

--
status: open -> pending

___
Python tracker 

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Joran van Apeldoorn


Change by Joran van Apeldoorn :


--
type:  -> behavior

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-11-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks for the bug report!

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Joran van Apeldoorn


New submission from Joran van Apeldoorn :

The expectation would be that the re.A (or re.ASCII) flag should not impact the 
matching behavior of a regular expression on strings consisting only of ASCII 
characters.  However, for the characters 0x1c till 0x1f, the classes \s and \S 
differ. For ASCII theses characters are not considered space characters while 
for unicode they are. 

Note that python strings do consider these characters spaces as 
'\xc1'.isspace() gives True. 

All other classes and characters stay the same for unicode and ASCII matching.

--
components: Regular Expressions
files: unicode-ascii-space.py
messages: 406773
nosy: control-k, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Unicode and acii regular expressions do not agree on ascii space 
characters
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50457/unicode-ascii-space.py

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-11-22 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset d3062f672c92855b7e9e962ad4bf1a67abd4589b by Eric V. Smith in 
branch 'main':
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but 
init=False (GH-29692)
https://github.com/python/cpython/commit/d3062f672c92855b7e9e962ad4bf1a67abd4589b


--

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-11-22 Thread miss-islington


Change by miss-islington :


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

___
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-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27939
pull_request: https://github.com/python/cpython/pull/29703

___
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-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 5b946cadaa1175a5caae98bd2d309840bea52a58 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port fcntl to Py_STDLIB_MOD (GH-29696)
https://github.com/python/cpython/commit/5b946cadaa1175a5caae98bd2d309840bea52a58


--

___
Python tracker 

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



[issue45865] Old syntax in unittest

2021-11-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

As a general rule, we don't accept large patches with changes like this. The 
chance for breakage somewhere in the 27 files is too high.

I could see maybe dropping inheriting from object, since that's relatively safe.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45867] kwarg default value expression incorrectly evaluated

2021-11-22 Thread Muhamed Itani


Change by Muhamed Itani :


Removed file: https://bugs.python.org/file50456/mpyFrame.pyw

___
Python tracker 

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



[issue45867] kwarg default value expression incorrectly evaluated

2021-11-22 Thread Muhamed Itani


Change by Muhamed Itani :


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



[issue45866] Out of tree build of Python 3.11.0a2+ breaks regen-frozen

2021-11-22 Thread Miro Hrončok

Miro Hrončok  added the comment:

It also seems that it is *not* necessary to use Python 3.11 for regen-frozen to 
get the failure:

$ make regen-frozen PYTHON_FOR_REGEN=python3.10
python3.10 ../../Tools/scripts/freeze_modules.py
ERROR: missing _freeze_module
make: *** [Makefile:1259: regen-frozen] Error 1

$ make regen-frozen PYTHON_FOR_REGEN=python3.9
python3.9 ../../Tools/scripts/freeze_modules.py
ERROR: missing _freeze_module
make: *** [Makefile:1259: regen-frozen] Error 1


My guess is that the fix for test_tools.test_sundry() actually broke the real 
usage. It has:

# When building out of the source tree, get the tool from directory
# of the Python executable
TOOL = os.path.dirname(sys.executable)
TOOL = os.path.join(TOOL, 'Programs', '_freeze_module')

But sys.executable is *not* the Python we have built, but the Python we use for 
regen.
E.g. when Python for regen is /usr/bin/python3.X, it tries to use 
/usr/bin/Programs/_freeze_module which obviously is not there.

The assumption that sys.executable is the freshly built Python is only correct 
in the tests, but not in reality.

--

___
Python tracker 

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



[issue45868] xattr support missing in os module under cygwin

2021-11-22 Thread Oskar Enoksson


New submission from Oskar Enoksson :

With the latest Python 3.8.10 under cygwin the following fails:

>>> import os
>>> os.listxattr('.')
Traceback (most recent call last):
  File "", line 1, in < module>
AttributeError: module 'os' has no attribute 'listxattr'

/usr/include/attr/xattr.h declares the corresponding library functions, so 
something must be wrong in the configuration/compilation of python itself.

--
components: Build
messages: 406768
nosy: enok2
priority: normal
severity: normal
status: open
title: xattr support missing in os module under cygwin
type: crash
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



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

2021-11-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27938
pull_request: https://github.com/python/cpython/pull/29702

___
Python tracker 

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



[issue45402] ERROR: test_sundry (test.test_tools.test_sundry.TestSundryScripts): SystemExit: ERROR: missing _freeze_module

2021-11-22 Thread Miro Hrončok

Miro Hrončok  added the comment:

There seem to be a regression in this fix, see 
https://bugs.python.org/issue45866

--

___
Python tracker 

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



[issue45866] Out of tree build of Python 3.11.0a2+ breaks regen-frozen

2021-11-22 Thread Miro Hrončok

Miro Hrončok  added the comment:

git bisect says:

ff8859d965815e8b5af346bd90299cfa5568c855 is the first new commit
commit ff8859d965815e8b5af346bd90299cfa5568c855
Author: Victor Stinner 
Date:   Thu Oct 7 21:19:13 2021 +0200

bpo-45402: Fix test_tools.test_sundry() (GH-28786)

Fix test_tools.test_sundry() when Python is built out of tree: fix
how the freeze_modules.py tool locates the _freeze_module program.

 Misc/NEWS.d/next/Tests/2021-10-07-13-43-01.bpo-45402.jlQvep.rst | 3 +++
 Tools/scripts/freeze_modules.py | 7 ---
 2 files changed, 7 insertions(+), 3 deletions(-)
 create mode 100644 
Misc/NEWS.d/next/Tests/2021-10-07-13-43-01.bpo-45402.jlQvep.rst

It seems the fix for an out-of-tree build bug introduced another one.

--

___
Python tracker 

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



[issue45867] kwarg default value expression incorrectly evaluated

2021-11-22 Thread Muhamed Itani


New submission from Muhamed Itani :

I have an MPYFrame class that inherits from tkinter.Frame. It's init looks like 
this:

from os.path import normcase,normpath
def 
__init__(self,master=None,port=None,baudrate=115200,timeout=1,localFolder=normcase(normpath(os.getcwd(:

The problem is, when I check/access the value of localFolder later in the code 
(even directly as a first statement within __init__), it is obvious that 
os.getcwd() is executing, but normcase and/or normpath are not. The resulting 
path contains capital letters (tested on Windows 11), even though it should 
not. If I run:
localFolder=normcase(normpath(localFolder))

as a first statement after init, then check the value of localFolder (for 
example at a debugging breakpoint), it correctly then contains a normalized 
path in which all letters have been converted to lowercase (but only after the 
statement itself has executed).

--
components: Parser
files: mpyFrame.pyw
messages: 406765
nosy: lys.nikolaou, moefear85, pablogsal
priority: normal
severity: normal
status: open
title: kwarg default value expression incorrectly evaluated
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50456/mpyFrame.pyw

___
Python tracker 

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



[issue45723] Improve and simplify configure.ac checks

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27937
pull_request: https://github.com/python/cpython/pull/29701

___
Python tracker 

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



  1   2   >