[issue39542] Cleanup object.h header

2020-07-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not know the purpose of this issue. The new code does not look cleaner to 
me, but maybe it is only for me.

But performance regressions should be fixed. We cannot rely on 
compiler-specific global optimization, which is hard to test and does not work 
for dynamic linkage (third-party extensions and applications with built-in 
Python). Even "inline" is just a hint to the compiler and does not guarantee 
inlining the code.

Raymond's suggestions look reasonable to me.

--

___
Python tracker 

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



[issue41237] Access violation in python39.dll!meth_dealloc on exit

2020-07-08 Thread Christoph Gohlke


Christoph Gohlke  added the comment:

I tracked this to an import of the numba-0.50.1 package during the numpy tests. 
`python -c"import numba'` is enough to reproduce this crash during interpreter 
exit. Probably the package needs to be ported to Python 3.9.

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



[issue41238] Python 3 shelve.DbfilenameShelf is generating 164 times larger files than Python 2.7 when storing dicts

2020-07-08 Thread Paweł Miech

New submission from Paweł Miech :

I'm porting some code from Python 2.7 to Python 3.8. There is some code that is 
using shelve.DbfilenameShelf to store some nested dictionaries with sets. I 
found out that compared with Python 2.7 Python 3.8 shelve generates files that 
are approximately 164 larger on disk. Python 3.8 file is 2 027 520 size, when 
Python 2.7 size is 12 288.

Code sample:
Filename: test_anydbm.py

#!/usr/bin/env python
import datetime
import shelve
import sys
import time
from os import path


