[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch


Anders Munch  added the comment:

I discovered that this can happen with underscores as well:

Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'en_DE')
'en_DE'
>>> locale.getlocale()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\flonidan\env\Python38-64\lib\locale.py", line 591, in getlocale
return _parse_localename(localename)
  File "C:\flonidan\env\Python38-64\lib\locale.py", line 499, in 
_parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: en_DE

locale.setlocale does validate input - if you write nonsense in the second 
argument then you get an exception, "locale.Error: unsupported locale setting". 
 So I'm guessing the en_DE locale is actually being set here, and the problem 
is solely about getlocale making unfounded assumptions about the format.

Same thing happens in 3.10.0a4.

--

___
Python tracker 

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



[issue43103] Add configure --without-static-libpython to not build libpython3.10.a

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 801bb0b5035f8eeafe389dc082c02dfafaa07f6a by Victor Stinner in 
branch 'master':
bpo-43103: Add configure --without-static-libpython (GH-24418)
https://github.com/python/cpython/commit/801bb0b5035f8eeafe389dc082c02dfafaa07f6a


--

___
Python tracker 

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



Re: [issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread M.-A. Lemburg
On 17.02.2021 10:55, Anders Munch wrote:
 import locale
 locale.setlocale(locale.LC_ALL, 'en_DE')
> 'en_DE'
 locale.getlocale()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\flonidan\env\Python38-64\lib\locale.py", line 591, in getlocale
> return _parse_localename(localename)
>   File "C:\flonidan\env\Python38-64\lib\locale.py", line 499, in 
> _parse_localename
> raise ValueError('unknown locale: %s' % localename)
> ValueError: unknown locale: en_DE

The locale module does not know this encoding, so cannot
guess the encoding. Since getlocale() returns the language
code and encoding, this fails.

If you add the encoding, you should be fine:

>>> locale.setlocale(locale.LC_ALL, 'en_DE.UTF-8')
'en_DE.UTF-8'
>>> locale.getlocale()
('en_DE', 'UTF-8')

-- 
Marc-Andre Lemburg
eGenix.com

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



[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-02-17 Thread Jonathan Slenders


Jonathan Slenders  added the comment:

The following patch to inspect.py solves the issue that inspect.signature() 
returns the wrong signature on classes that inherit from Generic. Not 100% sure 
though if this implementation is the cleanest way possible. I've been looking 
into attaching a __wrapped__ to Generic as well, without success. I'm not very 
familiar with the inspect code.

To me, this fix is pretty important. ptpython, a Python REPL, has the ability 
to show the function signature of what the user is currently typing, and with 
codebases that have lots of generics, there's nothing really useful we can show.


 $ diff inspect.old.py  inspect.py  -p
*** inspect.old.py  2021-02-17 11:35:50.787234264 +0100
--- inspect.py  2021-02-17 11:35:10.131407202 +0100
*** import sys
*** 44,49 
--- 44,50 
  import tokenize
  import token
  import types
+ import typing
  import warnings
  import functools
  import builtins
*** def _signature_get_user_defined_method(c
*** 1715,1720 
--- 1716,1725 
  except AttributeError:
  return
  else:
+ if meth in (typing.Generic.__new__, typing.Protocol.__new__):
+ # Exclude methods from the typing module.
+ return
+
  if not isinstance(meth, _NonUserDefinedCallables):
  # Once '__signature__' will be added to 'C'-level
  # callables, this check won't be necessary


***

For those interested, the following monkey-patch has the same effect:

def monkey_patch_typing() -> None:
import inspect, typing
def _signature_get_user_defined_method(cls, method_name):
try:
meth = getattr(cls, method_name)
except AttributeError:
return
else:
if meth in (typing.Generic.__new__, typing.Protocol.__new__):
# Exclude methods from the typing module.
return

if not isinstance(meth, inspect._NonUserDefinedCallables):
# Once '__signature__' will be added to 'C'-level
# callables, this check won't be necessary
return meth

inspect._signature_get_user_defined_method = 
_signature_get_user_defined_method

monkey_patch_typing()

--
nosy: +jonathan.slenders

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset cd80f430daa7dfe7feeb431ed34f88db5f64aa30 by Erlend Egeberg 
Aasland in branch 'master':
bpo-40170: Always define PyExceptionClass_Name() as a function (GH-24553)
https://github.com/python/cpython/commit/cd80f430daa7dfe7feeb431ed34f88db5f64aa30


--

___
Python tracker 

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



[issue43155] PyCMethod_New not defined in python3.lib

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ebe20d9e7eb138c053958bc0a3058d34c6e1a679 by Zackery Spytz in 
branch '3.9':
bpo-43155: Add PyCMethod_New to PC/python3.def (GH-24500) (GH-24554)
https://github.com/python/cpython/commit/ebe20d9e7eb138c053958bc0a3058d34c6e1a679


--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

> For PySequence_ITEM, I guess adding a private C version (for example 
> _PySequence_Item) and redirecting the macro to the C version would be 
> acceptable.

This can introduce a performance slowdown and so should wait until the PEP 620 
is accepted.

--

___
Python tracker 

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



[issue43155] PyCMethod_New not defined in python3.lib

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Barry for the bug report and thanks Zackery for the fix! It's now fixed.

See bpo-43235 and bpo-43239 follow-up issues.

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



[issue43103] Add configure --without-static-libpython to not build libpython3.10.a

2021-02-17 Thread STINNER Victor


Change by STINNER Victor :


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



[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

I consider that this issue is now fixed by bpo-43103 with the addition of a new 
configure --without-static-libpython option.

If someone prefers to remove python.o and get it from libpython.a, please open 
a separated issue.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Add configure --without-static-libpython to not build 
libpython3.10.a

___
Python tracker 

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



[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2021-02-17 Thread Alexander


Alexander  added the comment:

Hi,
This issue was also confirmed by a Verge3D user (Python 3.7.7)
https://www.soft8soft.com/topic/export-gltf-error

--
nosy: +alexkowel

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> This can introduce a performance slowdown and so should wait until the PEP 
> 620 is accepted.

Noted.

--

___
Python tracker 

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



[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch


Anders Munch  added the comment:

getlocale is documented to return None for the encoding if no encoding can be 
determined.  There's no need to guess.

I can't change the locale.setlocale call, because where I'm actually having the 
problem, I'm not even calling locale.setlocale: wxWidgets is calling C 
setlocale, that's where it comes from.

wxWidgets aside, it doesn't seem right that getlocale fails when setlocale 
succeeded.

--

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2021-02-17 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

I believe we can close this old issue.

The discussion was certainly a useful one. I guess we should stop updating the 
alias table automatically and instead add new aliases or change existing ones 
based on more research and using the X11 files as well as glibc and other 
resources to help.

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



[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 17.02.2021 12:36, Anders Munch wrote:
> getlocale is documented to return None for the encoding if no encoding can be 
> determined.  There's no need to guess.

Well, not quite... the documentation says that None can be returned,
not that it will return None in such cases.

What happens is that the value returned by the C lib's setlocale()
is normalized and parsed. If it doesn't include an encoding,
the table locale_alias is used to provide an encoding. If this
table does not include the locale, you get the ValueError.

We could enhance this to return None for the encoding instead
of raising an exception, but would this really help ?

Alternatively, we could add "en_DE" to the alias table and set
a default encoding to use. I assume this would have to be
ISO8859-15. OTOH, Windows supports UTF-8 for all locales in
more recent Windows versions, so perhaps we should use UTF-8
instead.

BTW: What is wxWidgets doing with the returned values ?

Resources:
- setlocale() in Visual C++ on Windows:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-160
- locale name formats supported by Windows CRT:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-strings?view=msvc-160
- Language locale tags known by Windows:

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c
- UTF8 support in Windows CRT:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-160#utf-8-support

--

___
Python tracker 

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



[issue43241] curses.h: present but cannot be compiled while building with custom CPPFLAGS

2021-02-17 Thread Xuehai Pan


New submission from Xuehai Pan :

I install python3 with Linuxbrew. All header files have been symlinked to 
"~/.linuxbrew/inlcude". It raises warnings when I building with custom CPPFLAGS.

```
checking curses.h usability... no
checking curses.h presence... yes
configure: WARNING: curses.h: present but cannot be compiled
configure: WARNING: curses.h: check for missing prerequisite headers?
configure: WARNING: curses.h: see the Autoconf documentation
configure: WARNING: curses.h: section "Present But Cannot Be Compiled"
configure: WARNING: curses.h: proceeding with the compiler's result
configure: WARNING: ## --- ##
configure: WARNING: ## Report this to https://bugs.python.org/ ##
configure: WARNING: ## --- ##
checking for curses.h... no
checking ncurses.h usability... no
checking ncurses.h presence... yes
configure: WARNING: ncurses.h: present but cannot be compiled
configure: WARNING: ncurses.h: check for missing prerequisite headers?
configure: WARNING: ncurses.h: see the Autoconf documentation
configure: WARNING: ncurses.h: section "Present But Cannot Be Compiled"
configure: WARNING: ncurses.h: proceeding with the compiler's result
configure: WARNING: ## --- ##
configure: WARNING: ## Report this to https://bugs.python.org/ ##
configure: WARNING: ## --- ##
checking for ncurses.h... no
checking for term.h... yes
```

See https://github.com/Homebrew/linuxbrew-core/pull/22307 for more details.

--
components: Build
files: Screenshot config master.png
messages: 387150
nosy: XuehaiPan
priority: normal
severity: normal
status: open
title: curses.h: present but cannot be compiled while building with custom 
CPPFLAGS
type: compile error
versions: Python 3.9
Added file: https://bugs.python.org/file49814/Screenshot config master.png

___
Python tracker 

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



[issue28179] Segfault in test_recursionlimit_fatalerror

2021-02-17 Thread Irit Katriel


Irit Katriel  added the comment:

I'm not seeing this crash on master. I believe is was fixed under issue42500, 
which add this case as a unit test: see recurse_in_body_and_except  in 

https://github.com/python/cpython/commit/4e7a69bdb63a104587759d7784124492dcdd496e#diff-3dbd58a46964dc5908595a1caa552fa3f5e2e46610679634ffc1064fd7cc3c8fR1106

--
nosy: +iritkatriel
resolution:  -> duplicate
status: open -> pending
superseder:  -> crash with unbounded recursion in except statement

___
Python tracker 

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



[issue43241] curses.h: present but cannot be compiled while building with custom CPPFLAGS

2021-02-17 Thread Xuehai Pan


Xuehai Pan  added the comment:

./configure raised "WARNING: curses.h: present but cannot be compiled" when 
CPPFLAGS="-I. -I/Include -I${HOMEBREW_PREFIX}/include".

./configure found and compiled with ncurses successfully when CPPFLAGS="-I. 
-I/Include -I${HOMEBREW_PREFIX}/include -I$(brew --prefix ncurses)/include"

It's really weird that all headers in "$(brew --prefix ncurses)/include" are 
already symlinked to "${HOMEBREW_PREFIX}/include".

--

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-02-17 Thread Irit Katriel


Irit Katriel  added the comment:

Still the same in 3.10:

Python 3.10.0a5+ (heads/master:bf2e7e55d7, Feb 11 2021, 23:09:25) [MSC v.1928 
64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print 3
  File "", line 1
print 3
  ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(3)?
>>> def f(x): return x
...
>>> print f(3)
  File "", line 1
print f(3)
  ^
SyntaxError: invalid syntax

--
nosy: +iritkatriel
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue43241] curses.h: present but cannot be compiled while building with custom CPPFLAGS

2021-02-17 Thread Xuehai Pan


Xuehai Pan  added the comment:

Add screenshot.

--
Added file: https://bugs.python.org/file49815/Screenshot.png

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-02-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Would it be too much if add a Python 2 rule for print statement in grammar to 
produce better error message?

invalid_print_stmt:
| 'print' ( test (',' test)* [','] ] |
'>>' test [ (',' test)+ [','] ) {
  RAISE_INVALID_PRINT_STATEMENT() }

--
nosy: +pablogsal

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-17 Thread John Paul Adrian Glaubitz


John Paul Adrian Glaubitz  added the comment:

> What is the use case or benefit of building Python for 32-bit rather than 
> 64-bit?

That's not really the question. The question is whether an upstream project 
should prevent downstreams from using unsupported target configurations and I 
think the answer to that question is no.

Python is free software (as opposed to just open source software) and one of 
the key features of free software is that you don't tell your users how they 
use your software. Open source licenses that limit use cases of software are 
considered non-free by most if not all Linux distributions for that very reason.

There are valid reasons for preventing your software from being built on 
certain targets - such as the maintenance burden for architecture-specific code 
- but none of them apply here. A few lines of autoconf plus some preprocessor 
macros don't pose any burden and therefore the choice should be in favor of 
allowing downstreams to build unsupported configurations.

As for providing a CI: Setting up a CI machine for individual upstream projects 
is not a problem for big corporations like IBM or Intel, but it is certainly a 
hassle for individual open source developers and hobbyists. And while we 
(Debian Ports) have provided some CI machines for individual upstream projects 
such as GCC and LLVM, it should be sufficient for most upstream projects to 
rely on Debian's buildd infrastructure as we simply don't have the resources 
that big corporations have.

As for your original question: We still maintain multiple 32-bit ports in 
Debian, both as official and unofficial releases, and the same is done in other 
Linux distributions such as Gentoo, openSUSE, Void and others. Lots of 
hobbyists are pouring a lot of lifeblood and efforts into these ports such as 
m68k - which has still a surprisingly large user base thanks to retro-computing 
fans - which is why I am kindly asking you to not put up any obstacles into our 
ways.

As I said before, the Python interpreter is one of these excellent works of 
engineering that just work. Other interpreters/compilers such as OpenJDK, Ruby, 
Go or Rust require much more attention to keep them portable while the Python 
interpreter has never caused any issues which is something I am very grateful 
for, in particular given the fact how much other code directly depends on the 
Python interpreter to work (just think of the many package managers and other 
system tools written in Python).

So I think I can speak for Debian, Gentoo and many other downstream projects 
that it is important for many that it stays that way. Of course, that shouldn't 
Python development keep from moving forward and if the dependence on 
architecture-dependent code should increase at some point, we can still discuss 
this issue again and we will be more than happy to help with the porting 
efforts.

Thank You!

--

___
Python tracker 

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



[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch


Anders Munch  added the comment:

> BTW: What is wxWidgets doing with the returned values ?

wxWidgets doesn't call getlocale, it's a C++ library (wrapped by wxPython) that 
uses C setlocale.

What does use getlocale is time.strptime and datetime.datetime.strptime, so 
when getlocale fails, strptime fails.

> We could enhance this to return None for the encoding instead
> of raising an exception, but would this really help ?

Very much so.

Frankly, I don't get the impression that the current locale preferred encoding 
is used for *anything*.  Other than possibly having a role in implementing 
getpreferredencoding.

> Alternatively, we could add "en_DE" to the alias table and set
> a default encoding to use. 

Where would you get a complete list of all the new aliases that would need be 
to be added?

As the "en_DE" example shows, you'd need all combinations of languages and 
regions.  That's going to be a very long list.

--

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-02-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Would it be too much if add a Python 2 rule for print statement in grammar to 
> produce better error message?

Please, go ahead. I think it makes sense and with our latest change in the 
parser, such new error message will have no impact on performance whatsoever. 
Please, at me as a reviewer :)

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-17 Thread Irit Katriel


Irit Katriel  added the comment:

Let's split the print_exception(None) case (new issue) from the regression. 
I've updated the PR to fix only the latter, which is not controversial. 

I don't know what print_exception(None) should do.

--

___
Python tracker 

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



[issue28404] Logging SyslogHandler not appending '\n' to the end

2021-02-17 Thread rea haas


Change by rea haas :


--
nosy: +reahaas
nosy_count: 2.0 -> 3.0
pull_requests: +23337
pull_request: https://github.com/python/cpython/pull/24556

___
Python tracker 

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



[issue25737] array is not a Sequence

2021-02-17 Thread Irit Katriel


Irit Katriel  added the comment:

This works now:

>>> from array import array
>>> from collections.abc import Sequence
>>> isinstance(array('I', [1]), Sequence)
True

It was fixed under issue29727.

--
nosy: +iritkatriel
resolution:  -> duplicate
status: open -> closed
superseder:  -> collections.abc.Reversible doesn't fully support the reversing 
protocol

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-17 Thread Christian Heimes


Christian Heimes  added the comment:

> That's not really the question. The question is whether an upstream project 
> should prevent downstreams from using unsupported target configurations and I 
> think the answer to that question is no.

We are not (actively) prevent unsupported target. We are merely removing unused 
code that we cannot test. Downstream is free to re-apply or maintain additional 
patches to enable platforms that we don't support. The rules for platform 
support are explained in PEP 11.

> Python is free software (as opposed to just open source software) and one of 
> the key features of free software is that you don't tell your users how they 
> use your software.

Free software doesn't mean free labor. Upstream is free to choose how we spend 
our time on the project or which patches we accept. For platform support we 
have (IMHO) reasonable rules for code: Python must compile, work, and pass a 
sufficient set of its test suite.

While "Python" software is free, the trademark, logo, and rights to the name 
"Python" are owned by the PSF. The trademark rules are also reasonable. On very 
few occasions the PSF has asked developers to choose a different name to avoid 
confusion. For example we asked the developer of a Python 2.8 fork to rename. 
The fork is now known a Tauthon. Platform compatibility patches are fine.

I see three ways to resolve the dispute:

1) You provide and support CI for s390, we keep the platform triplet. I would 
be even fine with an unstable buildbot or external CI that builds and runs out 
test suite regularly.
2) We remove the platform, you maintain downstream patches. The patch in 
GH-24534 is small and trivial.
3) You contact the Python Steering Council and request a decision. The SC is 
our elect government and makes final decisions.

I'm going to hold off and delay PR 24534 for at least two weeks to give you 
time to work on (1) or (3).

--

___
Python tracker 

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



[issue43241] curses.h: present but cannot be compiled while building with custom CPPFLAGS

2021-02-17 Thread Xuehai Pan


Change by Xuehai Pan :


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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-17 Thread David Edelsohn


David Edelsohn  added the comment:

I already am running a Debian s390x buildbot for Python.  Someone can adjust 
the rules for the buildbot to include a 31-bit builder.  The Debian buildbot 
has relatively few builder variants relative to the other s390x targets.

--

___
Python tracker 

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



[issue43239] PyCFunction_New is not exported with PyAPI_FUNC

2021-02-17 Thread hai shi


hai shi  added the comment:

>> PyCFunction_NewEx is part of the limited API as well, even though it's 
>> undocumented. People can call it.
>
>Wait no, I wrote too soon.
>PyCFunction_NewEx is part of the limited API as well, even though it's 
>>undocumented. People can call it.

Find some 3rd user calling this function in: 
https://searchcode.com/?q=PyCFunction_NewEx+. So I prefer to keep it too.
If calling `PyCFunction_New()` is better than `PyCFunction_NewEx()`, MAYBE we 
can add some description info in PR 24551.

--
nosy: +shihai1991

___
Python tracker 

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



[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Eryk Sun


Eryk Sun  added the comment:

> What does use getlocale is time.strptime and datetime.datetime.strptime

calendar.LocaleTextCalendar also uses getlocale() and getdefaultlocale(). The 
result from getdefaultlocale() cannot be set via setlocale() in Windows, which 
also breaks resetlocale().

>>> locale.getdefaultlocale()
('en_GB', 'cp1252')
>>> locale._build_localename(locale.getdefaultlocale())
'en_GB.cp1252'

This is doubly invalid. It's a BCP-47 locale name with an encoding that's not 
UTF-8. As of Windows 10 v1803, UTF-8 is supported in ucrt locales, and for 
BCP-47 locale names, only UTF-8 is allowed to be set explicitly. (If not set to 
UTF-8 explicitly, then ucrt implicitly uses the given locale's legacy ANSI code 
page.) Even if something other than UTF-8 were allowed, ucrt will not accept a 
code page with a "cp" prefix.

Default LocaleTextCalendar case:

>>> c = calendar.LocaleTextCalendar()
>>> try: c.formatweekday(1, 10)
... except Exception as e: print(e)
...
unsupported locale setting

It works as long as setting the locale succeeds and it can restore the original 
locale. For example, setting "es" (Spanish):

>>> c = calendar.LocaleTextCalendar(locale='es')
>>> locale.setlocale(locale.LC_TIME, 'C')
'C'
>>> c.formatweekday(1, 10)
'  martes  '

Now try with the current locale as a BCP-47 locale name.

>>> locale.setlocale(locale.LC_TIME, 'en')
'en'

The parsed getlocale() result is, like with the default locale, doubly invalid. 
It's a BCP-47 locale name with an encoding that's not UTF-8, and the 
'ISO8859-1' codeset is meaningless to ucrt.

>>> locale.getlocale(locale.LC_TIME)
('en_US', 'ISO8859-1')

So restoring the locale fails:

>>> try: c.formatweekday(1, 10)
... except Exception as e: print(e)
...
unsupported locale setting

and it's still set to "es":

>>> locale.setlocale(locale.LC_TIME)
'es'

--
nosy: +eryksun

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-17 Thread Christian Heimes


Christian Heimes  added the comment:

David, this bug is about s390, not s390x. The s390x platform is supported and 
tested.

--

___
Python tracker 

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



[issue43242] Add Void type to typing library

2021-02-17 Thread ocket8888


New submission from ocket :

It'd be nice to have a "void" type that indicates to static type checkers that 
a function/method cannot be used in a valid assignment.

--
components: Library (Lib)
messages: 387166
nosy: ocket
priority: normal
severity: normal
status: open
title: Add Void type to typing library
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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-17 Thread David Edelsohn


David Edelsohn  added the comment:

I understand the issue is s390, not s390x.  I am offering that there already is 
an s390x worker, so would it be sufficient to build and test Python in 31 bit 
mode on that worker as opposed to installing a complete s390 Debian system?

--

___
Python tracker 

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



[issue43242] Add Void type to typing library

2021-02-17 Thread ocket8888


Change by ocket :


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

___
Python tracker 

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



[issue43240] IDLE Classic Unix keyboard shortcuts broken

2021-02-17 Thread Alan Moore


Alan Moore  added the comment:

An interesting note this morning, and again I don't know if this is actually an 
IDLE bug; I had left IDLE running overnight and opened a new code window this 
morning.  Somehow IDLE "forgot" that Ctrl-N means "next line" and not "new 
window".  I closed all my firefox windows, then went into IDLE settings, 
changed the key set to something else and back to Classic Unix, now it works 
correctly again.

Firefox has been known to steal my keyboard input from time to time when not 
focused, though it's usually all-or-nothing.  I don't know if it's the culprit 
or if I'm just blaming it due to past prejudice, but it seems to set things 
right in IDLE faster if I close all firefox windows.

In any case, I don't know if this could be an IDLE bug or not, just thought I'd 
share.

--

___
Python tracker 

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



[issue43243] Strict ABC classes

2021-02-17 Thread Yurii Karabas


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

Basically, the idea is to add the ability to mark abstract classes as strict.

What does this mean - in case when a class inherits from a strict abstract base 
class and doesn't implement all abstract methods then it will fail to create a 
class.

For instance:
>>> class Iterable(ABC, strict=True):
...   @abstractmethod
...   def __iter__(self):
...  pass

>>> class MyClass(Iterable):
...   pass
TypeError: Can't create class MyClass with unimplemented strict abstract method 
__iter__

That allows creating abc classes and be sure that class defines a required 
method, it will be perfrormed on a class declaration stage rather than class 
instance creation.

--
components: Library (Lib)
messages: 387169
nosy: uriyyo
priority: normal
severity: normal
status: open
title: Strict ABC classes
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



[issue43243] Strict ABC classes

2021-02-17 Thread Yurii Karabas


Change by Yurii Karabas <1998uri...@gmail.com>:


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

___
Python tracker 

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



[issue43240] IDLE Classic Unix keyboard shortcuts broken

2021-02-17 Thread Alan Moore


Alan Moore  added the comment:

Ok, sorry to keep poking at this issue, but I think I was too hasty in blaming 
firefox.

As I previously mentioned, IDLE "forgot" that Ctrl-N meant "next line" and 
reverted it to "new window".  I fixed that behavior by changing and resetting 
the key set, HOWEVER, now the multiple-key sequences like Ctrl-X-Ctrl-S are 
broken again.  Closing all other programs, rebooting the system, defaulting my 
IDLE configuration -- none of that makes a difference.  Truly I'm baffled.

Is there actually code in IDLE/Tkinter to handle those kind of keyboard 
shortcuts, or is that a Tcl/Tk feature that is merely exposed by the Python 
side?  If the former, could someone point me in the direction of said code?

--

___
Python tracker 

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



[issue43228] Regression in function builtins

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

In short, cloudpickle recreates a function in two steps:

* Create a function object: globals doesn't contain "__builtins__" key
* Update the function attributes (especially __globals__) with 
cloudpickle.cloudpicke_fast._function_setstate() which always sets 
"__builtins__" in the function __globals__ dictionary.

def _function_setstate(obj, state):
...
state, slotstate = state
...
obj_globals = slotstate.pop("__globals__")
...
obj.__globals__.update(obj_globals)
obj.__globals__["__builtins__"] = __builtins__
...

The internal PyFunctionObject.func_builtins can only by set when a function is 
created, it cannot be updated later.

Why not exposing it in funcobject.c (func_memberlist) as we do for closure, 
doc, globals and module? So cloudpickle can hack it for its usage. 
Documentation of these function attributes:
https://docs.python.org/dev/library/inspect.html#types-and-members

In Python 3.9, _PyFrame_New_NoTrack() starts by looking at builtins in the 
parent frame ("back"): use builtins of the parent frame if the parent frame 
uses exactly the same dictionary of globals. Then it looks for "__builtins__" 
keys in the globals dictionary.

In the current Python 3.10, the builtins are retrieved from the internal 
PyFunctionObject.func_builtins member.

Here is the raw pickle bytecode created by cloudpickle:

$ ./python -m pickletools bug.pickle
0: \x80 PROTO  5
2: \x95 FRAME  479
   11: \x8c SHORT_BINUNICODE 'cloudpickle.cloudpickle'
   36: \x94 MEMOIZE(as 0)
   37: \x8c SHORT_BINUNICODE '_builtin_type'
   52: \x94 MEMOIZE(as 1)
   53: \x93 STACK_GLOBAL
   54: \x94 MEMOIZE(as 2)
   55: \x8c SHORT_BINUNICODE 'LambdaType'
   67: \x94 MEMOIZE(as 3)
   68: \x85 TUPLE1
   69: \x94 MEMOIZE(as 4)
   70: RREDUCE
   71: \x94 MEMOIZE(as 5)
   72: (MARK
   73: hBINGET 2
   75: \x8c SHORT_BINUNICODE 'CodeType'
   85: \x94 MEMOIZE(as 6)
   86: \x85 TUPLE1
   87: \x94 MEMOIZE(as 7)
   88: RREDUCE
   89: \x94 MEMOIZE(as 8)
   90: (MARK
   91: KBININT11
   93: KBININT10
   95: KBININT10
   97: KBININT11
   99: KBININT12
  101: KBININT167
  103: CSHORT_BINBYTES b't\x00|\x00\x83\x01S\x00'
  113: \x94 MEMOIZE(as 9)
  114: NNONE
  115: \x85 TUPLE1
  116: \x94 MEMOIZE(as 10)
  117: \x8c SHORT_BINUNICODE 'len'
  122: \x94 MEMOIZE(as 11)
  123: \x85 TUPLE1
  124: \x94 MEMOIZE(as 12)
  125: \x8c SHORT_BINUNICODE 's'
  128: \x94 MEMOIZE(as 13)
  129: \x85 TUPLE1
  130: \x94 MEMOIZE(as 14)
  131: \x8c SHORT_BINUNICODE 
'/home/vstinner/python/master/cloudpickle_bug.py'
  180: \x94 MEMOIZE(as 15)
  181: \x8c SHORT_BINUNICODE 'func'
  187: \x94 MEMOIZE(as 16)
  188: KBININT14
  190: CSHORT_BINBYTES b'\x00\x01'
  194: \x94 MEMOIZE(as 17)
  195: )EMPTY_TUPLE
  196: )EMPTY_TUPLE
  197: tTUPLE  (MARK at 90)
  198: \x94 MEMOIZE(as 18)
  199: RREDUCE
  200: \x94 MEMOIZE(as 19)
  201: }EMPTY_DICT
  202: \x94 MEMOIZE(as 20)
  203: (MARK
  204: \x8c SHORT_BINUNICODE '__package__'
  217: \x94 MEMOIZE(as 21)
  218: NNONE
  219: \x8c SHORT_BINUNICODE '__name__'
  229: \x94 MEMOIZE(as 22)
  230: \x8c SHORT_BINUNICODE '__main__'
  240: \x94 MEMOIZE(as 23)
  241: \x8c SHORT_BINUNICODE '__file__'
  251: \x94 MEMOIZE(as 24)
  252: hBINGET 15
  254: uSETITEMS   (MARK at 203)
  255: NNONE
  256: NNONE
  257: NNONE
  258: tTUPLE  (MARK at 72)
  259: \x94 MEMOIZE(as 25)
  260: RREDUCE
  261: \x94 MEMOIZE(as 26)
  262: \x8c SHORT_BINUNICODE 'cloudpickle.cloudpickle_fast'
  292: \x94 MEMOIZE(as 27)
  293: \x8c SHORT_BINUNICODE '_function_setstate'
  313: \x94 MEMOIZE(as 28)
  314: \x93 STACK_GLOBAL
  315: \x94 MEMOIZE(as 29)
  316: hBINGET 26
  318: }EMPTY_DICT
  319: \x94 MEMOIZE(as 30)
  320: }EMPTY_DICT
  321: \x94 MEMOIZE(as 31)
  322: (MARK
  323: hBINGET 22
  325: hBINGET 16
  327: \x8c SHORT_BINUNICODE '__qualname__'
  341: \x94 MEMOIZE(as 32)
  342: hBINGET 16
  344: \x8c SHORT_BINUNICODE '__annotations__'
  361: \x94 MEMOIZE(as 33)
  362: }EMPTY_DICT
  363: \x94 MEMOIZE(as 34)
  364: \x8c SHORT_BINUNICODE '__kwdefaults__'
  380: \x94 MEMOIZE(as 35)
  381: NNONE
  382: \x8c SHORT_BINUNICODE '__defaults__'
  396: \x94 MEMOIZE(as 36)
  397: NNONE
  398: \x8c SH

[issue43243] Strict ABC classes

2021-02-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Why is this needed?  Already, instantiation is blocked.

--
nosy: +gvanrossum, rhettinger

___
Python tracker 

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



[issue43228] Regression in function builtins

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

Attached func_builtins2.py mimicks the cloudpicke bug:
---
def func(s): return len(s)

code = func.__code__
FuncType = type(func)

func2_globals = {}
func2 = FuncType(code, func2_globals)
# func2.func_builtins = {'None': None}
func2.__globals__['__builtins__'] = __builtins__

# frame created with {'None': None} builtins: "len" key is missing
func2("abc")
---

In Python 3.10, setting func2.__globals__['__builtins__'] has no longer an 
impact on the frame created to call func2().

--
Added file: https://bugs.python.org/file49816/func_builtins2.py

___
Python tracker 

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



[issue43228] Regression in function builtins

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote _testinernalcapi.get_builtins() function to help me debuging this issue:

diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index ab6c5965d1..250ecc61ab 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -279,6 +279,14 @@ test_atomic_funcs(PyObject *self, PyObject 
*Py_UNUSED(args))
 }
 
 
+static PyObject*
+get_builtins(PyObject *self, PyObject *obj)
+{
+PyFunctionObject *func = (PyFunctionObject *)obj;
+return Py_NewRef(func->func_builtins);
+}
+
+
 static PyMethodDef TestMethods[] = {
 {"get_configs", get_configs, METH_NOARGS},
 {"get_recursion_depth", get_recursion_depth, METH_NOARGS},
@@ -289,6 +297,7 @@ static PyMethodDef TestMethods[] = {
 {"get_config", test_get_config, METH_NOARGS},
 {"set_config", test_set_config, METH_O},
 {"test_atomic_funcs", test_atomic_funcs, METH_NOARGS},
+{"get_builtins", get_builtins, METH_O},
 {NULL, NULL} /* sentinel */
 };

--

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23340
pull_request: https://github.com/python/cpython/pull/24559

___
Python tracker 

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



[issue43228] Regression in function builtins

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 24559 to expose the functions builtins in Python as a new 
__builtins__ attributes on functions, but also to document the subtle behavior 
change.

--

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

> I understand the issue is s390, not s390x.  I am offering that there already 
> is an s390x worker, so would it be sufficient to build and test Python in 31 
> bit mode on that worker as opposed to installing a complete s390 Debian 
> system?

To get a platform supported by Python, we also need a volunteer to fix issues 
specific to the 31 bit s390 platform: see PEP 11.

The policy for platform support evolved last years.

--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +23341
pull_request: https://github.com/python/cpython/pull/24555

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 630264a152115f9671d6b793455ef5c2cea09a97 by Erlend Egeberg 
Aasland in branch 'master':
 bpo-40170: Move 3 NEWS entries to the C API section (GH-24555)
https://github.com/python/cpython/commit/630264a152115f9671d6b793455ef5c2cea09a97


--

___
Python tracker 

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



[issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1

2021-02-17 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy: +aeros

___
Python tracker 

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



[issue26600] MagickMock __str__ sometimes returns MagickMock instead of str

2021-02-17 Thread Irit Katriel


Irit Katriel  added the comment:

The documentation has examples how to set up a mock's __str__.

https://docs.python.org/3/library/unittest.mock.html

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 366dc3a1354078e38808b9c16276e97cca5b8aaf by Nicholas Sim in 
branch 'master':
bpo-35134: Move Include/{pyarena.h,pyctype.h} to Include/cpython/ (GH-24550)
https://github.com/python/cpython/commit/366dc3a1354078e38808b9c16276e97cca5b8aaf


--

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-02-17 Thread STINNER Victor


New submission from STINNER Victor :

Include/cpython/pyarena.h declares 4 functions which are implemented in 
Python/pyarena.c. The header file exists to access these functions from the 
compiler. IMO there was no intent to expose these functions to the public 
Python C API.

Moreover, the PEP 384 explicitly excludes this API from the stable ABI (from 
the limited C API).

I propose to move these functions to the internal C API.

Since these functions are no even documented, I don't think that a deprecation 
period is needed.

Note: The PR 24550 moved Include/pyarena.h to Include/cpython/pyarena.h.

--
components: C API
messages: 387180
nosy: vstinner
priority: normal
severity: normal
status: open
title: Move PyArena C API to the internal C API
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



[issue43243] Strict ABC classes

2021-02-17 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

When I work with ABC classes usually I faced a problem -  I forget to implement 
one of the methods or make a typo in the method name. In such case I will know 
about it only when I will try to instantiate a class.

In case when a hierarchy is big you should go through classes and find the 
exact class where the problem is.

With this feature, in a case when a class inherits from strict ABC and doesn't 
implement all abstract methods of strict classes it will fail at class 
declaration rather than at instance creation as with regular ABC classes.

As an option, I can run mypy every time before start the python interpreter.

The perfect behavior for me is a case when ABC class will be strict by default, 
but it will break the existing code.

Examples to explain the idea:
```
from abc import ABC, abstractmethod

class Base(ABC):
@abstraabstractmethod
def foo(self):
 pass

class A(Base, ABC):  # totally okay, because class directly inherits from ABC
 pass

class B(Base):  # will fail, because class doesn't implement foo method
pass
```

Raymond, could you please explain why the current behavior is default.

--

___
Python tracker 

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



[issue43243] Strict ABC classes

2021-02-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

This discussion is not appropriate for the bug tracker. Try finding a user 
forum to discuss the pros and cons and history of the current functionality. It 
is clear that you have plenty of ways to discover the problem already.

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



[issue43243] Strict ABC classes

2021-02-17 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue43243] Strict ABC classes

2021-02-17 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

Sorry about this, in a future I will use forum for such discussions.

--

___
Python tracker 

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



[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-02-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

I doubt that solution is correct, given that we already established that the 
problem is *not* specific to Generic.

--

___
Python tracker 

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



[issue29187] Pickle failure is raising AttributeError and not PicklingError

2021-02-17 Thread Irit Katriel


Irit Katriel  added the comment:

Still the same in 3.10:

Python 3.10.0a5+ (heads/bpo-43146-dirty:8f5cf4d381, Feb 17 2021, 14:51:27) [MSC 
v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> try:
... def func():
... class C: pass
... return C
... import pickle
... pickle.dumps(func()())
... except BaseException as e:
...   exc = e
...
>>> exc
AttributeError("Can't pickle local object 'func..C'")
>>>

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.5, Python 3.6, Python 
3.7

___
Python tracker 

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



[issue43245] Add keyword argument support to ChainMap.new_child()

2021-02-17 Thread Raymond Hettinger


New submission from Raymond Hettinger :

This would it more convenient to extend chains for local contexts.  Currently, 
we write:

local = parent.new_child(dict(foreground='white', background='cyan'))

Instead, it would be easier to write:

local = parent.new_child(foreground='white', background='cyan')

The new code would look like this:

def new_child(self, m=None, **kwargs):
'''New ChainMap with a new map followed by all previous maps.
If no map is provided, an empty dict is used.
Keyword arguments update the map or new empty dict:
'''
if m is None:
m = kwargs
elif kwargs:
m.update(kwargs)
return self.__class__(m, *self.maps)

--
assignee: rhettinger
components: Library (Lib)
messages: 387186
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Add keyword argument support to ChainMap.new_child()
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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

+1 on exposing f,__builtins__.

Of course, the thing I'd really want is a way to state that all references to 
builtins are meant to have the exact semantics of those builtins, so the 
compiler can translate e.g. len(x) into a new opcode that just calls 
PyObject_Size().  (I can dream, can't I?)

Another dream: assume that globals that refer to modules, classes or functions 
don't change, so they can be cached more aggressively.

I suppose enough checking of dict version tags can get us there, or at least 
close enough.

--

___
Python tracker 

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



[issue43240] IDLE Classic Unix keyboard shortcuts broken

2021-02-17 Thread Alan Moore


Alan Moore  added the comment:

Spent some time today with IDLE and PDB, and I've ruled out any other program 
on my system as the culprit:

- I can create a tkinter GUI that will respond to a binding like 
 and it works fine.
- In pdb, I can bind <> to a callback and it is getting fired when 
Ctrl-x is pressed.  Thus, I was wrong to think anything else is "eating" the 
ctrl-x.
- Also in pdb, an .event_info('<>') call on the editor's Text 
widget returns ('',), so it looks bound 
correctly?  If I generate a <> event, the dialog pops up as it 
should.

Nevertheless, Ctrl-x Ctrl-s opens the find dialog, and no other Ctrl-x (other 
keystroke) binding works.  I'm stumped.

--

___
Python tracker 

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



[issue39820] Bracketed paste mode for REPL: don't execute pasted command before ENTER is pressed explicitly

2021-02-17 Thread Aaron Meurer


Aaron Meurer  added the comment:

To reiterate some points I made in the closed issues 
https://bugs.python.org/issue42819 and https://bugs.python.org/issue32019.

A simple "fix" would be to emulate the non-bracketed paste buffering. That is, 
accept the input using bracketed paste, but split it line by line and send that 
to the REPL. That would achieve some of the benefits of bracketed paste (faster 
pasting), without having to change how the REPL works.

For actually allowing multiline input in the REPL, one issue I see is that the 
so-called "single" compile mode is fundamentally designed around single line 
evaluation. To support proper multiline evaluation, it would need to break from 
this model (which in my opinion is over engineered).

In one of my personal projects, I use a function along the lines of 

import ast

def eval_exec(code, g=None, l=None, *, filename="", noresult=None):
if g is None:
g = globals()
if l is None:
l = g
p = ast.parse(code)
expr = None
res = noresult
if p.body and isinstance(p.body[-1], ast.Expr):
expr = p.body.pop()
code = compile(p, filename, 'exec')
exec(code, g, l)
if expr:
code = compile(ast.Expression(expr.value), filename, 'eval')
res = eval(code, g, l)

return res

This function automatically execs the code, but if the last part of it is an 
expression, it returns it (note that this is much more useful than simply 
printing it). Otherwise it returns a noresult marker (None by default).

I think this sort of functionality in general would be useful in the standard 
library (much more useful than compile('single')), but even ignoring whether it 
should be a public function, this is the sort of thing that is needed for 
"proper" multiline execution in a REPL. Terry mentioned that idle supports 
multiline already. But I tried pasting

a = 1
a

into idle (Python 3.9), and I get the same "SyntaxError: multiple statements 
found while compiling a single statement" error, suggesting it still has the 
same fundamental limitation. 

Also, if it wasn't clear, I should note that this is independent of pasting. 
You can already write

def func():
return 1
func()

manually in the interpreter or IDLE and it will give a syntax error.

--

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

> +1 on exposing f,__builtins__.

This change is related to bpo-43228 "Regression in function builtins": 
cloudpickle is broken by this issue (new PyFunctionObject.func_builtins member).

> Of course, the thing I'd really want is a way to state that all references to 
> builtins are meant to have the exact semantics of those builtins, so the 
> compiler can translate e.g. len(x) into a new opcode that just calls 
> PyObject_Size().  (I can dream, can't I?)

I tried to implement such optimization in my old 
https://faster-cpython.readthedocs.io/fat_python.html project. I implemented 
guards to de-optimize the code if a builtin is overriden.

> I suppose enough checking of dict version tags can get us there, or at least 
> close enough.

The dict version comes from my FAT Python project: PEP 509. It is used to 
optimize method calls. See also PEP 510 and PEP 511 ;-)

--

___
Python tracker 

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



[issue39820] Bracketed paste mode for REPL: don't execute pasted command before ENTER is pressed explicitly

2021-02-17 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



[issue43246] Dict copy optimization violates subclass invariant

2021-02-17 Thread Joshua Bronson

New submission from Joshua Bronson :

If I understand correctly, it should be an invariant that in the code below, 
for all "Parent" classes, for all "method"s, Child1.method should return the 
same result as Child2.method:

```
class Parent:
def __init__(self, value):
self._value = value

def method(self):
return self._value


class Child1(Parent):
pass


c1 = Child1(42)
result = c1.method()
assert result == 42, result


class Child2(Parent):
def method(self):
return super().method()


c2 = Child2(42)
result = c2.method()
assert result == 42, result
```

But when "Parent" is "dict" and method is "__iter__", that is not the case:

```
SHOW_BUG = True

class ChildDict1(dict):
"""Simplification of werkzeug.datastructures.MultiDict."""
def __init__(self):
pass

if not SHOW_BUG:
def __iter__(self):
return super().__iter__()

def add(self, key, value):
self.setdefault(key, []).append(value)

def __setitem__(self, key, value):
"""Like add, but removes any existing key first."""
super().__setitem__(key, [value])

def getall(self, key) -> list:
return super().__getitem__(key)

def __getitem__(self, key):
"""Return the first value for this key."""
return self.getall(key)[0]

def items(self, multi=False):
for (key, values) in super().items():
if multi:
yield from ((key, value) for value in values)
else:
yield key, values[0]

def values(self):
return (values[0] for values in super().values())

# Remaining overridden implementations of methods
# inherited from dict are elided for brevity.


cd1 = ChildDict1()
assert dict(cd1) == {}
cd1[1] = "one"
cd1.add(1, "uno")
assert cd1.getall(1) == ["one", "uno"]
assert list(cd1.items()) == [(1, "one")]
assert list(cd1.values()) == [ "one"]
assert dict(cd1) == {1: "one"}, cd1  # XXX
```

If you run the above as-is, the line marked "XXX" will trigger an 
AssertionError demonstrating the unexpected behavior. If you change SHOW_BUG to 
False, it won’t.

Is it intended that toggling the value of SHOW_BUG in this code causes 
different results?

You can visit https://repl.it/@jab/dict-subclass-copy-surprise to run the 
examples above directly in your browser.

--
messages: 387191
nosy: jab
priority: normal
severity: normal
status: open
title: Dict copy optimization violates subclass invariant
type: behavior

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Well maybe I'll be picking up those ideas again... Thanks for documenting
so much of what you did then!

--

___
Python tracker 

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



[issue43223] [SECURITY] Open Redirection In Python 3.7 & 3.8

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

I can only reproduce the issue if the current directory (directory used by the 
HTTP server, see --directory command line option) contains a .ssh/ subdirectory.

The problem is that the HTTP Header Location starts with "//domain/" and such 
URL is interpreted as an absolute URL of a new domain name ("domain"), rather 
than a relative path of the same domain ("localhost").

Maybe we should simply strip all additional leading slashes to only keep one. 
Replace "//path" or  "/path" with "/path" for example.

---

By the way, http.server uses urllib.parse.urlsplit() on the request URL without 
passing its own domain, and urllib.parse.urlsplit() interprets 
"//attacker.com/path" as if attacker.com is a host with no scheme:

>>> urllib.parse.urlsplit('//attacker.com/path')
SplitResult(scheme='', netloc='attacker.com', path='/path', query='', 
fragment='')

Maybe parse_qs() should be used instead? Or we should reinject the server 
domain and port number? I am not sure that it's an issue in practice.

SimpleHTTPRequestHandler.translate_path('//attacker.com/..%2f..%2f..%2f..%2f..%2f../.ssh')
 returns os.path.join(self.directory, ".ssh"). I don't think that it's an 
issue, it sounds like the expected behavior. We don't attempt to reject ".." in 
URL.

---

To reproduce the issue, I used two terminals.

Terminal 1:

$ python3.8 -V
Python 3.8.7
$ python3.8 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [15/Feb/2021 09:18:20] "GET
//attacker.com/..%2f..%2f..%2f..%2f..%2f../.ssh HTTP/1.1" 301 -

Terminal 2:

$ wget 'http://127.0.0.1:8000//attacker.com/..%2f..%2f..%2f..%2f..%2f../.ssh'
(...)
HTTP request sent, awaiting response... 301 Moved Permanently
Location: //attacker.com/..%2f..%2f..%2f..%2f..%2f../.ssh/ [following]

--2021-02-15 09:18:20--  http://attacker.com/..%2f..%2f..%2f..%2f..%2f../.ssh/
Resolving attacker.com (attacker.com)... 45.88.202.115
Connecting to attacker.com (attacker.com)|45.88.202.115|:80... connected.

(...)

wget is redirected and connects to attacker.com.

The HTTP redirection comes from Lib/http/server.py:

def send_head(self):
path = self.translate_path(self.path)
f = None
if os.path.isdir(path):
parts = urllib.parse.urlsplit(self.path)
if not parts.path.endswith('/'):
# redirect browser - doing basically what apache does
self.send_response(HTTPStatus.MOVED_PERMANENTLY)
new_parts = (parts[0], parts[1], parts[2] + '/',
 parts[3], parts[4])
new_url = urllib.parse.urlunsplit(new_parts)
self.send_header("Location", new_url)
self.end_headers()
return None
...
...

The problem is that the "Location" header starts with "//".

--
nosy: +vstinner

___
Python tracker 

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



[issue43223] [security] http.server: Open Redirection if the URL path starts with //

2021-02-17 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Library (Lib) -Windows
title: [SECURITY] Open Redirection In Python 3.7 & 3.8 -> [security] 
http.server: Open Redirection if the URL path starts with //
versions: +Python 3.10, Python 3.6, Python 3.9

___
Python tracker 

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



[issue42938] [security][CVE-2021-3177] ctypes double representation BoF

2021-02-17 Thread STINNER Victor


STINNER Victor  added the comment:

CVE-2021-3177 has been assigned to this issue:
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3177
* https://access.redhat.com/security/cve/cve-2021-3177

--
title: [security] ctypes double representation BoF -> [security][CVE-2021-3177] 
ctypes double representation BoF

___
Python tracker 

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



[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Steve Dower


Steve Dower  added the comment:

Is this the same as the other issue where get_locale is normalising the result 
according to some particular glibc logic and isn't at all portable?

--

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread Yury Selivanov


Yury Selivanov  added the comment:

> I tried to implement such optimization in my old 
> https://faster-cpython.readthedocs.io/fat_python.html project. I implemented 
> guards to de-optimize the code if a builtin is overriden.

FWIW the globals opcode cache handles all of this now. There's no point in 
specifically optimizing the builtins lookup since we optimize all global 
lookups for a code object that's hot enough.

--

___
Python tracker 

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



[issue42129] Support resources in namespace packages

2021-02-17 Thread Brett Cannon


Brett Cannon  added the comment:

I would harmonize towards what the concrete implementations are doing since 
people who don't implement the defaults will get the appropriate results 
regardless. An entry in What's New will cover any potential notification of the 
change since you can't exactly deprecate this sort of thing.

--

___
Python tracker 

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



[issue43246] Dict copy optimization violates subclass invariant

2021-02-17 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

The cause is in dict_merge (see here: 
https://github.com/python/cpython/blob/master/Objects/dictobject.c ); it has a 
fast path for when the object being merged in (which is what the dict 
constructor does; it makes an empty dict, then merges the provided dict-like) 
is:

1. A dict (or subclass thereof)
2. Which has not overridden __iter__

When that's the case, it assumes it's "dict-compatible" and performs the merge 
with heavy use of dict-internals. When it's not the case (as in your simple 
wrapper), it calls .keys() on the object, iterates that, and uses it to pull 
values via bracket lookup-equivalent code.

I assume the choice of testing __iter__ (really, the C slot for tp_iter, which 
is equivalent) is for performance; it's more expensive to check if keys was 
overridden and/or if the __getitem__ implementation (of which there is more 
than one possibility for slots at the C layer) has been overridden.

What the code is doing is probably logically wrong, but it's significantly 
faster than doing it the right way, and easy to work around (if you're writing 
your own dictionary-like thing with wildly different semantics, 
collections.abc.MutableMapping is probably a better base class to avoid 
inheriting dict-specific weirdness), so it's probably not worth fixing. Leaving 
open for others to discuss.

--
nosy: +josh.r

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

> FWIW the globals opcode cache handles all of this now. There's no point in 
> specifically optimizing the builtins lookup since we optimize all global 
> lookups for a code object that's hot enough.

So you think that even a dedicated "LEN" opcode would not be any faster? (This 
is getting in Paul Sokolovsky territory -- IIRC he has a variant of Python that 
doesn't allow overriding builtins.)

--

___
Python tracker 

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



[issue43247] How to search for a __main__ module using pyclbr in Python3?

2021-02-17 Thread Aviral Srivastava


New submission from Aviral Srivastava :

I want to get all the functions and classes in module: `__main__` of the source 
code directory: `/tmp/rebound/rebound`. 
When I use the `pyclbr.readmodule_ex` API:
```
source_code_data = pyclbr.readmodule_ex(source_code_module, 
path=source_code_path)
```
I specify it the module and it's path:
```
DEBUG:root:Source code module: __main__, Source code path: 
['/tmp/rebound/rebound/rebound']
```
I then get this error:
```
File 
"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/util.py",
 line 69, in _find_spec_from_path
raise ValueError('{}.__spec__ is None'.format(name))
ValueError: __main__.__spec__ is None
```
I then tried to use the function that is not supposed to be used by the public: 
`_readmodule`:
```
source_code_data = pyclbr._readmodule(source_code_module, source_code_path, )
```
But I could not decide what should be the value of the parameter: `inpackage`.

Upon tracing the code via debugger, I spotted a mistake:
```
def _find_spec_from_path(name, path=None):
"""Return the spec for the specified module.

First, sys.modules is checked to see if the module was already imported. If
so, then sys.modules[name].__spec__ is returned. If that happens to be
set to None, then ValueError is raised. If the module is not in
sys.modules, then sys.meta_path is searched for a suitable spec with the
value of 'path' given to the finders. None is returned if no spec could
be found.

Dotted names do not have their parent packages implicitly imported. You will
most likely need to explicitly import all parent packages in the proper
order for a submodule to get the correct spec.

"""
if name not in sys.modules:
return _find_spec(name, path)
else:
module = sys.modules[name]
if module is None:
return None
try:
spec = module.__spec__
except AttributeError:
raise ValueError('{}.__spec__ is not set'.format(name)) from None
else:
if spec is None:
raise ValueError('{}.__spec__ is None'.format(name))
return spec
```
This is the function in the module: `python3.8/importlib/util.py` and it 
evaluates `__main__` as a built-in module as it falls in the `else` block.

How do I differentiate `__main__` of my target source code to read from the 
built-in `__main__`? In other words, how do I read the module `__main__` of the 
codebase: rebound?

--
components: Library (Lib)
messages: 387200
nosy: kebab-mai-haddi
priority: normal
severity: normal
status: open
title: How to search for a __main__ module using pyclbr in Python3?
type: behavior
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



[issue28179] Segfault in test_recursionlimit_fatalerror

2021-02-17 Thread Berker Peksag


Berker Peksag  added the comment:

Yes, this indeed seems to be fixed by issue 42500 and can be closed now. Nice 
detective work, thank you!

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



[issue43246] Dict copy optimization violates subclass invariant

2021-02-17 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-17 Thread Christian Heimes


Christian Heimes  added the comment:

David, could you please provide the output of "gcc -dM -E - < /dev/null" on 
s390x in 31 bit mode? I'm curious and would like to see the platform constants.

--

___
Python tracker 

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