[issue42555] math function sqrt() not working in 3.9

2020-12-03 Thread Christian Heimes


Christian Heimes  added the comment:

You have to import the math module first and then reference the sqrt function 
of the math module.

>>> import math
>>> math.sqrt(25)
5.0

--
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



[issue42533] Document encodings.idna limitations

2020-12-02 Thread Christian Heimes


Christian Heimes  added the comment:

+1 for updating our documentation.

Please use bpo-17305. The ticket contains more information on the issue.

--
superseder:  -> IDNA2008 encoding is missing

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



[issue41626] port shebang of tools from python2 to python3

2020-12-01 Thread Christian Heimes


Christian Heimes  added the comment:

make_ssl_data.py is an internal tool that generates internal header files. It's 
rarely used. The tool is not bound to any Python version, too. Feel free to 
change the shebang or leave it as it is. I don't care.

--

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



[issue42518] Error Message

2020-12-01 Thread Christian Heimes


Change by Christian Heimes :


--
resolution:  -> not a bug
status: open -> closed
type: security -> behavior

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



[issue41837] Upgrade installers to OpenSSL 1.1.1h

2020-12-01 Thread Christian Heimes


Christian Heimes  added the comment:

You may want to hold off until next week:

https://mta.openssl.org/pipermail/openssl-announce/2020-December/000186.html

OpenSSL 1.1.i is a security-fix release. The highest severity issue fixed in 
this release is HIGH.

--

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



[issue34216] python platform no child error

2020-11-30 Thread Christian Heimes


Christian Heimes  added the comment:

The platform module no longer uses popen(). Victor replaced the broken code 
with subprocess in bpo-35346.

--
nosy: +christian.heimes
resolution:  -> fixed
stage:  -> resolved
status: pending -> closed
type: compile error -> behavior

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



[issue41837] Upgrade installers to OpenSSL 1.1.1h

2020-11-30 Thread Christian Heimes


Christian Heimes  added the comment:

Sorry, I missed the initial ping.

The changes look unproblematic to me. Our test suite is passing with 1.1.1h, 
too. Python doesn't set VERIFY_X509_STRICT by default and does not support DTLS.

Please go ahead.

--

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



[issue42495] socket.gethostbyaddr raises error if invalid unicode in hosts

2020-11-29 Thread Christian Heimes


Christian Heimes  added the comment:

I cannot reproduce the issue on Linux:

# echo "127.0.0.2 xn-9q8h" >> /etc/hosts
# python3.8
>>> import socket
>>> socket.gethostbyaddr("127.0.0.2")
('xn-9q8h', [], ['127.0.0.2'])

--
nosy: +christian.heimes
versions:  -Python 3.6, Python 3.7

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



[issue42481] Add to pathlib function to check permission similar to os.access

2020-11-27 Thread Christian Heimes


Christian Heimes  added the comment:

> That's interesting. In Linux, for example, I would expect the access()
> and faccessat() system calls to also check mandatory permissions. I 
> know from experience that at least the [i]mmutable file attribute is 
> checked.

access(2) takes extended file attributes like immutable bit and CAPS into 
account. For example it returns True for access("testfile", R_OK) for testfile 
with DAC permission 0o000 and process context with CAP_DAC_OVERRIDE. I would 
also bet that it handles POSIX ACLs correcty.

But LSM and seccomp are not evaluated by access() -- at least SELinux is not. A 
seccomp syscall filter can have a BPF program attached to. It's a powerful 
feature that allows filtering and blocking by syscall argument.

$ python3
>>> os.access("testfile", os.R_OK)
True
>>> open("testfile")
Traceback (most recent call last):
...
PermissionError: [Errno 13] Permission denied: 'testfile'

# ausearch -m AVC
...
time->Fri Nov 27 16:14:31 2020
type=AVC msg=audit(1606490071.292:4204): avc:  denied  { read } for  pid=293015 
comm="httpd" name="testfile" dev="dm-0" ino=399163 
scontext=system_u:system_r:httpd_t:s0 
tcontext=unconfined_u:object_r:testcontext_t:s0 tclass=file permissive=0

--

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



[issue42481] Add to pathlib function to check permission similar to os.access

2020-11-27 Thread Christian Heimes


Christian Heimes  added the comment:

A word of warning: os.access() is not a good and sufficient permission check. 
It only checks DAC (discrete access control) permissions and suffers from 
TOCTOU issues. Operating systems have additional permission checks and security 
policies, for example  mandatory access control (AppArmor, SELinux, Smack) and 
seccomp.

--
nosy: +christian.heimes

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



[issue42472] security hole in eval()

2020-11-26 Thread Christian Heimes


Christian Heimes  added the comment:

Your assumption is incorrect. The eval() does not promise that default builtins 
cannot be access through other means. The behavior has been discussed several 
times and at great length over the past decade.

--

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



[issue42472] security hole in eval()

2020-11-26 Thread Christian Heimes


Christian Heimes  added the comment:

Would you care to explain why this should not work and how this behavior is in 
violation of the language specification?

It is perfectly valid expression. From a security perspective it may be an 
undesired feature. However Python does neither claim nor promise that eval is 
secure, see articel https://lwn.net/Articles/574215/ for more information on a 
failed attempt to sandbox Python. There is also ast.literal_eval() function, 
which provides limit evaluation of simple expressions.

--
nosy: +christian.heimes

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



[issue29980] OSError: multiple exceptions should preserve the exception type if it is common

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

The feature request reminds me of 
https://github.com/python-trio/trio/issues/611. Nathaniel and Yury have been 
discussing the idea of a MultiError handler for a while.

--
nosy: +christian.heimes

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



[issue21564] Declaration of EVP_MD_CTX causes crash when switching between OpenSSL 0.9 and 1.0

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

The code has changed a lot since this bug was opened. It's no longer an issue. 
Thanks for checking!

--
resolution: out of date -> fixed
stage:  -> resolved
status: pending -> closed

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



[issue28468] Add platform.freedesktop_os_release()

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

We have reached an impasse. Therefore I have contacted the steering council and 
requested mediation. Victor will abstain from the decision process.

--

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



[issue42417] Empty body {} in POST requests leads to 405 Method not allowed error

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

I also noticed that you are passing an explicit content length. 
{'Content-Length' : '0'} is wrong for a POST payload of "{}" with standard 
transfer encoding. It should be len("{}") == 2.

A zero content length only valid for chunked transfer encoding, which either 
requires header {"transfer-encoding": "chunked"} or encode_chunked=True.

