[issue40790] Python should enable computed gotos on Mac by default

2020-05-27 Thread laike9m


New submission from laike9m :

Issue is described here with more details:
https://stackoverflow.com/q/61860463/2142577

Basically, when building on Mac, Python should enable computed gotos by 
default, because it is supported (https://stackoverflow.com/a/62037189/2142577).

The 
documentation(https://docs.python.org/3/whatsnew/3.2.html#build-and-c-api-changes)
 says
> Computed gotos are now enabled by default on supported compilers (which are 
> detected by the configure script). They can still be disabled selectively by 
> specifying --without-computed-gotos.

This seems to imply that the capability detection is wrong.

--
components: macOS
messages: 370051
nosy: laike9m, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python should enable computed gotos on Mac by default
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue40789] C-level destructor in PySide2 breaks gen_send_ex, which assumes it's safe to call Py_DECREF with a live exception

2020-05-27 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 27.05.2020 05:56, Nathaniel Smith wrote:
> In CPython in general, it could be worked around by not invoking deallocators 
> with a live exception... I'm actually pretty surprised that this is even 
> possible! It seems like having a live exception when you start executing 
> arbitrary Python code would be bad. So maybe that's the real bug? Adding both 
> "asyncio" and "memory management" interest groups to the nosy.

Exception handlers can execute arbitrary Python code, so it's not
surprising that objects get allocated, deallocated, etc.

What you're describing sounds more like a problem with the PySide2
code not being reentrant. Clearing exceptions always has to be done
with some care. It's normally only applied to replace the exception
with a more specific one, when the exception is expected and handled
in the C code, or when there is no way to report the exception back
up the stack.

Note: Even the PyErr_Print() can result in Python code being
executed and because it's likely that PySide2 objects are part
of the stack trace, even PySide2 methods may be called as a result.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Experts (#1, May 27 2020)
>>> Python Projects, Coaching and Support ...https://www.egenix.com/
>>> Python Product Development ...https://consulting.egenix.com/


::: We implement business ideas - efficiently in both time and costs :::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   https://www.egenix.com/company/contact/
 https://www.malemburg.com/

--

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Devin Jeanpierre


New submission from Devin Jeanpierre :

`hmac.compare_digest` (via `_tscmp`) does not mark the accumulator variable 
`result` as volatile, which means that the compiler is allowed to short-circuit 
the comparison loop as long as it still reads from both strings.

In particular, when `result` is non-volatile, the compiler is allowed to change 
the loop from this:


```c
for (i=0; i < length; i++) {
result |= *left++ ^ *right++;
}
return (result == 0);
```

into (the moral equivalent of) this:


```c
for (i=0; i < length; i++) {
result |= *left++ ^ *right++;
if (result) {
for (; ++i < length;) {
*left++; *right++;
}
return 1;
}
}
return (result == 0);
```

(Code not tested.)

This might not seem like much, but it cuts out almost all of the data 
dependencies between `result`, `left`, and `right`, which in theory would free 
the CPU to race ahead using out of order execution -- it could execute code 
that depends on the result of `_tscmp`, even while `_tscmp` is still performing 
the volatile reads. (I have not actually benchmarked this. :)) In other words, 
this weird short circuiting could still actually improve performance. That, in 
turn, means that it would break constant-time guarantees.

(This is different from saying that it _would_ increase performance, but 
marking it volatile removes the worry.)

(Prior art/discussion: 
https://github.com/google/tink/commit/335291c42eecf29fca3d85fed6179d11287d253e )


I propose two changes, one trivial, and one that's more invasive:

1) Make `result` a `volatile unsigned char` instead of `unsigned char`. 

2) When SSL is available, instead use `CRYPTO_memcmp` from OpenSSL/BoringSSL. 
We are, in effect, "rolling our own crypto". The SSL libraries are more 
strictly audited for timing issues, down to actually checking the generated 
machine code. As tools improve, those libraries will grow to use those tools. 
If we use their functions, we get the benefit of those audits and improvements.

--
components: Library (Lib)
messages: 370053
nosy: Devin Jeanpierre
priority: normal
severity: normal
status: open
title: hmac.compare_digest could try harder to be constant-time.
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue40792] Make PyNumber_Index() always returning an exact int instance

2020-05-27 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently PyNumber_Index() can return something that's an instance of a strict 
subclass of int. For example PyNumber_Index(Py_True) returns Py_True. The same 
for operator.index():

>>> import operator
>>> operator.index(True)
True

The proposed PR makes it always return an int.

To avoid possible overhead for creating temporary integer object, added private 
function _PyNumber_Index() with the past behavior. It can be used for 
short-living integer objects which for which only its value will be used, but 
not its methods. For example in the implementation of PyLong_AsLong() and 
similar functions.