def main():
print(sys.version)
fname = 'shelf_test_{}'.format(datetime.datetime.now().isoformat())
bucket = shelve.DbfilenameShelf(fname, "n")
now = time.time()
limit = 1000
key = 'some key > some key > other'
top_dict = {}
to_store = {
1: {
'page_item_numbers': set(),
'products_on_page': None
}
}
for i in range(limit):
to_store[1]['page_item_numbers'].add(i)
top_dict[key] = to_store
bucket[key] = top_dict
end = time.time()
db_file = False
try:
fsize = path.getsize(fname)
except Exception as e:
print("file not found? {}".format(e))
try:
fsize = path.getsize(fname + '.db')
db_file = True
except Exception as e:
print("file not found? {}".format(e))
fsize = None
print("Stored {} in {} filesize {}".format(limit, end - now, fsize))
print(fname)
bucket.close()
bucket = shelve.DbfilenameShelf(fname, flag="r")
if db_file:
fname += '.db'
print("In file {} {}".format(fname, len(list(bucket.items()

Output of running it in docker image:

Dockerfile:
FROM python:2-jessie
VOLUME /scripts
CMD scripts/test_anydbm.py

2.7.16 (default, Jul 10 2019, 03:39:20) 
[GCC 4.9.2]
Stored 1000 in 0.0814290046692 filesize 12288
shelf_test_2020-07-08T07:26:23.778769
In file shelf_test_2020-07-08T07:26:23.778769 1


So you can see file size: 12 288

And now running same thing in Python 3

Dockerfile:

FROM python:3.8-slim-buster
VOLUME /scripts
CMD scripts/test_anydbm.py

3.8.3 (default, Jun  9 2020, 17:49:41) 
[GCC 8.3.0]
Stored 1000 in 0.02681446075439453 filesize 2027520
shelf_test_2020-07-08T07:27:18.068638
In file shelf_test_2020-07-08T07:27:18.068638 1

Notice file size: 2 027 520

Why is this happening? Is this a bug? If I'd like to fix it, do you have some 
ideas about causes of this?

--
components: Library (Lib)
files: test_anydbm.py
messages: 373284
nosy: Paweł Miech
priority: normal
severity: normal
status: open
title: Python 3 shelve.DbfilenameShelf is generating 164 times larger files 
than Python 2.7 when storing dicts
type: resource usage
versions: Python 3.8
Added file: https://bugs.python.org/file49304/test_anydbm.py

___
Python tracker 

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



[issue41237] Access violation in python39.dll!meth_dealloc on exit

2020-07-08 Thread Christoph Gohlke


Change by Christoph Gohlke :


--
status: closed -> open

___
Python tracker 

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



[issue41220] add optional make_key argument to lru_cache

2020-07-08 Thread Itay azolay


Itay azolay  added the comment:

Thanks, you have some very good points.
Let my try to address them

* cache functions really are expected to be cheap, but what they really need to 
be is *cheaper*. If my computation is expensive enough, I might be okay with 
making a less, still somewhat expensive computation instead. I believe it's for 
the developer to decide.

* key is usually used in a sequence of elements contexts, but it is expected to 
run multiple times. I believe that this is expected(what else could someone 
expect to happen?). I believe this is solvable through good docs(or change the 
name of the parameter?) 

* I believe that a matching signature key-make function is a good thing. It 
will enforce the user to address the key-make function if he changes the 
behaviour of the cached function, and he would rethink the cache, otherwise it 
will not work.

* I can't argue about API simplicity, you probably have much more experience 
there. However, I believe that if we can agree that this is a useful feature, 
we can find a way to make the API clear and welcoming.
BTW, I agree with the problems with the typed argument, never quite understood 
when can this be useful.

I'd like to compare the key argument suggested here, to key argument through 
other python functions. let's take `sorted` as example.
sorted supports key to be able to sort other types of data structures,
even though I like your suggestion, to use dataclass, I believe that if it's 
applicable here, we can say the same thing for sorted.
we could require sorted to work the same way:

@total_ordering # If I'm not mistaken
@dataclass
class MyData:
   ...
   fields
   ...
   def __gt__(self, other):
 return self.field > other.field

sorted(MyData(my_data_instance))


I think we both see the reason why this wouldn't be optimal in some cases here.
Without the key function, the sorted function doesn't support a big part of 
python objects.
I think the same applies for LRU cache. Right now, we just can use it with all 
python objects. we have to change the API, the way we move data around, the way 
we keep our objects, just so that lru_cache would work.
And after all that, lru_cache will just break if someone send some data in a 
list instead of tuple. I think that cause a lot of developers to give up the 
default stdlib lru_cache.

In my case, I have a few list of lists, each list indicates an event that 
happened. In each event, there is a unique timestamp. 
I have an object, that have few different lists
class Myobj:
events_1: List[list]
events_2: List[list]


I have a small, esoteric function, that looks like that now:
def calc(list_of_events):
  # calculation
  pass

and is being called from multiple places in the code, which takes a lot of 
time, like that
calc(events_1) # multiple times
calc(events_2) # multiple times

I wanted to cache the function calc, but now I have to do something like that:
@lru_cache
def calc_events_1(myobj):
  calc(myobj.events_1)

@lru_cache
def calc_events_2(myobj):
  calc(myobj.events_2)

right now I can't change the API of the lists, because they are being used in 
multiple places, some of this least(I have multiple events-lists) are being 
converted to numpy, some doesn't.

Regarding API, we could make it simpler by either use must have kwargs, like 
lru_cache(maxsize, typed, *, key=None)
or, like the property setters/getters case
lru_cache
def function(args, ...):
  pass
@function.make_key # or key, whatever name is good
def _(args, ...):
  return new_key

However I like the second option less.

Thanks

--

___
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

2020-07-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20536
pull_request: https://github.com/python/cpython/pull/21390

___
Python tracker 

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



[issue41239] SSL Certificate verify failed in Python3.6/3.7

2020-07-08 Thread Wu Wenyan


New submission from Wu Wenyan :

I am running the following code in python3.6 to connect to a storage.
[root@controller wuwy]# python3
Python 3.6.8 (default, Jan 11 2019, 02:17:16)
[GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywbem
>>> ip = '193.168.11.113'
>>> user = '193_160_28_29'
>>> password = '193_160_28_29'
>>> url = 'https://193.168.11.113:5989'
>>> ca_certs = '/home/ca.cer'
>>> conn = pywbem.WBEMConnection(url,(user, 
>>> password),default_namespace='root/example',ca_certs=ca_certs,no_verification=False)
>>> conn.EnumerateInstances('EXAMPLE_StorageProduct')

And I am getting the below error.
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_operations.py", line 
1919, in EnumerateInstances
**extra)
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_operations.py", line 
1232, in _imethodcall
conn_id=self.conn_id)
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_http.py", line 776, 
in wbem_request
client.endheaders()
  File "/usr/lib64/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_http.py", line 461, 
in send
self.connect()  # pylint: disable=no-member
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_http.py", line 619, 
in connect
return self.sock.connect((self.host, self.port))
  File "/usr/lib64/python3.6/ssl.py", line 1064, in connect
self._real_connect(addr, False)
  File "/usr/lib64/python3.6/ssl.py", line 1055, in _real_connect
self.do_handshake()
  File "/usr/lib64/python3.6/ssl.py", line 1032, in do_handshake
self._sslobj.do_handshake()
  File "/usr/lib64/python3.6/ssl.py", line 648, in do_handshake
raise ValueError("check_hostname needs server_hostname "
ValueError: check_hostname needs server_hostname argument

When I am running the same code in python3.7, error changed.
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/python3/lib/python3.7/site-packages/pywbem/_cim_operations.py", 
line 2494, in EnumerateInstances
**extra)
  File "/usr/python3/lib/python3.7/site-packages/pywbem/_cim_operations.py", 
line 1763, in _imethodcall
conn_id=self.conn_id)
  File "/usr/python3/lib/python3.7/site-packages/pywbem/_cim_http.py", line 
824, in wbem_request
client.endheaders()
  File "/usr/python3/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/python3/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
  File "/usr/python3/lib/python3.7/site-packages/pywbem/_cim_http.py", line 
483, in send
self.connect()  # pylint: disable=no-member
  File "/usr/python3/lib/python3.7/site-packages/pywbem/_cim_http.py", line 
661, in connect
conn_id=conn_id)
pywbem._exceptions.ConnectionError: SSL error : [SSL: CERTIFICATE_VERIFY_FAILED] certificate 
verify failed: IP address mismatch, certificate is not valid for 
'193.168.11.113'. (_ssl.c:1045); OpenSSL version: OpenSSL 1.1.1c FIPS  28 May 
2019

This code works fine with python2.7 version.

And I checked the CN and SAN of the certificate, seems no problem here.

So could anyone tell me what's the problem here?

--
assignee: christian.heimes
components: SSL
files: 1931683.crt
messages: 373286
nosy: Chirs, christian.heimes
priority: normal
severity: normal
status: open
title: SSL Certificate verify failed in Python3.6/3.7
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file49305/1931683.crt

___
Python tracker 

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



[issue41221] io.TextIOWrapper ignores silently partial write if buffer is unbuffered

2020-07-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Oh, this is a serious problem.

AFAIK TextIOWrapper initially supported only buffered writers, but the support 
of non-buffered writers was added later. We can make TextIOWrapper calling 
write() of underlying binary stream repeatedly, but it will break the code 
which uses TextIOWrapper with other file-like objects whose write() method does 
not return the number of written bytes. For example:

buffer = []
class Writer: write = buffer.append
t = TextIOWrapper(Writer())

Even if we fix writing sys.stdout and sys.stderr there will be a problem with 
programs which write directly to sys.stdout.buffer or use open(buffering=0).

This is a complex issue and it needs a complex solution.

--

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-07-08 Thread STINNER Victor


STINNER Victor  added the comment:

Since the PEP 620 is still a draft, I created PR 21390 to fix the performance 
issue.

As I wrote, I didn't expect any impact on performances since I added 
_PyType_HasFeature() which access directly the structure member. But I was 
wrong. 

This change is not strictly required by my work for now, so I just revert it 
until the PEP is accepted.

If I reapply the change later, I will take care of ensuring that it's properly 
optimized in CPython internals (access the member, don't call a function), 
especially on macOS.

If you want to continue the discussion, please discuss on bpo-40170, since this 
issue is unrelated.


Stefan Krah:
> This one I have some trouble with. It cites PyPy as a bottleneck,
> but IIRC Armin Rigo was on record saying that such changes would
> not help PyPy, and he would come up with a counter proposal.
> Has this changed?

Raymond:
> Victor, is there any reason PyType_GetFlags() can't be converted to a macro 
> or an inlined function?

Serhiy Storchaka:
> I do not know the purpose of this issue. The new code does not look cleaner 
> to me, but maybe it is only for me.

I explained the rationale in bpo-40170 and PEP 620.

It's not a "cleanup change". Serhiy: we are discussing the commit 
45ec5b99aefa54552947049086e87ec01bc2fc9a of bpo-40170.

This discussion is happening in the wrong bpo which seems to confuse people. So 
I close again this issue which is fixed.

--
priority: release blocker -> 
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue41221] io.TextIOWrapper ignores silently partial write if buffer is unbuffered

2020-07-08 Thread STINNER Victor


STINNER Victor  added the comment:

> but it will break the code which uses TextIOWrapper with other file-like 
> objects whose write() method does not return the number of written bytes.

We can detect if write() doesn't return an integer and don't attempt to call 
write() in a loop (until all bytes are written) in this case.

--

___
Python tracker 

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



[issue41239] SSL Certificate verify failed in Python3.6/3.7

2020-07-08 Thread Christian Heimes


Christian Heimes  added the comment:

Are you running Python 2.7 on RHEL 7? Python 2.7 on RHEL 7 does not very certs 
by defaults, see https://access.redhat.com/articles/2039753

Could you please post the output of 'openssl x509 -text -in path/to/cert' for 
your certificate?

--

___
Python tracker 

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



[issue41236] "about" button in MacOS caused an error

2020-07-08 Thread Ned Deily


Ned Deily  added the comment:

Please say exactly how you reproduced this behavior.  Please paste the results 
of running the following command from a terminal window:

python3.7 -m test.pythoninfo

replacing python3.7 with whatever you use to start the python that fails.

--

___
Python tracker 

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



[issue41239] SSL Certificate verify failed in Python3.6/3.7

2020-07-08 Thread Wu Wenyan


Wu Wenyan  added the comment:

I am running Python on Centos7.
See result in attached file.

--
Added file: https://bugs.python.org/file49306/server_cer.txt

___
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

2020-07-08 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +20537
pull_request: https://github.com/python/cpython/pull/21391

___
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

2020-07-08 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68 by Victor Stinner in 
branch 'master':
Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() 
(GH-19378)" (GH-21390)
https://github.com/python/cpython/commit/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68


--

___
Python tracker 

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



[issue41239] SSL Certificate verify failed in Python3.6/3.7

2020-07-08 Thread Christian Heimes


Christian Heimes  added the comment:

Your certificate does not have a subject alternative name extension. CN 
hostname matching has been deprecated for like 15 years. OpenSSL may ignore the 
CN and require a proper SAN extension of type IP general name.

--

___
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

2020-07-08 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset 45ec5b99aefa54552947049086e87ec01bc2fc9a by Victor Stinner in 
> branch 'master':
> bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)