--

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



[issue42417] Empty body {} in POST requests leads to 405 Method not allowed error

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

So far we don't even know for sure if there is a bug in Python's http module. 
It would be helpful if you could provide a reproducer that does not use any 3rd 
party code like requests.

--
nosy: +christian.heimes

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



[issue28468] Add platform.freedesktop_os_release()

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

Pablo, I would like to get mediation from the release manager.

I want to add an interface to the os-release file. It's a decade-old standard 
from freedesktop.org. The file is available in the minimal base installation of 
virtually every Linux distributions except for Android. It's in Alpine, Arch 
Linux, Debian family (Mint, Raspberry Pi OS, Ubuntu, ...), Fedora family 
(CentOS, RHEL, ...), Gentoo, SUSE, and many more. The os-release file contains 
human readable and machine readable operating system information. The file 
format is simple but not trivial.

Matthias and Marc-Andre oppose my patch. Victor and I are in favor of the new 
feature.

--
nosy: +pablogsal

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



[issue28468] Add platform.freedesktop_os_release()

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

PS: MAL, would it be possible to suppress your email footer? BPO is not an 
advertisement channel.

--

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



[issue28468] Add platform.freedesktop_os_release()

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

> It's not pointless. The rate of change in the field is why this
> particular API did not work out in practice. It was working fine
> at the time I added it, but then quickly became unmaintainable.

Yes, it's pointless. You are arguing that os-release is bad because lsb-release 
was bad. It's like arguing against TOML file format because YAML and JSON have 
issues.

os-release was purposely designed to address concerns with lsb-release. 
os-release has been around for more than a decade and wildly adopted (except on 
Android platforms). The format hasn't changed since its first appearance in 
November 2010. Some optional fields were standardized and the meaning of "no 
shell features are supported" was elaborated on.

--

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



[issue42461] os.statvfs_result doesn't show f_fsid

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

Changeset 96a5e50a5de3683b2afd6d680c7ecc4b525986f6 added a new struct member 
but did not increase PyStructSequence_Desc.n_in_sequence of
statvfs_result_desc. I'm not sure if the size of the sequence was not increased 
on purpose.

For reference the feature was added in bpo-32143.

--
nosy: +christian.heimes
stage: patch review -> 

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



[issue28468] Add platform.freedesktop_osrelease()

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

> It would be an interface to a file /etc/os-release
> that's common nowadays, just like /etc/lsb-release was some years
> ago. These things change too often to make the stdlib a good fit.
> I'm pretty sure distros will invent something new in 5 years which
> would then render the API mostly useless again.

That's pointless speculation -- unless you found a fool-proof way to see into 
the future.

Where do you draw the line? Should the stdlib ignore any standard and API that 
is less than 10 years old? 20 years?

--

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



[issue28468] Add platform.freedesktop_os_release()

2020-11-25 Thread Christian Heimes


Change by Christian Heimes :


--
title: Add platform.freedesktop_osrelease() -> Add 
platform.freedesktop_os_release()

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



[issue28468] Add platform.freedesktop_osrelease()

2020-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

It's not a replacement for platform.linux_distribution().

--

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



[issue42454] Move slice creation to the compiler for constants

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

Good point and excellent explanation. I'm no longer concerned! :)

--

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



[issue28468] Add platform.freedesktop_osrelease()

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

>From PR discussion on GH:

I made ID_LIKE a special case because it's likely a users will use the field in 
a wrong way. The issue won't be detected in common CI because the field is 
either not present or contains a single item for majority of Linux distros. 
Common values are debian or fedora. For example Ubuntu has ID_LIKE=debian. Only 
very few distros have an ID_LIKE with multiple entries.

Victor asked me to remove the special case because splitting is trivial. In 
that case users would have to split the field and always check for "name in 
info["ID_LIKE"].split()".

The special case makes it less likely that users get the field wrong and 
reduces their burden.

--

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



[issue42454] Move slice creation to the compiler for constants

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

I'm slightly concerned about hashability of slice objects. Currently the slice 
constructor does not ensure that any slice parameter is a number. You can do 
horrible stuff like this:

>>> slice({})
slice(None, {}, None)

which of course fails later on:

>>> [][slice({})]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: slice indices must be integers or None or have an __index__ method

Would it be possible to move type checks to slice constructor?

--
nosy: +christian.heimes

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



[issue28468] Add platform.freedesktop_osrelease()

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

Correction: It was ArchLinux, not Alpine. ArchLinux used to have 
/usr/lib/os-release only. Recent ArchLinux releases has a symlink from 
/etc/os-release to /usr/lib/os-release.

--

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



[issue28468] Add platform.freedesktop_osrelease()

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

> IMO it's interesting to see which Linux distributions provide os-release. The 
> list of quite long!

As I said before I could not find any supported release of a Linux distribution 
without a proper os-release file. It might be possible that there are micro 
container images or Linux From Scratch builds without os-release. So far I 
haven't found any distribution and I have tested almost two dozen.

> Christian, is it necessary to start with threats?

I'm sorry that you feel threatened. It was not my intention to make you feel 
that way.

IMHO the Python core team can define requirements for vendors and distributors. 
PEP 11 an PEP 394 contain examples of recommendations and requirements. After 
all it's in our interest to ensure that our users get a good and consistent 
experience on supported platforms. Of course vendors are free to ignore our 
requirements and recommendations.

In the case of this it's mood to even discuss requiring os-release. (a) the PR 
does not add a hard dependency on os-release, and (b) the file is present 
anyway.

--

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



[issue28468] Add platform.freedesktop_osrelease()

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

The os-release file is not tight to systemd. Only the reverse relationship is 
true: systemd, d-bus and other software require os-release.

The file is present in the minimal base image of distributions like Alpine, 
ArchLinux, CentOS, Debian, Fedora, RHEL, SUSE, and Ubuntu plus all derivates. 
In the last three years I have not seen any Linux distribution that is missing 
the file. The only odd-ball in the list is Alpine. It ships /usr/lib/os-release 
without the optional but recommended /etc/os-release symlink.

If you know any Linux platform without os-release, please let me know. I'm 
curious to know which platforms don't have the file and why the platform 
excludes it.

Python could also follow the lead of other software like D-Bus and make the 
presence of os-release mandatory on Linux. Any Linux platform without it would 
be considered broken. I don't think it is necessary to impose such restriction 
on vendors.

--

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



[issue28468] Add platform.freedesktop_osrelease()

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