See also issue17576.

--
components: Interpreter Core
messages: 370054
nosy: barry, mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Make PyNumber_Index() always returning an exact int instance
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



[issue40792] Make PyNumber_Index() always returning an exact int instance

2020-05-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue40787] Mysql + unittest crash

2020-05-27 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Lucas, this is probably not an issue with unittest but a bug in the test 
themselves. Can you attach an example to reproduce the issue?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue40741] Upgrade to SQLite v3.32.1 in Windows and macOS builds

2020-05-27 Thread Ned Deily


Ned Deily  added the comment:

Note: Issue40784 documents a test failure introduced by running with v3.32+.

--

___
Python tracker 

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



[issue40784] test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32

2020-05-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Devin Jeanpierre


Change by Devin Jeanpierre :


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

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-05-27 Thread miss-islington


miss-islington  added the comment:


New changeset 1cf15af9a6f28750f37b08c028ada31d38e818dd by Pablo Galindo in 
branch 'master':
bpo-40217:  Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec 
types (reverts GH-19414) (GH-20264)
https://github.com/python/cpython/commit/1cf15af9a6f28750f37b08c028ada31d38e818dd


--
nosy: +miss-islington

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2020-05-27 Thread Ned Deily


Change by Ned Deily :


--
stage: patch review -> needs patch
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.7, Python 3.8

___
Python tracker 

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



[issue40762] Writing bytes using CSV module results in b prefixed strings

2020-05-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

> Short of outright banning the use of bytes (raise a TypeError), I think
> the current behaviour is least-worst.

I agree.

I'd like to see the TypeError raised for everything that's not a string or 
number (since the docs say that's what's accepted), but at this point that 
would be big change. Maybe we could add a parameter to __init__ to turn on that 
behavior.

--
nosy: +eric.smith
type: enhancement -> behavior

___
Python tracker 

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



[issue40763] zipfile.extractall is safe by now

2020-05-27 Thread Ama Aje My Fren


Ama Aje My Fren  added the comment:

On Tue, May 26, 2020 at 2:47 PM Va  wrote:
>
> What hasn't been handled then?
>

The rules for naming files in Windows is long
(https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file).
It is e.g. possible to create files under WSL within Windows that
break these rules. In my case it was to add the colon (:) to a file
name. In Python for windows this would fail because the underlying
system API would stop it from happening (and in zip, it will be
changed to an underscore (_)) - but it is unclear what would actually
happen if you do so. In the old days just trying to open C:\Con\Con
(which did not exist) caused a BSOD.

>
> What is the safe way to use it?
>