This change causes performance issues on macOS, see discussion starting at:
https://bugs.python.org/issue39542#msg372962

So I reverted the change. I will wait until my PEP 620 is accepted before 
considering to reapply it.

If it's reapplied, we have to make sure that Python internals currently using 
PyTuple_Check() still access directly PyTypeObject.tp_flags member. For 
example, a new _PyTuple_Check() function could be added and uses the internal 
_PyType_HasFeature() function.

--

___
Python tracker 

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



[issue41240] Use the same kind of quotation mark in f-string

2020-07-08 Thread Nghia Minh


New submission from Nghia Minh :

I want to use the same type of quotation mark in f-string, like this:

f'Hey, {' this quote is wrong.'}'

Currently we have to:

f'But, {" this quote is right."}'

--
components: Library (Lib)
messages: 373296
nosy: Nghia Minh
priority: normal
severity: normal
status: open
title: Use the same kind of quotation mark in f-string
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



[issue41240] Use the same kind of quotation mark in f-string

2020-07-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is a limitation of the parser: the entire f-string is first evaluated as a 
string.

Just as 
'Hey, {' this quote is wrong.'}'
or
r'Hey, {' this quote is wrong.'}'
are not valid strings, neither is
f'Hey, {' this quote is wrong.'}'

See issue 33754 for a possible future change that would address this.

--
nosy: +eric.smith
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue33754] f-strings should be part of the Grammar

2020-07-08 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue41231] Type annotations lost when using wraps by default

2020-07-08 Thread David Caro


Change by David Caro :


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

___
Python tracker 

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



[issue8814] functools.WRAPPER_ASSIGNMENTS should include __annotations__

2020-07-08 Thread David Caro


Change by David Caro :


--
nosy: +David Caro
nosy_count: 4.0 -> 5.0
pull_requests: +20539
pull_request: https://github.com/python/cpython/pull/21392

___
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

2020-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset a0a6f1167834c87f12e2eca11dd77143103e7691 by Miss Islington (bot) 
in branch '3.9':
Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() 
(GH-19378)" (GH-21390)
https://github.com/python/cpython/commit/a0a6f1167834c87f12e2eca11dd77143103e7691


--

___
Python tracker 

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



[issue41231] Type annotations lost when using wraps by default

2020-07-08 Thread David Caro


David Caro  added the comment:

As a note, mypy does not tpyecheck the wrapper functions, probably because it 
would not be possible with the current code (as the typing hints get lost):

https://mypy.readthedocs.io/en/latest/generics.html?highlight=wrapper#declaring-decorators

--

___
Python tracker 

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



[issue41221] io.TextIOWrapper ignores silently partial write if buffer is unbuffered

2020-07-08 Thread Eryk Sun

Eryk Sun  added the comment:

> it’s probably an even bigger problem on Windows, where writes might be
> limited to 32767 bytes:

This check and workaround in _Py_write_impl doesn't affect disk files and 
pipes. It only affects character devices for which isatty is true, and really 
it's only concerned with console screen-buffer files. The workaround is not 
required in Windows 8.1+, so it can be removed in Python 3.9+.

--
nosy: +eryksun

___
Python tracker 

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



[issue40820] Mock Call attributes args and kwargs have no changeversion

2020-07-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue41239] SSL Certificate verify failed in Python3.6/3.7

2020-07-08 Thread Wu Wenyan


Wu Wenyan  added the comment:

You are right. I used openssl.cnf when created a csr, and ignore it when 
created cer.
Now the code works fine with python3.7, but still cannot work in python3.6.
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_operations.py", line 
1919, in EnumerateInstances
**extra)
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_operations.py", line 
1232, in _imethodcall
conn_id=self.conn_id)
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_http.py", line 776, 
in wbem_request
client.endheaders()
  File "/usr/lib64/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_http.py", line 461, 
in send
self.connect()  # pylint: disable=no-member
  File "/usr/local/lib/python3.6/site-packages/pywbem/cim_http.py", line 619, 
in connect
return self.sock.connect((self.host, self.port))
  File "/usr/lib64/python3.6/ssl.py", line 1064, in connect
self._real_connect(addr, False)
  File "/usr/lib64/python3.6/ssl.py", line 1055, in _real_connect
self.do_handshake()
  File "/usr/lib64/python3.6/ssl.py", line 1032, in do_handshake
self._sslobj.do_handshake()
  File "/usr/lib64/python3.6/ssl.py", line 648, in do_handshake