What do you mean by "that"? Python never had any code to parse and handle 
freekdesktop.org's os-release file. Are you referring to linux_distribution() 
function? Petr removed platform.linux_distribution() in bpo-28167 because the 
function was problematic on so many levels and relied on ill defined behavior.

The os-release file has been a well-defined standard for over 8 years. These 
days it's available in the base image of all major Linux distributions and 
countless other distributions. os-release became *the* standard to identify the 
version and vendor of a Linux distribution. In my opinion that's reason enough 
to include the feature.

--

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



[issue28468] Add platform.freedesktop_osrelease()

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

Since we need distribution information in tests and code, I decided to reopen 
the bug.

I named the new function freedesktop_osrelease because it's technically not 
restricted to Linux. It's freedesktop.org standard that may be used by 
non-Linux platforms, too.

Note: os-release is **not** tight to systemd. It just happens that the standard 
was defined in the systemd space of freedesktop.org. I'm not aware of any major 
Linux platform that does not ship the file in its base os.

--
resolution: wont fix -> 
stage: test needed -> patch review
status: closed -> open
title: Add platform.linux_os_release() -> Add platform.freedesktop_osrelease()
versions: +Python 3.10 -Python 3.7

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



[issue28468] Add platform.linux_os_release()

2020-11-24 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22381
pull_request: https://github.com/python/cpython/pull/23492

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



[issue42443] Provide Thread creation hook support

2020-11-24 Thread Christian Heimes


Christian Heimes  added the comment:

Besindes tests, PR also needs documentation and a better definition how and 
when the hook is called.

* IMO it should be called after profiling and tracing hook, so non-trivial 
hooks can be profiled and traced.
* It's important to define and document, which thread runs the hook (calling 
thread or new thread).
* Since the hook is designed to monitor thread creation, would it make sense to 
pass the thread object to the hook?
* How does the hook behave when the callback raises an exception?
* Is a single hook good enough or should the API behave more like atexit, which 
supports an abitrary amount of hooks?
* Instead of just a creation hook, how about lifetime hooks are also called 
when a thread ends?

--
nosy: +christian.heimes

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



[issue42299] Add test_formatter (or remove deprecated formatter module?)

2020-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

The formatter has been deprecated for a long time. It's been issuing a 
DeprecationWarning on import since 3.5. Let's remove it.

--
nosy: +christian.heimes

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



[issue42446] Assertion error os.path.exists(pyc_path) while building Python 3.8.6 with-ensurepip

2020-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

Your problem could be related to --disable-pyc-build. It sounds like it 
disables pyc compilation, which may explain the exception.

--disable-pyc-build is not supported by official releases of Python. Are you 
building Python with additional distribution-specific patches?

--
nosy: +christian.heimes

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



[issue42432] Http client, Bad Status Line triggered for no reason

2020-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

urllib is a high level API on top of http.client. It wraps and uses http.client 
internally. urllib does not accept invalid protocol identifiers either:

>>> urllib.request.urlopen('http://localhost:8080')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
  File "/usr/lib64/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
  File "/usr/lib64/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib64/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
  File "/usr/lib64/python3.8/urllib/request.py", line 1379, in http_open
return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib64/python3.8/urllib/request.py", line 1354, in do_open
r = h.getresponse()
  File "/usr/lib64/python3.8/http/client.py", line 1347, in getresponse
response.begin()
  File "/usr/lib64/python3.8/http/client.py", line 307, in begin
version, status, reason = self._read_status()
  File "/usr/lib64/python3.8/http/client.py", line 289, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: Http/1.1 200 OK


curl is more forgiving but does not recognize "Http/1.1" as a valid HTTP/1.1 
header either. Instead it assumes that any non-valid header means HTTP/1.0.