The Security message suggests _with care_ - to wit - "Never extract
archives from untrusted sources without prior inspection."
There may be no absolutely safe way if the zipfile was crafted
maliciously. Just like there are inherent vulnerabilities in using XML
... (https://docs.python.org/3/library/xml.html#xml-vulnerabilities).
If a zipped file had a tree starting at C:\ and replaced a dll in
C:\Windows (and was running as Admin), a lot of caveats I know, but it
could be a problem.

> I think documenting "this function is unsafe" without suggesting a 
> replacement or a safe way to use it isn't very constructive: as a developer, 
> I want to extract a zip archive, but the only function supposed to do the job 
> tells me "this is unsafe". Ok, so what am I supposed to do to be safe?

Does it say that unzipping a file is unsafe? It looks to me like it
says that in special conditions the extraction of a zipped file tree
may be unsafe and it is important to use caution. It is the case in a
lot of programming, is it not, that there are instances of security
vulnerabilities entering ordinary looking code? It happens in sql
(https://xkcd.com/327/) and many places within Python's Standard
Library 
(https://hackernoon.com/10-common-security-gotchas-in-python-and-how-to-avoid-them-e19fbe265e03)
even something as innocuous as using the new-style string format
(https://lucumr.pocoo.org/2016/12/29/careful-with-str-format/).

>
> That's what documentation should tell me, not let me puzzled with doubt.
>

This is an interesting point. What is the scope of Python Library
Documentation? I disagree with your view on scope. In my view the
Library Documentation should focus on what is exposed in the library
for ordinary use. So e.g. implementation details may not be expected
to be shown in the Documentation (like there is no documentation for
zipfile._extract_member()). It does have a duty of care - especially
to well known gotchas - but it is _not_ security documentation. I
think (this is my view, it is not god given) that in many cases it is
fair to assume that if one told a developer to be careful with her
code it is enough in so far as library documentation is concerned.

Thanks.

--
title: zipfile.extractall is safe by now? -> zipfile.extractall is safe by now

___
Python tracker 

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



[issue40586] Pydoc should support https for hyperlinks.

2020-05-27 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +19701
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19976

___
Python tracker 

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



[issue40586] Pydoc should support https for hyperlinks.

2020-05-27 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Add parsing of https links to pydoc

___
Python tracker 

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



[issue40762] Writing bytes using CSV module results in b prefixed strings

2020-05-27 Thread Skip Montanaro


Skip Montanaro  added the comment:

This likely worked in the past because bytes == str in Python 2.x. This is just 
a corner case people porting from 2 to 3 need to address in their code. 
Papering over it so people using Pandas don't have to do the right thing is no 
reason to make changes. Bytes aren't strings any longer. A huge effort was 
undertaken to clean up this aspect of Python's data model in the move to Python 
3. Conflating bytes and strings at this point (no matter which way you try to 
accomplish that conflation) makes no sense to me. 

The current behavior should not be changed.

--

___
Python tracker 

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



[issue40784] test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32

2020-05-27 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Hi, folks. I took the liberty to create a PR for this; hope you don't mind. 
I've used partial indices to test deterministic behaviour.

https://www.sqlite.org/partialindex.html

--

___
Python tracker 

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



[issue40784] test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32

2020-05-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue39580] Check for COMMAND_LINE_INSTALL variable in Python_Documentation.pkg

2020-05-27 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the PR! It looks reasonable but I do want to test it first on older 
macOS versions that we support before merging it. I'll do that before the next 
releases.

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

___
Python tracker 

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



[issue37999] No longer use implicit convertion to int with loss

2020-05-27 Thread Mark Dickinson


Mark Dickinson  added the comment:

There are some comments in the Objects/longobject.c code that still refer to 
__int__, and could use an update.

For example: 
https://github.com/python/cpython/blob/7da46b676aed7111de34b57c8b942a7f3bb80327/Objects/longobject.c#L366

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue40792] Make PyNumber_Index() always returning an exact int instance

2020-05-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This change conflicts with the test added in issue26202. We perhaps should 
revert issue26202. This can also affect the user code which depends on range() 
attributes start, stop and step being instances of the int subclass.

--

___
Python tracker 

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



[issue37999] No longer use implicit convertion to int with loss

2020-05-27 Thread Mark Dickinson


Change by Mark Dickinson :


--
pull_requests: +19703
pull_request: https://github.com/python/cpython/pull/20449

___
Python tracker 

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



[issue30462] urllib does not support NO_PROXY environment variable containing domain with asterisk

2020-05-27 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

The original pull request has been closed for inactivity, so this is now 
available for anyone to work on.  Please credit the original author if anyone 
change is based on the original PR.  Thanks!

--
nosy: +cheryl.sabella
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



[issue40793] print() performance problem with very large numbers

2020-05-27 Thread U.W.


New submission from U.W. :

Printing very large numbers takes forever.

Example:
print((2**24)**(3840*2160))

That number has about 60 Million digits and my machine is busy now for more 
than an hour and still not finished.

The calculation of the number is no problem, btw. and finishes in under a 
second.

--
components: Interpreter Core
messages: 370066
nosy: U.W.
priority: normal
severity: normal
status: open
title: print() performance problem with very large numbers
versions: Python 3.6

___
Python tracker 

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



[issue40762] Writing bytes using CSV module results in b prefixed strings

2020-05-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since Pandas opens an output file it has control on what encoding is used. It 
is a Pandas' responsibility to decode bytes, or raise an exception, or just 
ignore the problem if it is pretty uncommon case. Pandas already have a complex 
code for formatting output data into CSV files, one additional check does not 
matter.

--

___
Python tracker 

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



[issue40762] Writing bytes using CSV module results in b prefixed strings

2020-05-27 Thread Skip Montanaro


Skip Montanaro  added the comment:

I would also that tweaking Python to make this work with no change in Pandas 
would be a case of the tail wagging the dog. A big tail, but a tail nonetheless.

--

___
Python tracker 

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



[issue40793] print() performance problem with very large numbers

2020-05-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is not a print() problem, it is a problem with converting an integer to 
decimal string representation. AFAIK it has quadratic complexity from the size 
of the integer.

--
nosy: +mark.dickinson, serhiy.storchaka

___
Python tracker 

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



[issue40793] print() performance problem with very large numbers

2020-05-27 Thread Mark Dickinson


Mark Dickinson  added the comment:

Right; the naive algorithm for converting the internal binary representation to 
the decimal representation is quadratic time. In *theory* we could implement a 
subquadratic time algorithm, but the complexity of such an implementation 
outweighs the benefits. Python really isn't targeted at super-fast 
million-digit arithmetic; that's more the domain of libraries like GMP.

Closing as "won't fix". I'd recommend using gmpy2[1] instead. Alternatively, 
you may be able to make the `Decimal` type work with a suitably huge precision.

Related: #26256.

[1] gmpy2: https://gmpy2.readthedocs.io/en/latest/intro.html

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



[issue40792] Make PyNumber_Index() always returning an exact int instance

2020-05-27 Thread Mark Dickinson


Mark Dickinson  added the comment:

The behaviour change for range sounds reasonable to me.

Just to make sure I understand the impact of the change:

- For Python < 3.10, we sometimes convert the range inputs to Python ints, and 
sometimes don't. For example, a start value of `np.int64(5)` would be 
converted, but a value of `True` would not be.

- With this change, we'd always convert a non-int to an int, so both 
`np.int64(1)` and `True` would be converted to a `1` of exact type int.

IMO this is fine; the new behaviour seems more consistent than the old.

>>> import numpy as np
>>> start = np.int64(2)
>>> range(start, 5).start is start
False
>>> start = True
>>> range(start, 5).start is start
True

--

___
Python tracker 

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



[issue37999] No longer use implicit convertion to int with loss

2020-05-27 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 20941de0ddc39ce9f07e29b4cc770e8a9ef14d41 by Mark Dickinson in 
branch 'master':
bpo-37999: Fix outdated __int__ and nb_int references in comments (GH-20449)
https://github.com/python/cpython/commit/20941de0ddc39ce9f07e29b4cc770e8a9ef14d41


--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

While I was working on making 'future annotations' default, I noticed that 
dataclasses acts differently under the annotation feature. One example would be 
the file [signature.py]:

[ without future import]
 $ python t.py
X(a: int, b: int)
[ with future import]
 $ python t.py
X(a: '_type_a', b: '_type_b') -> '_return_type'

This is causing too much test to fail,
AssertionError: '_return_type' is not None

- C(x:'_type_x')->'_return_type'
+ C(x:collections.deque)

- C(x:'_type_x'=)->'_return_type'
+ C(x:collections.deque=)

- C(x:'_type_x')->'_return_type'
+ C(x:List[int])

(and more)

--
files: script.py
messages: 370073
nosy: BTaskaya, eric.smith
priority: normal
severity: normal
status: open
title: dataclass signatures and docstrings w/future-annotations
Added file: https://bugs.python.org/file49195/script.py

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-05-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fe2978b3b940fe2478335e3a2ca5ad22338cdf9c by Victor Stinner in 
branch 'master':
bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)
https://github.com/python/cpython/commit/fe2978b3b940fe2478335e3a2ca5ad22338cdf9c


--

___
Python tracker 

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



[issue40741] Upgrade to SQLite v3.32.1 in Windows and macOS builds

2020-05-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +vstinner

___
Python tracker 

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



[issue40741] Upgrade to SQLite v3.32.1 in Windows and macOS builds

2020-05-27 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Ready with PR as soon as GH-20448 is merged and cpython-source-deps 
(https://github.com/python/cpython-source-deps/pull/19) is merged and tagged.

--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +gvanrossum, lukasz.langa, vstinner, yselivanov

___
Python tracker 

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



[issue39073] email incorrect handling of crlf in Address objects.

2020-05-27 Thread miss-islington


miss-islington  added the comment:


New changeset 75635c6095bcfbb9fccc239115d3d03ae20a307f by Miss Islington (bot) 
in branch '3.8':
bpo-39073: validate Address parts to disallow CRLF (GH-19007)
https://github.com/python/cpython/commit/75635c6095bcfbb9fccc239115d3d03ae20a307f


--

___
Python tracker 

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



[issue39073] email incorrect handling of crlf in Address objects.

2020-05-27 Thread miss-islington


miss-islington  added the comment:


New changeset a93bf82980d7c02217a088bafa193f32a4d13abb by Miss Islington (bot) 
in branch '3.7':
bpo-39073: validate Address parts to disallow CRLF (GH-19007)
https://github.com/python/cpython/commit/a93bf82980d7c02217a088bafa193f32a4d13abb


--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

It,sounds like you are trying to get the effect of putting 'from __future__ 
import dataclasses' at the top of dataclasses'.py, right? Are you saying that 
without this, the output of the test script is correct?

--

___
Python tracker 

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



[issue40780] float.__format__() handles trailing zeros inconsistently in “general” format

2020-05-27 Thread Mark Dickinson


Change by Mark Dickinson :


--
versions:  -Python 3.7, Python 3.8

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> It,sounds like you are trying to get the effect of putting 'from __future__ 
> import dataclasses' at the top of dataclasses'.py, right?

Yes, since compile will automatically inherit the flags of the current frame to 
the compiled code I'm basically inserting a 'future annotations' import at the 
top of the file. 

> Are you saying that without this, the output of the test script is correct?

Yes.

--

___
Python tracker 

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



[issue39073] [security] email module incorrect handling of CR and LF newline characters in Address objects.

2020-05-27 Thread STINNER Victor


Change by STINNER Victor :


--
title: email incorrect handling of crlf in Address objects. -> [security] email 
module incorrect handling of CR and LF newline characters in Address objects.

___
Python tracker 

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



[issue39073] email incorrect handling of crlf in Address objects.

2020-05-27 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 6.0 -> 7.0
pull_requests: +19704
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/20450

___
Python tracker 

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



[issue39073] email incorrect handling of crlf in Address objects.

2020-05-27 Thread STINNER Victor


STINNER Victor  added the comment:

I created PR 20450: backport to 3.5, since it's a security fix.

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

___
Python tracker 

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



[issue39073] email incorrect handling of crlf in Address objects.

2020-05-27 Thread STINNER Victor


STINNER Victor  added the comment:

FYI I created 
https://python-security.readthedocs.io/vuln/email-address-header-injection.html 
to track fixes of this vulnerability.

--

___
Python tracker 

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



[issue40790] Python should enable computed gotos on Mac by default

2020-05-27 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

The configure script sets the result of compiler probing with 
HAVE_COMPUTED_GOTOS not USE_COMPUTED_GOTOS.

--
nosy: +benjamin.peterson
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

Have you come up with a fix yet? (Preferably a fix that can be applied locally 
to dataclasses.py.)

--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Have you come up with a fix yet? (Preferably a fix that can be applied 
> locally to dataclasses.py.)

I'm working on it, but no luck so far.

--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

Hmm. That's a regression, at least from 3.7, which is the only version I have 
ready access to:

$ python3
Python 3.7.3 (default, Mar 27 2019, 13:36:35) 
[GCC 9.0.1 20190227 (Red Hat 9.0.1-0.8)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dataclasses
>>> @dataclasses.dataclass
... class X:
...   a: int
...   b:int
... 
>>> X.__doc__
'X(a: int, b: int)'
>>> 

$ python3
Python 3.7.3 (default, Mar 27 2019, 13:36:35) 
[GCC 9.0.1 20190227 (Red Hat 9.0.1-0.8)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import annotations
>>> import dataclasses
>>> @dataclasses.dataclass
... class X:
...   a: int
...   b:int
... 
>>> X.__doc__
"X(a: 'int', b: 'int')"

--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Hmm. That's a regression, at least from 3.7, which is the only version I have 
> ready access to:

That is the same behavior with the current master, the problem I am having is 
related to using annotations feature on dataclasses itself rather than the 
program that imports it. I've tested script.py on 3.7.5 and it gives the same 
output.

--

___
Python tracker 

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



[issue14527] How to link with a non-system libffi?

2020-05-27 Thread Rupert Nash


Change by Rupert Nash :


--
keywords: +patch
nosy: +rnash
nosy_count: 3.0 -> 4.0
pull_requests: +19705
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20451

___
Python tracker 

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



[issue14527] How to link with a non-system libffi?

2020-05-27 Thread Rupert Nash


Rupert Nash  added the comment:

I have just struggled with building CPython with the _ctypes module. 
Fundamentally, the problem appears to be that configure uses pkgconfig to find 
the libffi include directory, while setup.py's detect_ctypes only uses the 
global list of library directories.

I have made an attempt at fixing this by having configure produce the directory 
containing libffi (`LIBFFI_LIBDIR`) and setup.py use this. However I've hardly 
any experience with autotools, so I would be very happy to be corrected if this 
is no use at all.

The PR is https://github.com/python/cpython/pull/20451

--

___
Python tracker 

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



[issue40795] ctypes: PyErr_WriteUnraisable() called with no exception set on converting callback result failure

2020-05-27 Thread STINNER Victor


New submission from STINNER Victor :

Example:
---
from ctypes import c_int, CFUNCTYPE

def func():
return (1, 2, 3)

cb = CFUNCTYPE(c_int)(func)
cb()
---

Output:
---
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 262, in 'converting callback result'
TypeError: an integer is required (got type tuple)
Exception ignored in: 
---

Assertion error in debug mode:
---
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 262, in 'converting callback result'
TypeError: 'tuple' object cannot be interpreted as an integer
python: Python/errors.c:1435: _PyErr_WriteUnraisableMsg: Assertion `exc_type != 
NULL' failed.
Abandon (core dumped)
---

Attached PR fix the issue.

--
components: Library (Lib)
messages: 370089
nosy: vstinner
priority: normal
severity: normal
status: open
title: ctypes: PyErr_WriteUnraisable() called with no exception set on 
converting callback result failure
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

To clarify, for Eric: what Batuhan did is effectively adding `from __future__ 
import annotations` to the top of dataclasses.py.

I believe the root cause is that dataclasses creates functions by synthesizing 
`def` statements (in _create_fn()) and the annotations there are references to 
variables in a dedicated namespace. Maybe we should patch the __annotations__ 
attribute of the result before sticking it into the class?

--

___
Python tracker 

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



[issue40795] ctypes: PyErr_WriteUnraisable() called with no exception set on converting callback result failure

2020-05-27 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue14562] urllib2 maybe blocks too long with small chunks

2020-05-27 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2 is EOL, so I think this issue should be closed.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I see. Not sure how I overlooked that. Thanks.

At first blush, I think your approach would work.

--

___
Python tracker 

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



[issue13097] [easy C issue] ctypes: segfault with large number of callback arguments

2020-05-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 29a1384c040d39659e7d01f1fd7b6eb71ef2634e by Sean Gillespie in 
branch 'master':
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
https://github.com/python/cpython/commit/29a1384c040d39659e7d01f1fd7b6eb71ef2634e


--

___
Python tracker 

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



[issue13097] [easy C issue] ctypes: segfault with large number of callback arguments

2020-05-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19710
pull_request: https://github.com/python/cpython/pull/20455

___
Python tracker 

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



[issue13097] [easy C issue] ctypes: segfault with large number of callback arguments

2020-05-27 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue13097] [easy C issue] ctypes: segfault with large number of callback arguments

2020-05-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19709
pull_request: https://github.com/python/cpython/pull/20454

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +christian.heimes, gregory.p.smith

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 for both of these suggestions

--
nosy: +rhettinger
type:  -> security
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

I have applied Guido's suggestion and it looks like it is working.

--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

(I applied it to my own branch, don't know if a seperate PR needed)

--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

You can do this as part of your mega-PR to turn on `from __future__ import 
annotations` by default.

--

___
Python tracker 

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



[issue2897] Deprecate structmember.h

2020-05-27 Thread Matthias Braun


Matthias Braun  added the comment:

This wasn't mentioned before: Having PyMemberDef part of the structmember.h is 
a big problem for users of PEP384/limited API, because structmember.h is not 
part of it.

Which results in the odd situation that `Py_tp_members` or 
`PyDescr_NewMember()` are part of the limited API but technically you cannot 
use it because you are not supposed to include headers that are not part of 
`Python.h`.

The proposed patch here, would fix this!

--
nosy: +Matthias Braun

___
Python tracker 

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



[issue2897] Deprecate structmember.h

2020-05-27 Thread Matthias Braun


Change by Matthias Braun :


--
components: +C API
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



[issue13097] [easy C issue] ctypes: segfault with large number of callback arguments

2020-05-27 Thread miss-islington


miss-islington  added the comment:


New changeset 788d7bfe189e715eab3855c20ea5d6da0d8bed70 by Miss Islington (bot) 
in branch '3.9':
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
https://github.com/python/cpython/commit/788d7bfe189e715eab3855c20ea5d6da0d8bed70


--

___
Python tracker 

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



[issue2897] Deprecate structmember.h

2020-05-27 Thread STINNER Victor


STINNER Victor  added the comment:

> The proposed patch here, would fix this!

The issue title is misleading, it says "Deprecate structmember.h". Is the plan 
still to deprecate it? Or to make it usable in the limited C API? Please update 
the title.

--

___
Python tracker 

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



[issue40794] dataclass signatures and docstrings w/future-annotations

2020-05-27 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



[issue13097] [easy C issue] ctypes: segfault with large number of callback arguments

2020-05-27 Thread miss-islington


miss-islington  added the comment:


New changeset 1c4dcafd0b025e771f4dbd7197d0b5f263c9cb54 by Miss Islington (bot) 
in branch '3.7':
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
https://github.com/python/cpython/commit/1c4dcafd0b025e771f4dbd7197d0b5f263c9cb54


--

___
Python tracker 

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



[issue13097] [easy C issue] ctypes: segfault with large number of callback arguments

2020-05-27 Thread miss-islington


miss-islington  added the comment:


New changeset a285af7e626d1b81cf09f8b2bf7656f100bc1237 by Miss Islington (bot) 
in branch '3.8':
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
https://github.com/python/cpython/commit/a285af7e626d1b81cf09f8b2bf7656f100bc1237


--

___
Python tracker 

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



[issue2897] Deprecate structmember.h

2020-05-27 Thread Matthias Braun


Matthias Braun  added the comment:

> The issue title is misleading, it says "Deprecate structmember.h". Is the 
> plan still to deprecate it? Or to make it usable in the limited C API? Please 
> update the title.

As far as I understand it: The attached diff, moves the interesting declaration 
to `object.h` solving the limited API problem. And only leaves structmember.h 
around for backward compatibility for people using the "old" names `READONLY` 
or `RESTRICTED`. So in that sense it does deprecate structmember.h

But indeed I hijacked this issue with my complaints about the limited API which 
may not have been the original intention here, but they get solved nonetheless.

--

___
Python tracker 

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



[issue13097] [easy C issue] ctypes: segfault with large number of callback arguments

2020-05-27 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Meador Inge for the bug report and thanks Sean Gillespie for the fix! It 
just took 9 years to fix this corner case ;-)

Copy of the comment on the PR:
https://github.com/python/cpython/pull/19914#pullrequestreview-419331432

I tried to rewrite _ctypes_callproc() to use PyMem_Malloc() instead of 
alloca(), but it's quite complicated. There are 3 arrays with a length of 
argcount items: args, avalues, atypes. Moreover, resbuf is also allocated with 
alloca(). When using PyMem_Malloc(), error handling is much more complicated.

I also tried to restrict the overall usage of stack memory to 4096 bytes (size 
of one page on x86), but users would be surprised by CTYPES_MAX_ARGCOUNT value.

I would say that raising an exception is better than crashing for a lot of 
arguments. If someone is blocked by this new limitation, in that case we can 
revisit the PyMem_Malloc() idea.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.7, Python 3.8, Python 3.9 -Python 2.7, Python 
3.2, Python 3.3

___
Python tracker 

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



[issue2897] Deprecate structmember.h

2020-05-27 Thread STINNER Victor


STINNER Victor  added the comment:

Also, the bare minimum enhancement would be add rename READONLY to PY_READONLY, 
but keep a deprecated alias READONLY to PY_READONLY, and update CPython code 
base to use PY_READONLY. (Same for other similar flags.)

--

___
Python tracker 

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



[issue2897] PyMemberDef missing in limited API / Deprecate structmember.h

2020-05-27 Thread Matthias Braun


Change by Matthias Braun :


--
title: Deprecate structmember.h -> PyMemberDef missing in limited API / 
Deprecate structmember.h

___
Python tracker 

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



[issue2897] PyMemberDef missing in limited API / Deprecate structmember.h

2020-05-27 Thread Matthias Braun


Matthias Braun  added the comment:

Happy to take the proposed diff here (assuming @belopolsky wont mind) and 
include it into a pull request that also renames the uses of the READONLY flags 
(and maybe removes the RESTRICTED flags) within cpython source itself.

--

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Christian - Devin could likely use some help with the build/ifdef plumbing 
required for (2) to use CRYPTO_memcmp from Modules/_operator.c when OpenSSL is 
available.

--
assignee:  -> christian.heimes

___
Python tracker 

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



[issue2897] Deprecate structmember.h

2020-05-27 Thread STINNER Victor


STINNER Victor  added the comment:

> Note that structmember.h pollutes global namespace with macros that do not 
> have conventional Py_ or PY_ prefix.  READONLY and RESTRICTED macros seem to 
> be most likely to conflict with other code.

One small enhance would be to add such prefix when Py_LIMITED_API is defined.

--

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19711
pull_request: https://github.com/python/cpython/pull/20456

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Christian Heimes


Christian Heimes  added the comment:

GPS, I got you covered :)

CRYPTO_memcmp() was on my TODO list for a while. Thanks for nagging me.

_operator is a built-in module. I don't want to add libcrypto dependency to 
libpython. I copied the code, made some adjustments and added it to 
_hashopenssl.c.

--

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-05-27 Thread hai shi


Change by hai shi :


--
pull_requests: +19712
pull_request: https://github.com/python/cpython/pull/20459

___
Python tracker 

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



[issue40701] tempfile mixes str and bytes in an inconsistent manner

2020-05-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

We consider it closer to new feature as it changes existing behavior in a way 
that people cannot _depend_ on being present in older Python releases as it'd 
only appear in a bugfix release, so most people could never write code 
depending on it while claiming to generally support 3.7-3.9.

Anyways your PR overall looks good for 3.10.  I left some comments.

--

___
Python tracker 

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



[issue40667] [Windows] Add global python and python3 commands

2020-05-27 Thread Steve Dower


Steve Dower  added the comment:

After thinking this through some more, I don't think this solves the problem, 
but only changes it. And we're better off leaving things as they are than just 
moving them around.

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

___
Python tracker 

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



[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Darrick Yee


New submission from Darrick Yee :

https://docs.python.org/3/library/dataclasses.html#module-dataclasses

`make_dataclass` takes a `field` parameter, which is an iterable whose entries 
may be tuples of `(name, type)` or `(name, type, dataclasses.Field)`.  However, 
an exception is thrown if such tuples are provided in a particular order.  
Example:


from dataclasses import field, make_dataclass

fieldspec1 = ('field1', str)
fieldspec2 = ('field2', str, field(default='Hello'))

MyDc1 = make_dataclass('MyDc1', [fieldspec1, fieldspec2]) # Ok
MyDc2 = make_dataclass('MyDc2', [fieldspec2, fieldspec1]) # TypeError

I am guessing this is not intentional...

--
messages: 370112
nosy: Darrick Yee
priority: normal
severity: normal
status: open
title: dataclasses.make_dataclass: Exception when called with different field 
orders
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

Isn't this error that you're providing a field without a default value after 
one with a default value?

What's the exception look like?

--
nosy: +eric.smith

___
Python tracker 

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



[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Darrick Yee


Change by Darrick Yee :


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



[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Darrick Yee


Darrick Yee  added the comment:

TypeError: non-default argument 'field1' follows default argument

You are right.  For some reason I believed it would automatically gather the 
required fields first when creating the new class' signature.

--

___
Python tracker 

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



[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

No problem!

It can't reorder fields, because you might not be passing them by name. There's 
some discussion about requiring keyword-only parameters, in which case what 
you're doing would work (as long as they were keyword-only params).

--
resolution:  -> not a bug

___
Python tracker 

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



[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Darrick Yee


Darrick Yee  added the comment:

Yes, that makes sense. Thank you!

On Wed, May 27, 2020, 1:40 PM Eric V. Smith  wrote:

>
> Eric V. Smith  added the comment:
>
> No problem!
>
> It can't reorder fields, because you might not be passing them by name.
> There's some discussion about requiring keyword-only parameters, in which
> case what you're doing would work (as long as they were keyword-only
> params).
>
> --
> resolution:  -> not a bug
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40787] Mysql + unittest crash

2020-05-27 Thread Lucas


Lucas  added the comment:

While trying to simplify my program for you, I found that the problem was 
caused by a very specific interaction of one of the functions that was being 
tested with the restore command, which did not happen when I tried to rule this 
problem out in other ways.

Anyways, thank you for your time.

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

___
Python tracker 

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



[issue37028] Implement asyncio repl

2020-05-27 Thread Éric Araujo

Éric Araujo  added the comment:

Compared to the vanilla REPL, this doesn’t include readline setup for tab 
completion and history file.  Was it on purpose?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue40787] Mysql + unittest crash

2020-05-27 Thread Lucas


Lucas  added the comment:

The problem was that I didn't close the 1st connection to the database and then 
made another request, which had to wait for the 1st to close, to be exact.

--

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2020-05-27 Thread Michał Górny

Michał Górny  added the comment:

I'm sorry but does this change mean that it's not final or...?

My main concern is whether we should be adjusting our packages to the new 
behavior in py3.9, or wait for further changes.

--

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Christian Heimes


Christian Heimes  added the comment:

Greg, is GH-20456 a bug fix / security enhancement or a new feature? I'm 
hesitant to backport it to 3.7 and 3.8. 3.9 might be ok.

--

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I'd feel fine doing that for 3.9 given 3.9.0 is only in beta and this changes 
no public APIs.  For 3.8 and 3.7 i wouldn't.

Be sure to update the versionchanged in the docs if you choose to do it for 3.9.

--

___
Python tracker 

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



[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2020-05-27 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 210a137396979d747c2602eeef46c34fc4955448 by Fantix King in branch 
'master':
bpo-30064: Fix asyncio loop.sock_* race condition issue (#20369)
https://github.com/python/cpython/commit/210a137396979d747c2602eeef46c34fc4955448


--

___
Python tracker 

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



[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2020-05-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +19713
pull_request: https://github.com/python/cpython/pull/20460

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-05-27 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset db5aed931f8a617f7b63e773f62db468fe9c5ca1 by Christian Heimes in 
branch 'master':
bpo-40791: Use CRYPTO_memcmp() for compare_digest (#20456)
https://github.com/python/cpython/commit/db5aed931f8a617f7b63e773f62db468fe9c5ca1


--

___
Python tracker 

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



[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-05-27 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset b5ecbf02e4dbdea6d1c9a6d7189137f76e70c073 by Miss Islington (bot) 
in branch '3.8':
bpo-40025: Require _generate_next_value_ to be defined before members(GH-19763)
https://github.com/python/cpython/commit/b5ecbf02e4dbdea6d1c9a6d7189137f76e70c073


--

___
Python tracker 

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



  1   2   >