raise ValueError("check_hostname needs server_hostname "
ValueError: check_hostname needs server_hostname argument

Could you please check the attached file for me again?

--
Added file: https://bugs.python.org/file49307/server_cer_1.txt

___
Python tracker 

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



[issue41231] Type annotations lost when using wraps by default

2020-07-08 Thread David Caro


David Caro  added the comment:

Elaborating on the last message, given the following code:
```
  1 #!/usr/bin/env python3
  2 
  3 from functools import wraps
  4 
  5 
  6 def return_string(wrapped):
  7 @wraps(wrapped)
  8 def wrapper(an_int: int) -> str:
  9 return str(wrapped(an_int))
 10 
 11 return wrapper
 12 
 13 
 14 @return_string
 15 def identity(an_int: int) -> int:
 16 return an_int
 17 
 18 def print_bool(a_bool: bool) -> None:
 19 print(a_bool)
 20 
 21 def identity_nonwrapped(an_int: int) -> int:
 22 return an_int
 23 
 24 
 25 print_bool(a_bool=identity(7))
 26 print_bool(a_bool=identity_nonwrapped(7))
```

mypy will complain only on the last line, being unable to check properly the 
line 25.

I'll investigate a bit more on why mypy skips that.

--

___
Python tracker 

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



[issue41239] SSL Certificate verify failed in Python3.6/3.7

2020-07-08 Thread Christian Heimes


Christian Heimes  added the comment:

It's a different issue on 3.6. According to the exception message you are not 
passing server_hostname to wrap_socket().

--

___
Python tracker 

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



[issue41239] SSL Certificate verify failed in Python3.6/3.7

2020-07-08 Thread Wu Wenyan


Wu Wenyan  added the comment:

I tried to print "self.host" which would be passed to wrap_socket().
It seems no problem.
> /usr/local/lib/python3.6/site-packages/pywbem/cim_http.py(616)connect()
-> try:
(Pdb) p self.host
'193.168.11.113'
(Pdb) n
> /usr/local/lib/python3.6/site-packages/pywbem/cim_http.py(617)connect()
-> self.sock = ctx.wrap_socket(sock,
(Pdb)
> /usr/local/lib/python3.6/site-packages/pywbem/cim_http.py(618)connect()
-> server_hostname=self.host)
(Pdb)
> /usr/local/lib/python3.6/site-packages/pywbem/cim_http.py(619)connect()
-> return self.sock.connect((self.host, self.port))
(Pdb)
ValueError: check_hostname needs server_hostname argument
> /usr/local/lib/python3.6/site-packages/pywbem/cim_http.py(619)connect()
-> return self.sock.connect((self.host, self.port))

--

___
Python tracker 

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



[issue41240] Use the same kind of quotation mark in f-string

2020-07-08 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Just change the f string quotes.

Python strings, whether f-strings or not, can be delimited by '' or "" or 
triple quotes. So this works:


>>> f"But, {'this quote is right.'}"
'But, this quote is right.'

Remember that the part of the f-string is evaluated as code, converted to a 
string, and interpolated into the rest of the f-string body. This is why the 
quotes disappear.

If you need both kinds of quotes, use triple-quotes as the delimiter:

>>> f"""Both {'single and "double" quotes'.title()}"""
'Both Single And "Double" Quotes'

I assume you want to pass the '' string to a function or something, and this 
example is just a simplified version. Because if there is no function call 
needed, you should just use a regular string, there's no need for an f-string:

"But, 'this quote is right.'"

--
nosy: +steven.daprano

___
Python tracker 

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



[issue41238] Python 3 shelve.DbfilenameShelf is generating 164 times larger files than Python 2.7 when storing dicts

2020-07-08 Thread Paweł Miech

Paweł Miech  added the comment:

Ok so I see this is an issue that involves the way Pickle pickles Python set 
objects. Updated script to reproduce appended. Apparently, sets are becoming 
much larger when stored in Python3 pickle.

--
Added file: https://bugs.python.org/file49308/test_anydbm.py

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2020-07-08 Thread Matthew Hughes


Change by Matthew Hughes :


--
pull_requests: +20541
pull_request: https://github.com/python/cpython/pull/21393

___
Python tracker 

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



[issue22239] asyncio: nested event loop

2020-07-08 Thread mike bayer


mike bayer  added the comment:

as far as cancellation, I gather you're referring to what in gevent / greenlet 
is the GreenletExit exception.  Sure, that thing is a PITA.   Hence we're all 
working to provide asyncio frontends and networking backends so that the 
effects of cancellation I (handwavy handwavy) believe would work smoothly as 
long as the middle part is done right.   cancellation is likely a more 
prominent issue with HTTP requests and responses because users are hitting 
their browser stop buttons all the time.  With databases this typically is 
within the realm of network partitioning or service restarts, or if the driver 
is screwing up in some way which with the monkeypatching thing is more likely, 
but "cancellation" from a database perspective is not the constant event that I 
think it would be in an HTTP perspective.


> I think I either disagree or am missing something :-). Certainly for both 
> edgedb and urllib3, when they're running in sync mode, they end up using 
> synchronous network APIs at the "bottom", and it works fine.

OK it took me a minute to understand what you're saying, which is, if we are 
doing the coroutine.send() thing you illustrated below, we're not in an event 
loop anyway so we can just call blocking code.   OK I did not understand that.  
I haven't looked at the coroutine internals through all of this (which is part 
of my original assertion that I should not have been the person proposing this 
whole greenlet thing anyway :) ).

Why did urllib3 write unasync?  https://pypi.org/project/unasync/strictly 
so they can have a python 2 codebase and that's it?   

SQLAlchemy goes python 3 only in version 2.0.  I did bench the coro example 
against a non-coro example and it's 3x slower likely due to the StopIteration 
but as mentioned earlier if this is only once per front-to-back then it would 
not amount to anything in context.   Still, the risk factor of a rewrite like 
that, where risk encompasses just all the dumb mistakes and bugs that would be 
introduced by rewriting everything, does not seem worth it.

--

___
Python tracker 

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



[issue16396] Importing ctypes.wintypes on Linux gives a ValueError instead of an ImportError

2020-07-08 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +20542
pull_request: https://github.com/python/cpython/pull/21394

___
Python tracker 

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



[issue41239] SSL Certificate verify failed in Python3.6/3.7

2020-07-08 Thread Christian Heimes


Christian Heimes  added the comment:

I'm afraid I have to close this issue as OUT-OF-DATE. It's either a bug in 
pywbem or a 3.6-only bug. Python 3.6 is in security maintenance mode and no 
longer receive bug fixes.

I suggest that you take this issue to pywbem bug tracker and get assistance 
there.

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

___
Python tracker 

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



[issue41073] [C API] PyType_GetSlot() should accept static types

2020-07-08 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue41241] Unnecessary Type casting in 'if condition'

2020-07-08 Thread Wansoo Kim


New submission from Wansoo Kim :

Hello!

When using 'if syntax', casting condition to bool type is unnecessary. Rather, 
it only occurs overhead.

https://github.com/python/cpython/blob/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68/Lib/asyncio/futures.py#L118

If you look at the link above, the `val` has been cast to bool type. This works 
well without bool casting.

This issue is my first issue. So if you have a problem, please tell me!

Thanks You!

--
components: asyncio
messages: 373309
nosy: asvetlov, ys19991, yselivanov
priority: normal
severity: normal
status: open
title: Unnecessary Type casting in 'if condition'
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



[issue41241] Unnecessary Type casting in 'if condition'

2020-07-08 Thread Wansoo Kim


Change by Wansoo Kim :


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

___
Python tracker 

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



[issue41242] When concating strings, I think it is better to use += than join the list

2020-07-08 Thread Wansoo Kim


New submission from Wansoo Kim :

Hello

I think it's better to use += than list.join() when concating strings.

This is more intuitive than other methods.

Also, I personally think it is not good for one variable to change to another 
type during runtime.

https://github.com/python/cpython/blob/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68/Lib/asyncio/base_events.py#L826

If you look at the link above, `msg` was a list type at first, in the end 
 become a str type.

--
components: asyncio
messages: 373310
nosy: asvetlov, ys19991, yselivanov
priority: normal
severity: normal
status: open
title: When concating strings, I think it is better to use += than join the list
type: enhancement