$ curl -v http://localhost:8080
*   Trying ::1:8080...
* connect to ::1 port 8080 failed: Connection refused
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.69.1
> Accept: */*
> 
* HTTP 1.0, assume close after body
< Http/1.1 200 OK
< Server: BaseHTTP/0.6 Python/3.8.6
< Date: Mon, 23 Nov 2020 09:10:38 GMT
< Content-Type: text/plain
< 
* Closing connection 0


I'm against changing the behavior of http.client.

--

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



[issue42432] Http client, Bad Status Line triggered for no reason

2020-11-22 Thread Christian Heimes


Christian Heimes  added the comment:

https://tools.ietf.org/html/rfc2616#section-3.1 defines HTTP version indicator 
as

   HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT

so the check

   version.startswith("HTTP/")

is correct.

--
nosy: +christian.heimes

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



[issue42437] crypt produces wrong hashes for passwords containing dollar sign

2020-11-22 Thread Christian Heimes


Christian Heimes  added the comment:

PS: Don't use crypt or SSHA512 format for passowrd hashing. You should use 
PBKDF2-HMAC, bcrypt, scrypt, or argon2 instead. SSHA512 is a dated algorithm 
and considered insecure.

--

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



[issue42437] crypt produces wrong hashes for passwords containing dollar sign

2020-11-22 Thread Christian Heimes


Christian Heimes  added the comment:

I assume that you called openssl from a shell. You did not use single quotes 
around in the first example:

$ echo "cash$money"
cash
$ echo 'cash$money'
cash$money
$ openssl passwd -6 -salt 'C0UG33RcHmBVAjQ/' 'cash$money'
$6$C0UG33RcHmBVAjQ/$Tm9aYQq7BsTT/awN6wiUZ6ysamqX9qUVKBV.TjML5udxWqupAB7luv/.KYypZnpQ9eI33R4Lw3O4Jx4NZjTEV/

--
nosy: +christian.heimes

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



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

2020-11-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22354
pull_request: https://github.com/python/cpython/pull/23462

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



[issue42428] Inconsistent squaring behavior

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

Operator precedence and unary operator binding is explained in the language 
reference documentation, 
https://docs.python.org/3/reference/expressions.html#the-power-operator

--
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



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

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset ea97ebab3578a6e0bb505da96819ac44d422a6cb by Christian Heimes in 
branch 'master':
bpo-1635741: Port select module to multiphase init (GH-23409)
https://github.com/python/cpython/commit/ea97ebab3578a6e0bb505da96819ac44d422a6cb


--

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



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

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 035deee265c7fb227ddc87222fa48761231d8bd7 by Christian Heimes in 
branch 'master':
bpo-1635741: Port _posixsubprocess module to multiphase init (GH-23406)
https://github.com/python/cpython/commit/035deee265c7fb227ddc87222fa48761231d8bd7


--

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

There is another option: The subclasses of OSError could set a correct errno 
automatically.

--

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

They have an errno attribute, it's just to None by default. You have to call 
OSError with multiple arguments to set errno to a non-None value.

--

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

PyErr_SetString(PyErr_TimeoutError, "msg") and raise TimeoutError("msg") do not 
set any additional exception attributes. errno, strerror, filename, and 
filename2 are None:

>>> try:
... raise TimeoutError("msg")
... except Exception as e:
... err = e
... 
>>> err
TimeoutError('msg')
>>> (err.errno, err.filename, err.filename2, err.strerror)
(None, None, None, None)

Is that a problem?

--

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks Serhiy!

Andrew, Antoine, Yury, do you want to replace the custom Timeout exceptions in 
asyncio, multiprocessing, and concurrent with global TimeoutError, too?

--
nosy: +asvetlov, bquinlan, davin, pitrou, yselivanov
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

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



[issue42423] Support passing single class to PyType_FromSpecWithBases and PyType_FromModuleAndSpec

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

Excellent idea

--

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



[issue42411] respect cgroups limits when trying to allocate memory

2020-11-20 Thread Christian Heimes


Christian Heimes  added the comment:

Even if we would decide to add a memory limit based on cgroups, there is no way 
to implement a limit in Python correctly. We rely on the platforms malloc() 
implementation to handle memory allocation for us.

Python has an abstraction layer for memory allocator, but the allocator only 
tracks Python objects and does not keep information about the size of slabs. 
Memory tracking would increase memory usage and decrease performance. It would 
also not track other memory like 3rd party libraries, extension modules, thread 
stacks, and other processes in the same cgroups hierarchy.

I'm pretty sure that the RLIMIT_AS approach will not work if you run multiple 
processes in the same container (e.g. spawn subprocesses).

I'll talk to our glibc and container experts at work next week. Perhaps they 
are aware of a better way to handle cgroups memory limits more gracefully.

--
components: +Interpreter Core -IO
versions:  -Python 3.6, Python 3.7

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



[issue42411] respect cgroups limits when trying to allocate memory

2020-11-20 Thread Christian Heimes


Christian Heimes  added the comment:

I doubt it. My test hosts have between 16G and 64G of RAM + plenty of swap.

What's your platform, distribution, Kernel version, Docker version, and 
libseccomp version?

--

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



[issue42411] respect cgroups limits when trying to allocate memory

2020-11-20 Thread Christian Heimes


Christian Heimes  added the comment:

I can neither reproduce the issue with podman and cgroupv2 nor with docker and 
cgroupsv1. In both cases I'm getting a MemoryError as expected:

# podman run -m 1G --cpus 1 python:rc-alpine python -c 'x = bytearray(80 * 1024 
* 1024 * 1000)'
Traceback (most recent call last):
  File "", line 1, in 
MemoryError

# docker run -m 1GB fedora:33 python3 -c 'x = bytearray(80 * 1024 * 1024 * 
1000)'
Traceback (most recent call last):
  File "", line 1, in 
MemoryError

--
nosy: +christian.heimes

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



[issue42418] PyType_GetModule() should warn/fail when type has Py_TPFLAGS_BASETYPE

2020-11-20 Thread Christian Heimes


New submission from Christian Heimes :

PyType_GetModule() may return wrong or unexpected result when a type has 
the feature flag Py_TPFLAGS_BASETYPE. The base type flag permits subclassing of 
an extension class. The function will return NULL when a type is subclasses in 
Python space or a different module object when the type is subclasses and 
initialized in a differen C extension module.

All subclassable types must use _PyType_GetModuleByDef() to safely access  
module and module state struct. It's easy to miss the problem. I missed it when 
I ported some of my code to heap types and multiphase init.

I propose to either a guard to PyType_GetModule() to prevent misuse of the 
function or to add a variant of the function that prevents misuse.

--
components: Interpreter Core
messages: 381475
nosy: christian.heimes, corona10, petr.viktorin, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: PyType_GetModule() should warn/fail when type has Py_TPFLAGS_BASETYPE
type: behavior
versions: Python 3.10

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



[issue42333] Port ssl module to heap types and module state (PEP 573)

2020-11-20 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 5c36da78d738d0e5fdb539a758cc15abc47c843b by Christian Heimes in 
branch 'master':
bpo-42333: Port _ssl extension module to heap types (GH-23392)
https://github.com/python/cpython/commit/5c36da78d738d0e5fdb539a758cc15abc47c843b


--

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-20 Thread Christian Heimes


Change by Christian Heimes :


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

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-19 Thread Christian Heimes


Change by Christian Heimes :


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

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-19 Thread Christian Heimes


New submission from Christian Heimes :

The socket module has a custom timeout exception "socket.timeout". The 
exception is documented 
https://docs.python.org/3/library/socket.html#socket.timeout as :

> A subclass of OSError, this exception is raised when a timeout occurs on a 
> socket which has had timeouts enabled via a prior call to settimeout() (or 
> implicitly through setdefaulttimeout()).

It's a distinct exception type and not the same as the global TimeoutError.

>>> import socket
>>> socket.timeout == TimeoutError
False

I like to follow the example of the deprecated "socket.error", replace the 
custom exception and make it an alias of TimeoutError. The risk is minimal. 
Both exceptions are subclasses of OSError.

The change would not only make exception handling more consistent. It would 
also allow me to simplify some code in ssl and socket C code. I might even be 
able to remove the socket CAPI import from _ssl.c completely.

--
assignee: christian.heimes
components: Extension Modules
messages: 381454
nosy: alex, christian.heimes, corona10, dstufft, janssen, vstinner
priority: normal
severity: normal
status: open
title: Replace custom exception socket.timeout with TimeoutError
type: enhancement
versions: Python 3.10

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



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

2020-11-19 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22302
pull_request: https://github.com/python/cpython/pull/23409

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



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

2020-11-19 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22299
pull_request: https://github.com/python/cpython/pull/23406

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



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

2020-11-19 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22297
pull_request: https://github.com/python/cpython/pull/23404

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



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

2020-11-19 Thread Christian Heimes


Christian Heimes  added the comment:

$ find -name '*.c' -and -not -name moduleobject.c | xargs grep -l 
PyModule_Create\( | sort
./Doc/includes/custom2.c
./Doc/includes/custom3.c
./Doc/includes/custom4.c
./Doc/includes/custom.c
./Doc/includes/sublist.c
./Modules/_asynciomodule.c
./Modules/cjkcodecs/multibytecodec.c
./Modules/_csv.c
./Modules/_ctypes/_ctypes.c
./Modules/_cursesmodule.c
./Modules/_datetimemodule.c
./Modules/_decimal/_decimal.c
./Modules/_elementtree.c
./Modules/_io/_iomodule.c
./Modules/_multiprocessing/posixshmem.c
./Modules/ossaudiodev.c
./Modules/_pickle.c
./Modules/_posixsubprocess.c
./Modules/pyexpat.c
./Modules/readline.c
./Modules/selectmodule.c
./Modules/socketmodule.c
./Modules/_sqlite/module.c  [*]
./Modules/_sre.c  [*]
./Modules/_ssl.c  [*]
./Modules/_testbuffer.c
./Modules/_testcapimodule.c
./Modules/_testimportmultiple.c
./Modules/_testinternalcapi.c
./Modules/_threadmodule.c
./Modules/_tkinter.c
./Modules/_tracemalloc.c
./Modules/_xxsubinterpretersmodule.c
./Modules/_xxtestfuzz/_xxtestfuzz.c
./PC/_msi.c
./PC/msvcrtmodule.c
./PC/winreg.c
./PC/winsound.c
./Tools/peg_generator/peg_extension/peg_extension.c

--

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



[issue42404] clinic: add option to pass module object to converter function

2020-11-19 Thread Christian Heimes


New submission from Christian Heimes :

Sometimes the converter function for CConverter must access the current module 
object in order to access the current module state. Currently CConverter 
subclasses have no easy way to pass the module to the converter function. It 
would be fantastic if easier CConverter would get an option to pass the module.

Example:

GH-23398 converts the struct module to multiphase initialization. The struct 
module has a converter for cached struct definitions. The cache used to be a 
module level object. It is now an interpreter scoped object. I used a custom 
parse_arg() function to pass the module object:


class cache_struct_converter(CConverter):
type = 'PyStructObject *'
converter = 'cache_struct_converter'
c_default = "NULL"

def parse_arg(self, argname, displayname):
return """
if (!{converter}(module, {argname}, &{paramname})) 
goto exit;

""".format(argname=argname, paramname=self.name,
   converter=self.converter)

def cleanup(self):
return "Py_XDECREF(%s);\n" % self.name

--
components: Argument Clinic
messages: 381406
nosy: christian.heimes, corona10, larry, vstinner
priority: normal
severity: normal
status: open
title: clinic: add option to pass module object to converter function
type: enhancement
versions: Python 3.10

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



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

2020-11-19 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22290
pull_request: https://github.com/python/cpython/pull/23398

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



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

2020-11-19 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset bf9d70a1a5255080b7a5e55f319dfffd5f20fdcd by Christian Heimes in 
branch 'master':
bpo-1635741: Port spwd to multiphase initialization (GH-23390)
https://github.com/python/cpython/commit/bf9d70a1a5255080b7a5e55f319dfffd5f20fdcd


--

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



[issue42333] Port ssl module to heap types and module state (PEP 573)

2020-11-19 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22284
pull_request: https://github.com/python/cpython/pull/23392

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



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

2020-11-19 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22282
pull_request: https://github.com/python/cpython/pull/23390

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



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

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22270
pull_request: https://github.com/python/cpython/pull/23377

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



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

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22269
pull_request: https://github.com/python/cpython/pull/23376

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



[issue42400] Ubuntu tests hangs on test_ttk_guionly and test_heading_callback

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks, I searched for test_heading_callback and didn't look for any bug with 
"guionly".

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_ttk timeout: FAIL tkinter ttk LabeledScale test_resize, 
and more

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



[issue42400] Ubuntu tests hangs on test_ttk_guionly and test_heading_callback

2020-11-18 Thread Christian Heimes


New submission from Christian Heimes :

The Ubuntu test runner on Azure have been blocked and eventually failed by an 
issue related to tkinter tests. My PRs ran into the issue at least three times 
today.

Example: 
https://github.com/python/cpython/pull/23360/checks?check_run_id=1418826919

0:19:06 load avg: 0.00 running: test_ttk_guionly (19 min 1 sec)
0:19:36 load avg: 0.00 running: test_ttk_guionly (19 min 31 sec)
0:20:05 load avg: 0.00 [425/425/1] test_ttk_guionly crashed (Exit code 1)
Timeout (0:20:00)!
Thread 0x7f7b8751d080 (most recent call first):
  File "/home/runner/work/cpython/cpython/Lib/tkinter/__init__.py", line 696 in 
wait_visibility
  File 
"/home/runner/work/cpython/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", 
line 1539 in test_heading_callback
  File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 549 in 
_callTestMethod
  File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 592 in run
  File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 652 in 
__call__
  File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 122 in 
run
  File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 84 in 
__call__
  File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 122 in 
run
  File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 84 in 
__call__
  File "/home/runner/work/cpython/cpython/Lib/unittest/runner.py", line 176 in 
run
  File "/home/runner/work/cpython/cpython/Lib/test/support/__init__.py", line 
959 in _run_suite
  File "/home/runner/work/cpython/cpython/Lib/test/support/__init__.py", line 
1082 in run_unittest
  File "/home/runner/work/cpython/cpython/Lib/test/test_ttk_guionly.py", line 
31 in test_main
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", 
line 236 in _runtest_inner2
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", 
line 272 in _runtest_inner
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", 
line 142 in _runtest
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", 
line 195 in runtest
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest_mp.py", 
line 81 in run_tests_worker
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/main.py", line 
659 in _main
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/main.py", line 
639 in main
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/main.py", line 
717 in main
  File "/home/runner/work/cpython/cpython/Lib/test/regrtest.py", line 43 in 
_main
  File "/home/runner/work/cpython/cpython/Lib/test/regrtest.py", line 47 in 

  File "/home/runner/work/cpython/cpython/Lib/runpy.py", line 87 in _run_code
  File "/home/runner/work/cpython/cpython/Lib/runpy.py", line 197 in 
_run_module_as_main
...

test_heading_callback (tkinter.test.test_ttk.test_widgets.TreeviewTest) ... 
Timeout (0:20:00)!
Thread 0x7f0461140080 (most recent call first):
  File "/home/runner/work/cpython/cpython/Lib/tkinter/__init__.py", line 696 in 
wait_visibility
  File 
"/home/runner/work/cpython/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", 
line 1539 in test_heading_callback
  File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 549 in 
_callTestMethod
  File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 592 in run
  File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 652 in 
__call__
  File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 122 in 
run
  File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 84 in 
__call__
  File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 122 in 
run
  File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 84 in 
__call__
  File "/home/runner/work/cpython/cpython/Lib/unittest/runner.py", line 176 in 
run
  File "/home/runner/work/cpython/cpython/Lib/test/support/__init__.py", line 
959 in _run_suite
  File "/home/runner/work/cpython/cpython/Lib/test/support/__init__.py", line 
1082 in run_unittest
  File "/home/runner/work/cpython/cpython/Lib/test/test_ttk_guionly.py", line 
31 in test_main
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", 
line 236 in _runtest_inner2
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", 
line 272 in _runtest_inner
  File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", 
line 155 in _runtest
  File "/home/runner/work/cpython/cpytho

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

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 46f59ebd01e22cc6a56fd0691217318c1d801a49 by Christian Heimes in 
branch 'master':
bpo-1635741: Port _hashlib to multiphase initialization (GH-23358)
https://github.com/python/cpython/commit/46f59ebd01e22cc6a56fd0691217318c1d801a49


--

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



[issue40998] Compiler warnings in ubsan builds

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22262
pull_request: https://github.com/python/cpython/pull/23369

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



[issue42399] Error upon pip usage.

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:

Upon closer investigation something or someone has replaces and monkey patched 
the stdlib function subprocess.run() with code from the 3rd party library 
"run". The "run" package is not part of Python's stdlib.

--

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



[issue42399] Error upon pip usage.

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:

"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/run/__init__.py"
 looks suspicious. It's a 3rd party package that is somehow injected into the 
code.

--
nosy: +christian.heimes

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



[issue40998] Compiler warnings in ubsan builds

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:

Sorry, I meant to add Eric S. :)

--

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


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

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


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

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



[issue40998] Compiler warnings in ubsan builds

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:

The reference leak was introduced in 86ea58149c3 / GH-13159 / bpo-36737. PR 
GH-20929 fixes it, too.

--
nosy: +eric.smith

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



[issue40998] Compiler warnings in ubsan builds

2020-11-18 Thread Christian Heimes

Christian Heimes  added the comment:

I see more warnings and a new leak detection on latest master:

gcc -pthread -c -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer 
 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall-std=c99 
-Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fvisibility=hidden  -I./Include/internal  -I. -I./Include-DPy_BUILD_CORE 
-o Objects/codeobject.o Objects/codeobject.c
In function ‘emit_pair’,
inlined from ‘emit_delta’ at Objects/codeobject.c:423:14,
inlined from ‘code_getlnotab’ at Objects/codeobject.c:462:18:
Objects/codeobject.c:414:15: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
  414 | *lnotab++ = b;
  | ~~^~~
In function ‘emit_pair’,
inlined from ‘emit_delta’ at Objects/codeobject.c:436:14,
inlined from ‘code_getlnotab’ at Objects/codeobject.c:462:18:
Objects/codeobject.c:414:15: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
  414 | *lnotab++ = b;
  | ~~^~~
In function ‘emit_pair’,
inlined from ‘emit_delta’ at Objects/codeobject.c:429:14,
inlined from ‘code_getlnotab’ at Objects/codeobject.c:462:18:
Objects/codeobject.c:414:15: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
  414 | *lnotab++ = b;
  | ~~^~~
gcc -pthread -c -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer 
 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall-std=c99 
-Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fvisibility=hidden  -I./Include/internal  -I. -I./Include-DPy_BUILD_CORE 
-o Python/compile.o Python/compile.c
In function ‘assemble_emit_linetable_pair’,
inlined from ‘assemble_line_range’ at Python/compile.c:5614:18:
Python/compile.c:5586:15: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
 5586 | *lnotab++ = ldelta;
  | ~~^~~~
In function ‘assemble_emit_linetable_pair’,
inlined from ‘assemble_line_range’ at Python/compile.c:5608:18:
Python/compile.c:5586:15: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
 5586 | *lnotab++ = ldelta;
  | ~~^~~~
In function ‘assemble_emit_linetable_pair’,
inlined from ‘assemble’ at Python/compile.c:6011:10:
Python/compile.c:5586:15: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
 5586 | *lnotab++ = ldelta;
  | ~~^~~~


==669952==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 57 byte(s) in 1 object(s) allocated from:
#0 0x7fa6397cc667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
#1 0x777579 in PyUnicode_New Objects/unicodeobject.c:1459
#2 0x86aa4e in unicode_decode_utf8 Objects/unicodeobject.c:5129
#3 0x8b6050 in PyUnicode_DecodeUTF8Stateful Objects/unicodeobject.c:5259
#4 0x8b6050 in PyUnicode_FromString Objects/unicodeobject.c:2311
#5 0x8b6050 in PyUnicode_InternFromString Objects/unicodeobject.c:15788
#6 0x8f1e0b in create_filter Python/_warnings.c:67
#7 0x8f1e0b in init_filters Python/_warnings.c:95
#8 0x8f1e0b in _PyWarnings_InitState Python/_warnings.c:123
#9 0xa52178 in pycore_init_types Python/pylifecycle.c:704
#10 0xa52178 in pycore_interp_init Python/pylifecycle.c:760
#11 0xa5eab1 in pyinit_config Python/pylifecycle.c:807
#12 0xa5eab1 in pyinit_core Python/pylifecycle.c:970
#13 0xa60037 in Py_InitializeFromConfig Python/pylifecycle.c:1155
#14 0x47a842 in pymain_init Modules/main.c:66
#15 0x4802a2 in pymain_main Modules/main.c:698
#16 0x4802a2 in Py_BytesMain Modules/main.c:731
#17 0x7fa638a5b041 in __libc_start_main (/lib64/libc.so.6+0x27041)

--

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset ce04e7105bc396c32667a22b928a712ba0778a3f by Christian Heimes in 
branch 'master':
bpo-41561: skip test_min_max_version_mismatch (GH-22308)
https://github.com/python/cpython/commit/ce04e7105bc396c32667a22b928a712ba0778a3f


--

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



[issue42397] lstrip 处理出现bug

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:

The methods works as designed and documented. The arguments to str.strip, 
lstrip, and rstrip methods are not prefixes / suffixes. They are sets of 
characters.

>>> "bad".lstrip("ab")
'd'

https://docs.python.org/3/library/stdtypes.html?highlight=lstrip#str.lstrip

--
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



[issue37733] Fail to build _curses module of Python 3.7.4 on AIX 7.1 using gcc

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:

Closing

As Kevin explained 3.7 only receives security fixes.

--
nosy: +christian.heimes
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
type:  -> compile error

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



[issue37009] Threading and THREAD_SAFE for AIX

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


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

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



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

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22254
pull_request: https://github.com/python/cpython/pull/23361

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



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

2020-11-18 Thread Christian Heimes


Christian Heimes  added the comment:

$ grep -l -R PyModule_Create . | sort
./_asynciomodule.c
./cjkcodecs/cjkcodecs.h
./cjkcodecs/multibytecodec.c
./_csv.c
./_ctypes/_ctypes.c
./_cursesmodule.c
./_datetimemodule.c
./_decimal/_decimal.c
./_elementtree.c
./gcmodule.c
./grpmodule.c  [*]
./_hashopenssl.c  [*]
./_io/_iomodule.c
./_multiprocessing/posixshmem.c
./ossaudiodev.c
./_pickle.c
./_posixsubprocess.c
./pwdmodule.c  [*]
./pyexpat.c  [*]
./_queuemodule.c
./_randommodule.c
./readline.c
./selectmodule.c
./socketmodule.c
./spwdmodule.c
./_sqlite/module.c
./_sre.c
./_ssl.c  [*]
./_struct.c
./symtablemodule.c
./_testbuffer.c
./_testcapimodule.c
./_testimportmultiple.c
./_testinternalcapi.c
./_threadmodule.c
./_tkinter.c
./_tracemalloc.c
./_xxsubinterpretersmodule.c
./_xxtestfuzz/_xxtestfuzz.c

[*] == open PR

--

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



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

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22253
pull_request: https://github.com/python/cpython/pull/23360

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



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

2020-11-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22252
pull_request: https://github.com/python/cpython/pull/23359

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



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

2020-11-17 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22251
pull_request: https://github.com/python/cpython/pull/23358

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



[issue42366] Use MSVC2019 and /Ob3 option to compile Windows builds

2020-11-17 Thread Christian Heimes


Christian Heimes  added the comment:

Thank you for your thorough testing. It's useful to know that the option does 
not speed up PGO builds of Python.

--

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



[issue42389] test_multiprocessing: @requires_hashdigest() prevents test discovery

2020-11-17 Thread Christian Heimes


New submission from Christian Heimes :

The helper function "install_tests_in_module_dict" uses subclass checks to 
detect test cases in module globals:

if issubclass(base, BaseTestCase):
...
elif issubclass(base, unittest.TestCase):
...

However @requires_hashdigest() returns a function object, not a class instance. 
None of the tests marked with @requires_hashdigest() are executed any more.

--
components: Tests
messages: 381245
nosy: christian.heimes, vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing: @requires_hashdigest() prevents test discovery
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

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



[issue40637] Allow users to disable builtin hash modules on compile time

2020-11-17 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 975022b77b0024ea1548f19d5f91aba5ba1eed59 by Christian Heimes in 
branch 'master':
bpo-40637: Don't test builtin PBKDF2 without builtin hashes (GH-20980)
https://github.com/python/cpython/commit/975022b77b0024ea1548f19d5f91aba5ba1eed59


--

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



[issue39584] multiprocessing.shared_memory: MacOS crashes by running attached Python code

2020-11-17 Thread Christian Heimes


Christian Heimes  added the comment:

I'm strong -1 on any kind of arbitrary memory limit. Python is used on all 
sorts of hardware from RPi to super computers. 1 TB sounds like a lot, but it 
really is not. These days you can buy workstation computers with more than 1 TB 
RAM.

I would be ok with a limit of 2**48 on X86_64 platforms. Current X86_64 CPUs 
have a virtual address size limit of 48 bits. Other hardware platforms may have 
a similar limit. I don't have access to AArch64 or PPC64 to verify the address 
size.

--

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



[issue9261] [doc] include higher (../../) dirs fails

2020-11-16 Thread Christian Heimes


Christian Heimes  added the comment:

Works as intended. MANINFEST can only include files in the current directory 
and subdirectories.

--
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



[issue42376] Add helpers to populate modules in C

2020-11-16 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +22213
pull_request: https://github.com/python/cpython/pull/23286

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



[issue42376] Add helpers to populate modules in C

2020-11-16 Thread Christian Heimes


New submission from Christian Heimes :

It's currently inconvenient and sometimes error-prone to initialize module 
members in C. Even stdlib modules are sometimes missing error checks or have 
reference counting issues in error path. I propose add three helpers to deal 
with common cases:

1) declaration of simple attributes (int, str, bool, float) in an array of 
structs
2) creation and addition of a new type from a type spec
3) creation and addition a new exception object


(1) Simple attribute declaration uses a NULL terminated array of 
PyModuleConst_Def. The internal definition of the type can be hidden by macros. 
Example:

   static PyModuleConst_Def example_constants[] = {
   PyModuleConst_None("none_value"),
   PyModuleConst_Long("integer", 42),
   PyModuleConst_Bool("false_value", 0),
   PyModuleConst_Bool("true_value", 1),
   PyModuleConst_String("somestring", "Hello"),
   PyModuleConst_LongMacro(EXAMPLE_INT),
   PyModuleConst_StringMacro(EXAMPLE_STRING),
   {NULL},
   }

A new function "int PyModule_AddConstants(PyObject *module, PyModuleConst_Def 
*def)" populates the module object with attributes.


(2) Type initialization

The function "PyTypeObject * PyModule_AddNewTypeFromSpec(PyObject *module, 
PyType_Spec *spec, PyObject *base)" is PyType_FromModuleAndSpec() + 
PyModule_AddType(). Additionally to PyType_FromModuleAndSpec() it also handles 
"base" argument with single type instance. The extra feature avoids 
"PyTuple_Pack(1, baseclass)" in the caller. The function adds a strong 
reference to the module object and returns a borrowed reference. The borrowed 
reference is designed module state assignment. 


(3) exception creation

The function "PyObject* PyModule_AddNewException(PyObject *module, const char 
*name, const char *doc, PyObject *base, PyObject *dict)" creates a new 
exception, calculates the attribute name for the qualified exception name, and 
adds the exception to the module. It's PyErr_NewExceptionWithDoc() + 
PyModule_AddObjectRef().


Note about (1): I first proposed to add PyModuleDef.m_constants, however we 
cannot extend the struct easily becaues it conflicts with stable ABI. Petr 
mentioned that he has plans to deal with the issue. Also see discussion 
https://discuss.python.org/t/define-module-constants-in-pymoduledef/5749

--
assignee: christian.heimes
components: C API
messages: 381144
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: Add helpers to populate modules in C
type: enhancement
versions: Python 3.10

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



[issue42372] A crash in do_richcompare

2020-11-16 Thread Christian Heimes


Christian Heimes  added the comment:

The Pandas bug links to a traceback:

Program received signal SIGSEGV, Segmentation fault.
0x5589b0a0 in PyUnicode_Type ()
(gdb) bt
#0  0x5589b0a0 in PyUnicode_Type ()
#1  0x5567d8b3 in do_richcompare (op=2, w=0x777a4b20, 
v=0x7fffe73b57b0) at 
/tmp/build/80754af9/python_1598874792229/work/Objects/object.c:698
#2  PyObject_RichCompare (v=0x7fffe73b57b0, w=0x777a4b20, op=) at /tmp/build/80754af9/python_1598874792229/work/Objects/object.c:746
#3  0x5567d9c0 in PyObject_RichCompareBool (v=, 
w=, op=) at 
/tmp/build/80754af9/python_1598874792229/work/Objects/object.c:768
#4  0x7fffe90713a7 in 
__pyx_f_6pandas_5_libs_9hashtable_17PyObjectHashTable_get_item () from 
/home/sasha/miniconda3/lib/python3.7/site-packages/pandas/_libs/hashtable.cpython-37m-x86_64-linux-gnu.so
#5  0x7fffe90716ae in 
__pyx_pw_6pandas_5_libs_9hashtable_17PyObjectHashTable_11get_item () from 
/home/sasha/miniconda3/lib/python3.7/site-packages/pandas/_libs/hashtable.cpython-37m-x86_64-linux-gnu.so
#6  0x7fffe849aff4 in __Pyx_PyObject_CallOneArg () from 
/home/sasha/miniconda3/lib/python3.7/site-packages/pandas/_libs/index.cpython-37m-x86_64-linux-gnu.so
#7  0x7fffe84e6740 in __pyx_f_6pandas_5_libs_5index_11IndexEngine_get_loc 
() from 
/home/sasha/miniconda3/lib/python3.7/site-packages/pandas/_libs/index.cpython-37m-x86_64-linux-gnu.so
#8  0x7fffe84e75ce in __pyx_pw_6pandas_5_libs_5index_11IndexEngine_5get_loc 
() from 
/home/sasha/miniconda3/lib/python3.7/site-packages/pandas/_libs/index.cpython-37m-x86_64-linux-gnu.so
#9  0x556b972d in _PyMethodDef_RawFastCallKeywords 
(method=0x7fffe84fd9c0 <__pyx_methods_6pandas_5_libs_5index_IndexEngine>, 
self=0x7fffe734d830, args=0x56158448, nargs=, 
kwnames=)
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:647
#10 0x556c07af in _PyMethodDescr_FastCallKeywords 
(descrobj=0x7fffe8530b90, args=0x56158440, nargs=2, kwnames=0x0) at 
/tmp/build/80754af9/python_1598874792229/work/Objects/descrobject.c:288
#11 0x55725c7c in call_function (kwnames=0x0, oparg=2, 
pp_stack=) at 
/tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:4593
#12 _PyEval_EvalFrameDefault (f=, throwflag=) at 
/tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:3110
#13 0x55668829 in _PyEval_EvalCodeWithName (_co=0x7fffe85038a0, 
globals=, locals=, args=, 
argcount=, kwnames=0x0, kwargs=0x56150f30, kwcount=0, 
kwstep=1, 
defs=0x7fffe85221a8, defcount=2, kwdefs=0x0, closure=0x0, 
name=0x7fffe86303f0, qualname=0x7fffe85055b0) at 
/tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:3930
#14 0x556b90a5 in _PyFunction_FastCallKeywords (func=, 
stack=0x56150f20, nargs=2, kwnames=) at 
/tmp/build/80754af9/python_1598874792229/work/Objects/call.c:433
#15 0x55721740 in call_function (kwnames=0x0, oparg=, 
pp_stack=) at 
/tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:4616
#16 _PyEval_EvalFrameDefault (f=, throwflag=) at 
/tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:3110
#17 0x55668829 in _PyEval_EvalCodeWithName (_co=0x7fffe7e13b70, 
globals=, locals=, args=, 
argcount=, kwnames=0x7fffe7e863d8, kwargs=0x7fffe73503e8, 
kwcount=2, kwstep=1,


The problem is probably a bug in Pandas or another C extension. The stacktrace 
does not contain enough information to see the type and value of v and w.

--
nosy: +christian.heimes

___
Python tracker 
<https://bugs.python.org/issue42372>
___
___
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

2020-11-16 Thread Christian Heimes


Christian Heimes  added the comment:

+1 for restoring the feature

+0 for Serhiy's proposal iff intermediate_mode defaults to the value of mode:


def makedirs(name, mode=0o777, exist_ok=False, *, intermediate_mode=None):
if intermediate_mode is None:
intermediate_mode = mode

--
nosy: +christian.heimes

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



[issue42366] Use MSVC2019 and /Ob3 option to compile Windows builds

2020-11-16 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please try again with PGO? All our official builds use PGO.

--
nosy: +christian.heimes

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



[issue42358] Python 3.9.0 unable to detect ax_cv_c_float_words_bigendian value on nigendan system

2020-11-14 Thread Christian Heimes


Christian Heimes  added the comment:

> I suspect that the little endian systems will
> be no great concern as the bulk of Python devs seem to have never
> seen anything else other than little endian systems running Red Hat.

We don't fancy this kind of passive-aggressive and accusatory communication 
style. Instead we prefer constructive collaboration without personal attacks.

For your information our buildbot infrastructure perform regular testing on a 
lot of hardware platforms, distributions, and compilers including PPC64 and 
s390x big endian machines.

Please attach your config.log and provide more information about your platform, 
compiler, and hardware.

--
nosy: +christian.heimes

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



[issue40485] Provide an abstraction for a select-able Event

2020-11-13 Thread Christian Heimes


Christian Heimes  added the comment:

os.eventfd() has landed in Python 3.10.

--
nosy: +christian.heimes
versions: +Python 3.10 -Python 3.9

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



  1   2   3   4   5   6   7   8   9   10   >