___
Python tracker 

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



[issue41242] When concating strings, I think it is better to use += than join the list

2020-07-08 Thread Wansoo Kim


Change by Wansoo Kim :


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

___
Python tracker 

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



[issue22239] asyncio: nested event loop

2020-07-08 Thread mike bayer


mike bayer  added the comment:

I tested "cancellation", shutting down the DB connection mid query.  Because 
the greenlet is only in the middle and not at the endpoints, it propagates the 
exception and there does not seem to be anything different except for the 
greenlet sequence in the middle, which is also clear:

https://gist.github.com/zzzeek/9e0d78eff14b3bbd5cf12fed8b02bce6

the first comment on the gist has the stack trace produced.

--

___
Python tracker 

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



[issue41242] When concating strings, I think it is better to use += than join the list

2020-07-08 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Wansoo, using += instead of str.join() is less performant. Concatenating n 
strings with + will create and allocate n new strings will str.join() will 
carefully look ahead and allocate the correct amount of memory and do all 
concatenation at one:


➜  ~ python3 -m timeit -s 's = ""' 'for i in range(1_000_000): s += "foo\n"'
5 loops, best of 5: 107 msec per loop
➜  ~ python3 -m timeit -s 'l = ["foo"]*1_000_000' '"\n".join(l)'
20 loops, best of 5: 9.96 msec per loop


It's a common idiom that you will meet a lot in Python.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue33840] connection limit on listening socket in asyncio

2020-07-08 Thread Deon


Deon  added the comment:

hi

--
nosy: +Deon257

___
Python tracker 

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



[issue33840] connection limit on listening socket in asyncio

2020-07-08 Thread Deon


Deon  added the comment:

Download FIFA 14 apk
https://apkgreat.com/fifa-14-apk/

--

___
Python tracker 

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



[issue41243] Android Game

2020-07-08 Thread Deon


New submission from Deon :

Download FIFA 14 apk

https://apkgreat.com/fifa-14-apk/

--
components: Interpreter Core
messages: 373315
nosy: Deon257
priority: normal
severity: normal
status: open
title: Android Game
type: security
versions: Python 3.7

___
Python tracker 

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



[issue33840] connection limit on listening socket in asyncio

2020-07-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue41243] SPAM

2020-07-08 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: Android Game -> SPAM
type: security -> 

___
Python tracker 

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



[issue33840] connection limit on listening socket in asyncio

2020-07-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue41242] When concating strings, I think it is better to use += than join the list

2020-07-08 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> wont fix
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



[issue41242] When concating strings, I think it is better to use += than join the list

2020-07-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Remi is correct.
Closing the issue.

--

___
Python tracker 

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



[issue41243] SPAM

2020-07-08 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue41243] SPAM

2020-07-08 Thread Zachary Ware


Change by Zachary Ware :


--
components:  -Interpreter Core
nosy:  -Deon257
versions:  -Python 3.7

___
Python tracker 

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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-07-08 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

I'm reopening this as the original SEGV didn't go away in 3.9 beta 4. It looks 
like debug build caught an assertion and prevented the SEGV from triggering.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue41244] Change to use str.join() instead of += when concatenating string

2020-07-08 Thread Wansoo Kim


New submission from Wansoo Kim :

https://bugs.python.org/issue41242

According to BPO-41242, it is better to use join than += when concatenating 
multiple strings.

https://github.com/python/cpython/blob/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68/Lib/asyncio/queues.py#L82

However, the link above uses += in the same pattern. I think we'd better change 
this to `str.join()`

--
components: asyncio
messages: 373317
nosy: asvetlov, ys19991, yselivanov
priority: normal
severity: normal
status: open
title: Change to use str.join() instead of += when concatenating string
type: enhancement

___
Python tracker 

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



[issue41244] Change to use str.join() instead of += when concatenating string

2020-07-08 Thread Wansoo Kim


Change by Wansoo Kim :


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

___
Python tracker 

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



[issue41244] Change to use str.join() instead of += when concatenating string

2020-07-08 Thread Zachary Ware


Zachary Ware  added the comment:

That is not performance-critical code, and in that case it is clearer to use 
`+=` than str.join.

Closing the issue; Andrew or Yury can of course reopen it if they disagree with 
my assessment.

--
nosy: +zach.ware
resolution:  -> wont fix
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



[issue41242] When concating strings, I think it is better to use += than join the list

2020-07-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

In this particular case the number of concatenations is limited, the resulting 
string is usually short, and the code is not performance critical (it is the 
__repr__ implementation). So there is no significant advantage of one way over 
other, and no way is obviously wrong. In such cases the status quo wins.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41244] Change to use str.join() instead of += when concatenating string

2020-07-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Changes in bpo-41242 were rejected not because the new code is worse, but 
because it is not obviously and significantly better that the existing code. 
Here status quo wins for the same reasons. This rule saves us from endless 
rewriting the code and allows to focus on important things.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41242] When concating strings, I think it is better to use += than join the list

2020-07-08 Thread Wansoo Kim


Wansoo Kim  added the comment:

Well... to be honest, I'm a little confused. bpo-41244 and this issue are 
completely opposite. I'm not used to Python community yet because it hasn't 
been long since I joined it.

You're saying that if a particular method is not dramatically good, we prefer 
to keep the existing one as it is, right?

Your comment was very helpful to me. Maybe I can learn one by one like this.

Thank you very much.

--

___
Python tracker 

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



[issue41245] cmath module documentation is misleading on branch cuts

2020-07-08 Thread Mark Dickinson

New submission from Mark Dickinson :

The documentation for the cmath module is misleading on the behaviour near 
branch cuts. For example, the documentation for cmath.acos says:

   Return the arc cosine of x. There are two branch cuts: One
   extends right from 1 along the real axis to ∞, continuous
   from below. The other extends left from -1 along the real
   axis to -∞, continuous from above.

That "continuous from below" and "continuous from above" language is 
misleading; in fact what happens on the vast majority of systems (those for 
which the floating-point format used is IEEE 754 binary64), if the imaginary 
part of x is zero, the sign of x is used to determine which side of the branch 
cut x lies.

--
messages: 373323
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: cmath module documentation is misleading on branch cuts

___
Python tracker 

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



[issue41245] cmath module documentation is misleading on branch cuts

2020-07-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

> the sign of x is used [...]

Correction: That should say "the sign of the imaginary part of x is used [...]"

--

___
Python tracker 

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



[issue41246] IOCP Proactor same socket overlapped callbacks

2020-07-08 Thread Tony


New submission from Tony :

In IocpProactor I saw that the callbacks to the functions recv, recv_into, 
recvfrom, sendto, send and sendfile all give the same callback function for 
when the overlapped operation is done.

I just wanted cleaner code so I made a static function inside the class that I 
give to each of these functions as the overlapped callbacks.

--
messages: 373324
nosy: tontinton
priority: normal
severity: normal
status: open
title: IOCP Proactor same socket overlapped callbacks

___
Python tracker 

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



[issue41245] cmath module documentation is misleading on branch cuts

2020-07-08 Thread Mark Dickinson


Change by Mark Dickinson :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-07-08 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

Confirmed not fixed.

Taken with 3.9 branch as of today.

(pyb-3.9-dev-d) [arcivanov@ai-karellen-lap pybuilder]$ abrt gdb 1f24453
GNU gdb (GDB) Fedora 9.1-5.fc32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word".
No symbol table is loaded.  Use the "file" command.
No symbol table is loaded.  Use the "file" command.
Reading symbols from 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin/python...
[New LWP 144565]
warning: Unexpected size of section `.reg-xstate/144565' in core file.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by 
`/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.'.
Program terminated with signal SIGSEGV, Segmentation fault.
warning: Unexpected size of section `.reg-xstate/144565' in core file.
#0  0x00623339 in _Py_IS_TYPE (ob=0x0, type=0x8609e0 ) at 
./Include/object.h:128
128 return ob->ob_type == type;
>FromTo  Syms Read   Shared Object Library
0x7fcbed8db050  0x7fcbed8efd69  Yes (*) /lib64/libcrypt.so.2
0x7fcbed8beaf0  0x7fcbed8cdb95  Yes (*) /lib64/libpthread.so.0
0x7fcbed8b2270  0x7fcbed8b31c9  Yes (*) /lib64/libdl.so.2
0x7fcbed8ac3f0  0x7fcbed8acdb0  Yes (*) /lib64/libutil.so.1
0x7fcbed7743d0  0x7fcbed80f078  Yes (*) /lib64/libm.so.6
0x7fcbed5c0670  0x7fcbed70e80f  Yes (*) /lib64/libc.so.6
0x7fcbed94f110  0x7fcbed96f574  Yes (*) /lib64/ld-linux-x86-64.so.2
0x7fcbed91a0f0  0x7fcbed91bc18  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_heapq.cpython-39d-x86_64-linux-gnu.so
0x7fcbed93c3d0  0x7fcbed940cfc  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/zlib.cpython-39d-x86_64-linux-gnu.so
0x7fcbe00cc5f0  0x7fcbe00d9bd8  Yes (*) /lib64/libz.so.1
0x7fcbed9342f0  0x7fcbed935f82  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_bz2.cpython-39d-x86_64-linux-gnu.so
0x7fcbe0078570  0x7fcbe0084996  Yes (*) /lib64/libbz2.so.1
0x7fcbed9294a0  0x7fcbed92cba6  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_lzma.cpython-39d-x86_64-linux-gnu.so
0x7fcbe004f9f0  0x7fcbe0067076  Yes (*) /lib64/liblzma.so.5
0x7fcbe0115280  0x7fcbe01160b3  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/grp.cpython-39d-x86_64-linux-gnu.so
0x7fcbe0104590  0x7fcbe010bc77  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/math.cpython-39d-x86_64-linux-gnu.so
0x7fcbe00fb150  0x7fcbe00fc200  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_bisect.cpython-39d-x86_64-linux-gnu.so
0x7fcbe00f52f0  0x7fcbe00f6a1e  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_random.cpython-39d-x86_64-linux-gnu.so
0x7fcbe00ea190  0x7fcbe00efad0  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_sha512.cpython-39d-x86_64-linux-gnu.so
0x7fcbdfef05a0  0x7fcbdff012c9  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_datetime.cpython-39d-x86_64-linux-gnu.so
0x7fcbdfedd420  0x7fcbdfee607e  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_json.cpython-39d-x86_64-linux-gnu.so
0x7fcbdfed53f0  0x7fcbdfed734f  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/lib/python3.9/lib-dynload/_posixsubprocess.cpython-39d-x86_64-linux-gnu.so
0x7fcbdfeca400  0x7fcbdfecd9b2 

[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-07-08 Thread Peter Ludemann


Peter Ludemann  added the comment:

I've written up a proposal for adding "whitespace" handling to the ast module:
https://mail.python.org/archives/list/python-id...@python.org/thread/X2HJ6I6XLIGRZDB27HRHIVQC3RXNZAY4/

I don't think it's a "summer-of-code-sized project", mainly because I already 
have various bits of code that handle the fiddly byte/str offset conversions.

--

___
Python tracker 

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



[issue41246] IOCP Proactor same socket overlapped callbacks

2020-07-08 Thread Tony


Change by Tony :


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

___
Python tracker 

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



[issue41172] test_peg_generator C tests fail on Windows ARM

2020-07-08 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue41245] cmath module documentation is misleading on branch cuts

2020-07-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 for changing the language to match the actual mechanics.


> "the sign of the imaginary part of x is used [...]"

I'm trying to see where this happens.  Is this part of cmath_sqrt?

if (z.real >= 0.) {
r.real = s;
r.imag = copysign(d, z.imag); 
} else {
r.real = d;
r.imag = copysign(s, z.imag);
}


> "continuous from below" and "continuous from above" 
> language is misleading;

I'm curious, is that language incorrect?  My mental image of a branch cut is a 
helical graph with the edge cases being continuous from above and below.  
Likewise, my mental model for branch cut logic is it resolves multiple possible 
output values in a way preserves continuity from one side or the other.

In other words, I think about branch cuts in terms of continuity rather than 
sign preservation.  Is that incorrect?

--
nosy: +rhettinger

___
Python tracker 

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



[issue41245] cmath module documentation is misleading on branch cuts

2020-07-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

Yes, that looks like the right part of the sqrt code.

For the acos docstring, "continuous from below" implies that for any complex 
number z that lies exactly _on_ the branch cut, acos(z) is close to acos(w) for 
a nearby value w just _below_ the branch cut. But that's demonstrably not true: 
see the change of sign in the real part below:

>>> acos(complex(2.3, -1e-10))  # value just "below" the branch cut
(4.828045495852677e-11+1.475044781241425j)
>>> acos(complex(2.3, 0.0))  # nearby value exactly _on_ the branch cut
-1.475044781241425j

In effect, for a branch cut along the real axis, the sign of the zero in the 
imaginary part of the argument allows us to be continuous from both sides at 
once.

--

___
Python tracker 

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



[issue41245] cmath module documentation is misleading on branch cuts

2020-07-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

> [...] see the change of sign in the real part below [...]

Grr. Stupid fingers. That should say "imaginary part", not "real part"

--

___
Python tracker 

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



[issue41244] Change to use str.join() instead of += when concatenating string

2020-07-08 Thread Yury Selivanov


Yury Selivanov  added the comment:

> Changes in bpo-41242 were rejected not because the new code is worse, but 
> because it is not obviously and significantly better that the existing code. 
> Here status quo wins for the same reasons. This rule saves us from endless 
> rewriting the code and allows to focus on important things.

+1.

--

___
Python tracker 

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-07-08 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can that be done as a 3rd party wrapper? Then you would be able to support 
older Python versions, and typed_ast (which can parse older Python grammars 
with a newer Python that's older than 3.8). Plus it would be much easier to get 
your code released -- no waiting for core devs to review it or waiting for the 
next CPython (bugfix or feature) release to get a bug fixed or small feature 
added.

--

___
Python tracker 

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



[issue41247] asyncio module better caching for set and get_running_loop

2020-07-08 Thread Tony


New submission from Tony :

There is a cache variable for the running loop holder, but once 
set_running_loop is called the variable was set to NULL so the next time 
get_running_loop would have to query a dictionary to receive the running loop 
holder.

I thought why not always cache the latest set_running_loop?

The only issue I thought of here is in the details of the implementation: I 
have too little experience in python to know if there could be a context switch 
to get_running_loop while set_running_loop is running.

If a context switch is possible there then this issue would be way harder to 
solve, but it is still solvable.

--
messages: 37
nosy: tontinton
priority: normal
severity: normal
status: open
title: asyncio module better caching for set and get_running_loop

___
Python tracker 

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-07-08 Thread Peter Ludemann


Peter Ludemann  added the comment:

Yes, I'm thinking of doing this as a wrapper, in such a way that it could be 
incorporated into Lib/ast.py eventually. (Also, any lib2to3-ish capabilities 
would probably not be suitable for inclusion in the stdlib, at least not 
initially ... but I have no plans to work on something to replace lib2to3's 
fixers.)

--

___
Python tracker 

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



[issue41247] asyncio.set_running_loop() cache running loop holder

2020-07-08 Thread Tony


Change by Tony :


--
title: asyncio module better caching for set and get_running_loop -> 
asyncio.set_running_loop() cache running loop holder

___
Python tracker 

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



[issue41247] asyncio.set_running_loop() cache running loop holder

2020-07-08 Thread Tony


Change by Tony :


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

___
Python tracker 

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



[issue41248] Python manual forced in maximized window

2020-07-08 Thread Mischiew Rithe


New submission from Mischiew Rithe :

In versions 3.8.1 and 3.8.3-amd64 (only versions tested), on Windows, the 
"Python 3.8 Manuals" opens in a maximized window.

This is unexpected and undesired, as the user cannot see the other windows, 
including the one he's developing from (IDE, editor, shell, ...).

The problem seems to come from the shortcut created in the menu, which forces a 
maximized window. It has to be set to "normal window" instead.

--
assignee: docs@python
components: Documentation
messages: 373335
nosy: Mischiew Rithe, docs@python
priority: normal
severity: normal
status: open
title: Python manual forced in maximized window
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



[issue41247] asyncio.set_running_loop() cache running loop holder

2020-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset 529f42645d38b6b0075f256814dfb3d220ac7d92 by Tony Solomonik in 
branch 'master':
bpo-41247: asyncio.set_running_loop() cache running loop holder (GH-21401)
https://github.com/python/cpython/commit/529f42645d38b6b0075f256814dfb3d220ac7d92


--
nosy: +miss-islington

___
Python tracker 

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



[issue41247] asyncio.set_running_loop() cache running loop holder

2020-07-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20552
pull_request: https://github.com/python/cpython/pull/21403

___
Python tracker 

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



[issue41247] asyncio.set_running_loop() cache running loop holder

2020-07-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20551
pull_request: https://github.com/python/cpython/pull/21402

___
Python tracker 

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



[issue41247] asyncio.set_running_loop() cache running loop holder

2020-07-08 Thread Yury Selivanov


Yury Selivanov  added the comment:

> n python to know if there could be a context switch to get_running_loop while 
> set_running_loop is running.


No, it's protected by the GIL.

Good catch, and merged.

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



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

2020-07-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks for doing this.  I can confirm the performance regression is fixed and 
that clean code is being generated for PyTuple_Check().

BTW, I support your efforts — just wanted to make sure we didn't 
unintentionally take a step backwards.

--
nosy: +rhettinger

___
Python tracker 

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



[issue39017] Infinite loop in the tarfile module

2020-07-08 Thread Ben Caller


Ben Caller  added the comment:

I've attached a minimal tar file which reproduces this. I think the minimum 
length is 516 bytes.

We need a 512 byte PAX format header block as normal.

Then we need a pax header which matches the regex in 
https://github.com/python/cpython/blob/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68/Lib/tarfile.py#L1243

length, keyword = re.compile(br"(\d+) ([^=]+)=").groups()

We use the `length` variable to iterate:
https://github.com/python/cpython/blob/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68/Lib/tarfile.py#L1271

while True:
...
pos += length

So we can start the block with "0 X=". This makes length=0. So it will 
increment pos by 0 each loop and loop the same code forever.

Nice find.

Do you think this denial of service is worth requesting a CVE for? If so, can 
someone else do it.

--
nosy: +bc
Added file: https://bugs.python.org/file49309/recursion.tar

___
Python tracker 

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



[issue41247] asyncio.set_running_loop() cache running loop holder

2020-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset fbd71f66843aea71c09656f17a196d29d5d484af by Miss Islington (bot) 
in branch '3.9':
bpo-41247: asyncio.set_running_loop() cache running loop holder (GH-21401)
https://github.com/python/cpython/commit/fbd71f66843aea71c09656f17a196d29d5d484af


--

___
Python tracker 

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



[issue39017] Infinite loop in the tarfile module

2020-07-08 Thread Ben Caller


Ben Caller  added the comment:

A smaller bug: If instead of 0 you use a large number (> 2^63) e.g. 
999 you get `OverflowError: Python int too large to convert to 
C ssize_t` rather than the expected `tarfile.ReadError` regardless of 
errorlevel.

--

___
Python tracker 

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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-07-08 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

> Program received signal SIGSEGV, Segmentation fault.
0x00623339 in _Py_IS_TYPE (ob=0x0, type=0x8609e0 ) at 
./Include/object.h:128
128 return ob->ob_type == type;
(gdb) py-bt
Traceback (most recent call first):
  
  File "/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/ast.py", 
line 306, in parse
lines.append(next_line)
  File "/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/ast.py", 
line 62, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
  File "./src/main/python/pybuilder/python_env.py", line 83, in populate
python_info = ast.literal_eval(result)
  File "./src/main/python/pybuilder/reactor.py", line 409, in __init__
self.propagate_property("explicit_namespaces")
  File "./src/main/python/pybuilder/cli.py", line 238, in init_reactor
reactor = Reactor(logger, execution_manager)
  File "./src/main/python/pybuilder/cli.py", line 415, in main
reactor = init_reactor(logger)
  File "./src/main/python/pybuilder/__init__.py", line 34, in bootstrap
sys.exit(pybuilder.cli.main(*sys.argv[1:]))
  File "/tmp/IntegrationTestSupporthzc3tee0/build.py", line 31, in 
bootstrap()
  
  File "/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/runpy.py", 
line 343, in _run_code
  File "/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/runpy.py", 
line 353, in _run_module_code
  File "/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/runpy.py", 
line 524, in run_path
  File 
"/home/arcivanov/Documents/src/arcivanov/pybuilder/src/integrationtest/python/smoke_itest_support.py",
 line 72, in smoke_test
return run_path(self.build_py, run_name="__main__")
  File 
"/home/arcivanov/Documents/src/arcivanov/pybuilder/src/integrationtest/python/smoke_clean_tests.py",
 line 30, in test_build_then_clean
self.smoke_test("-v", "-X", "clean")
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/case.py", 
line 550, in _callTestMethod
method()
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/case.py", 
line 1617, in run
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/case.py", 
line 653, in __call__
return self.run(*args, **kwds)
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/suite.py",
 line 378, in run
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/suite.py",
 line 84, in __call__
return self.run(*args, **kwds)
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/suite.py",
 line 378, in run
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/suite.py",
 line 84, in __call__
return self.run(*args, **kwds)
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/runner.py",
 line 432, in run
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/main.py", 
line 783, in runTests
  File 
"/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/unittest/main.py", 
line 101, in __init__
self.runTests()
  File 
"/home/arcivanov/Documents/src/arcivanov/pybuilder/src/integrationtest/python/smoke_clean_tests.py",
 line 34, in 
unittest.main()
(gdb) py-bt-full
#7 
#11 Frame 0xb67600, for file 
/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/ast.py, line 306, 
in parse (source="{'_platform': 'linux', '_os_name': 'posix', '_executable': 
('/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin/python',),
 '_exec_dir': 
'/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin',
 '_name': 'CPython', '_type': 'cpython', '_version': (3, 9, 0, 'beta', 4), 
'_is_pypy': False, '_is_64bit': True, '_versioned_dir_name': 
'cpython-3.9.0.beta.4', '_environ': {'SHELL': '/bin/bash', 'SESSION_MANAGER': 
'local/unix:@/tmp/.ICE-unix/6175,unix/unix:/tmp/.ICE-unix/6175', 'WINDOWID': 
'56623111', 'COLORTERM': 'truecolor', 'PYENV_SHELL': 'bash', 'XDG_CONFIG_DIRS': 
'/etc/xdg:/usr/share/kde-settings/kde-profile/default/xdg', 'HISTCONTROL': 
'ignoredups', 'XDG_MENU_PREFIX': 'kf5-', 'rvm_prefix': '/home/arcivanov', 
'HISTSIZE': '-1', 'HOSTNAME': 'ai-karellen-lap', 'LANGUAGE': '', 'JAVA_HOME': 
'/ho
 me/arcivanov/devhome/current/j...(truncated)
lines.append(next_line)
#18 Frame 0x7fffe92ad230, for file 
/home/arcivanov/.pyenv/versions/3.9-dev-debug/lib/python3.9/ast.py, line 62, in 
literal_eval (node_or_string="{'_platform': 'linux', '_os_name': 'posix', 
'_executable': 
('/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin/python',),
 '_exec_dir': 
'/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin',
 '_name': 'CPython', '_type': 'cpython', '_version': (3, 9, 0, 'beta', 4), 
'_is_pypy': False, '_is_64bit': True, '_versioned_dir_name': 
'cpython-3.9.0.beta.4', '_environ': {'S

[issue41175] Static analysis issues reported by GCC 10

2020-07-08 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 61fc23ca106bc82955b0e59d1ab42285b94899e2 by stratakis in branch 
'master':
bpo-41175: Guard against a NULL pointer dereference within bytearrayobject 
(GH-21240)
https://github.com/python/cpython/commit/61fc23ca106bc82955b0e59d1ab42285b94899e2


--

___
Python tracker 

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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-07-08 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm reopening this as the original SEGV didn't go away in 3.9 beta 4. It 
> looks like debug build caught an assertion and prevented the SEGV from 
> triggering.

Right, the fix was merged after v3.9.0b4 was merged.

The fix will be part of the next 3.9 release ("3.9.0 beta 5: Monday, 
2020-07-20"). Usually, issues are closed when fixes are merged, not when new 
versions including the fix are released.

--

___
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

2020-07-08 Thread STINNER Victor

STINNER Victor  added the comment:

> Thanks for doing this.  I can confirm the performance regression is fixed and 
> that clean code is being generated for PyTuple_Check().

Thanks for checking!

> BTW, I support your efforts — just wanted to make sure we didn't 
> unintentionally take a step backwards.

I tried to avoid changes which could affect performances.

I wrote PEP 620 for such changes.

--

___
Python tracker 

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-07-08 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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-07-08 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

@vstinner, this is in the current 3.9 as of 
a0a6f1167834c87f12e2eca11dd77143103e7691 (11hrs ago). We didn't get the actual 
bug, we just got stopped by an assertion when python got built with debug.

--

___
Python tracker 

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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-07-08 Thread STINNER Victor


STINNER Victor  added the comment:

I checked manually that msg372859 example is fixed.

> @vstinner, this is in the current 3.9 as of 
> a0a6f1167834c87f12e2eca11dd77143103e7691 (11hrs ago). We didn't get the 
> actual bug, we just got stopped by an assertion when python got built with 
> debug.

It sounds like a different bug. Can you provide a reproducer?

--

___
Python tracker 

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



[issue41202] Allow to provide custom exception handler to asyncio.run()

2020-07-08 Thread Kyle Stanley


Kyle Stanley  added the comment:

Yep, having to set a custom exception handler definitely constitutes as needing 
"finer control over the event loop behavior". There's absolute nothing wrong 
with using the low-level API when you need further customization, but we try to 
minimize the high-level API as much as possible to make it simple for the 
average user. I suspect that the majority of asyncio users don't have a need to 
customize the exception handler beyond the default settings.

--
nosy: +aeros

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20554
pull_request: https://github.com/python/cpython/pull/21405

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset 4fa61a7732923f92de0f7830c12da48c4cec937f by Mark Sapiro in branch 
'master':
bpo-40597: Allow email.contextmanager set_content() to set a null string. 
(GH-20542)
https://github.com/python/cpython/commit/4fa61a7732923f92de0f7830c12da48c4cec937f


--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20553
pull_request: https://github.com/python/cpython/pull/21404

___
Python tracker 

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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-07-08 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

I'm working on a short reproducer, but otherwise reproducer is exactly the same 
as described in https://bugs.python.org/issue41194#msg372854

The way I bumped into this is trying to confirm the fix in Beta 4 (which 
apparently didn't make it, as you mentioned).

--

___
Python tracker 

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



[issue41093] TCPServer's server_forever() shutdown immediately when calling shutdown()

2020-07-08 Thread Tony


Tony  added the comment:

bump

--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset c1c50345933efca42169f03d79ff4fe3d9c06bdc by Miss Islington (bot) 
in branch '3.8':
bpo-40597: Allow email.contextmanager set_content() to set a null string. 
(GH-20542)
https://github.com/python/cpython/commit/c1c50345933efca42169f03d79ff4fe3d9c06bdc


--

___
Python tracker 

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



  1   2   >