[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-05-28 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

All right, will do, Berker Persag.

--

___
Python tracker 

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



[issue39189] Use io.DEFAULT_BUFFER_SIZE for filecmp BUFSIZE variable

2020-05-28 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Is there some reason a priori that these constants should be defined to be the 
same rather than being the same coincidentally?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue39040] Wrong attachement filename when mail mime header was too long

2020-05-28 Thread R. David Murray


R. David Murray  added the comment:


New changeset 21017ed904f734be9f195ae1274eb81426a9e776 by Abhilash Raj in 
branch 'master':
bpo-39040: Fix parsing of email mime headers with whitespace between 
encoded-words. (gh-17620)
https://github.com/python/cpython/commit/21017ed904f734be9f195ae1274eb81426a9e776


--

___
Python tracker 

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



[issue39040] Wrong attachement filename when mail mime header was too long

2020-05-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19752
pull_request: https://github.com/python/cpython/pull/20506

___
Python tracker 

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



[issue39040] Wrong attachement filename when mail mime header was too long

2020-05-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19751
pull_request: https://github.com/python/cpython/pull/20505

___
Python tracker 

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



[issue39040] Wrong attachement filename when mail mime header was too long

2020-05-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +19750
pull_request: https://github.com/python/cpython/pull/20504

___
Python tracker 

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



[issue36207] robotsparser deny all with some rules

2020-05-28 Thread mathias44


mathias44  added the comment:

I can't display my robot.TXT. I want to ban robots 
https://ereputation-dereferencement.fr/

--
nosy: +mathias44

___
Python tracker 

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



[issue37198] _parse_localename fail to parse 'en_IL'

2020-05-28 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
stage: patch review -> needs patch
versions: +Python 3.10 -Python 2.7

___
Python tracker 

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



[issue25567] shlex.quote doesn't work on bytestrings

2020-05-28 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

The first pull request has been closed, so this issue is available to be worked 
on.  If the original patch or PR are used, please credit the original authors.  
Thanks!

--
nosy: +cheryl.sabella
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue37218] Default hmac.new() digestmod has not been removed from documentation

2020-05-28 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

The wording for this was fixed with the PR for #33604.

--
nosy: +cheryl.sabella
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> HMAC default to MD5 marked as to be removed in 3.6

___
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-28 Thread Berker Peksag


Change by Berker Peksag :


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

___
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-28 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset c610d970f5373b143bf5f5900d4645e6a90fb460 by Erlend Egeberg 
Aasland in branch 'master':
bpo-40784: Fix sqlite3 deterministic test (GH-20448)
https://github.com/python/cpython/commit/c610d970f5373b143bf5f5900d4645e6a90fb460


--
nosy: +berker.peksag

___
Python tracker 

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



[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-05-28 Thread Berker Peksag


Berker Peksag  added the comment:

+1 for dropping support for < 3.7.15 in master. We should fix or skip tests in 
maintenance branches.

--
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue40770] RFE: Run linkchecker on documentation on the CI

2020-05-28 Thread Ned Deily


Ned Deily  added the comment:

I think our CI checks already take too long to run and use possibly more than 
our fair share of global open source resources (provided by GitHub, Travis, MS 
Azure) especially considering how infrequently you would expect to find a 
problem and the low severity of missing one immediately.  I think a more 
appropriate choice would be to set up a buildbot to do such a check, perhaps 
weekly is often enough, not more than daily.

Julien, what do you think?

--
nosy: +ned.deily

___
Python tracker 

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



[issue40770] RFE: Run linkchecker on documentation on the CI

2020-05-28 Thread Ned Deily


Change by Ned Deily :


--
nosy: +mdk

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


miss-islington  added the comment:


New changeset 6637bd45163024f2187e40d2cc12c473f78bf5da by Miss Islington (bot) 
in branch '3.9':
bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)
https://github.com/python/cpython/commit/6637bd45163024f2187e40d2cc12c473f78bf5da


--

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


Change by miss-islington :


--
pull_requests: +19749
pull_request: https://github.com/python/cpython/pull/20503

___
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-28 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset dc4eee9e266267498a6b783a0abccc23c06f2b87 by Fantix King in branch 
'master':
bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)
https://github.com/python/cpython/commit/dc4eee9e266267498a6b783a0abccc23c06f2b87


--

___
Python tracker 

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



[issue39685] Python 3.8 regression Socket operation on non-socket

2020-05-28 Thread Christian Heimes


Change by Christian Heimes :


--
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue39685] Python 3.8 regression Socket operation on non-socket

2020-05-28 Thread Brian May


Brian May  added the comment:

Consensus seems to be that this is a bug in sshuttle, not a bug in python. 
Thanks for the feedback.

I think this bug can be closed now...

--

___
Python tracker 

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



[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-05-28 Thread Erlend Egeberg Aasland

Erlend Egeberg Aasland  added the comment:

Debian oldstable (jessie) has sqlite 3.8.7.1
Ubuntu 14.04 LTS (trusty) has sqlite 3.8.2
CentOS 7 and 8 has sqlite versions > 3.7.15

The following distributions include sqlite version _less than_ 3.7.15:
• Porteus (release v2.1 and older)
• OLPC OS
• HardenedBSD
• 0Linux / FreePBX (release v10 and older)
• ToOpPy Linux
• Baruwa Enterprise Edition

The other hits were inactive distros.

https://distrowatch.com/search.php?pkg=sqlite=less=3.7.15=InLatest#pkgsearch

--

___
Python tracker 

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



[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2020-05-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Paul, do you have any thoughts on this one.

ISTM that this issue isn't well suited for a newcomer because it's somewhat 
complex and it isn't clear what if anything should be done.

--
nosy: +rhettinger
priority: high -> normal

___
Python tracker 

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



[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-05-28 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please check https://distrowatch.com/ and verify that all major Linux 
distributions have a sufficient version of sqlite. Please also check LTS like 
Debian oldstable, Ubuntu, and CentOS.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-05-28 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Also related to bpo-26187

--

___
Python tracker 

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



[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-05-28 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue40744] Explicitly drop support for SQLite version < 3.7.3

2020-05-28 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2020-05-28 Thread Malcolm Smith


Malcolm Smith  added the comment:

> Try for example create/rename .somename.jpg file in Ubuntu.
> It is normal image with .jpg extension. You could open it etc.
>
> You can't use standard python splitext() function to detect extension.

Yes you can (Python 3.8.2):

>>> splitext(".somename.jpg")
('.somename', '.jpg')

Only leading dots are treated specially. If there are non-leading dots later in 
the name, then the filename will be split at the last one.

So the only remaining question is weird filenames like ".jpg". There's no 
way to know whether that's supposed to be a name with an extension, or a 
dot-file with multiple leading dots. Either choice would be reasonable, but 
we've already gone with the second one. 

Maybe sometimes you might prefer the other way, but such filenames are so rare 
that I can't imagine we'd ever add an option for this. So I think this issue 
can be closed.

--
nosy: +Malcolm Smith

___
Python tracker 

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



[issue40811] Allow to create new Event Loops on Threads

2020-05-28 Thread Christian Heimes


Christian Heimes  added the comment:

The default policy of asyncio deliberately limits automatic creation of event 
loops to the main thread. You can't just mix asyncio with a threaded web 
application and expect it to work correctly.

See 
https://github.com/python/cpython/blob/a487a39dca4c41305928c7dfdbcb0b3aa344683b/Lib/asyncio/events.py#L609-L620

In this policy, each thread has its own event loop.  However, we
only automatically create an event loop by default for the main
thread; other threads by default have no event loop.

Other policies may have different rules (e.g. a single global
event loop, or automatically creating an event loop per thread, or
using some other notion of context to which an event loop is
associated).

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40474] Code coverage report not entirely accurate

2020-05-28 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



[issue40474] Code coverage report not entirely accurate

2020-05-28 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset d9c1f1991969e99791de75b2bc935e6445bc5dcd by lrjball in branch 
'master':
bpo-40474: Updated coverage.yml to better report coverage stats (#19851)
https://github.com/python/cpython/commit/d9c1f1991969e99791de75b2bc935e6445bc5dcd


--
nosy: +brett.cannon

___
Python tracker 

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



[issue40801] Expose PyFloat_AsDouble at Python level: operator.as_float?

2020-05-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Converting Decimal, Fraction, float128 to float before using it in expression 
> can lead to loss of precision.

My experience is that this loss of precision is hardly ever a practical problem 
in the real world of scientific development; in practice floating-point numbers 
 are almost universally IEEE 754 doubles (perhaps sometimes single-precision in 
large datasets, like seismic SEG-Y files; occasionally IBM format hex floats; 
but IEEE 754 doubles are by far the majority). It's very rare to be using 
float128 or Decimal or Fraction in practice for scientific data.

That's not to say that people outside that world won't be using these things, 
but there's a big ecosystem where float64 is pretty much all you need.

--

___
Python tracker 

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



[issue40801] Expose PyFloat_AsDouble at Python level: operator.as_float?

2020-05-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

> So such conversion looks to me less useful than operator.index().

That may be true, but it's still useful, and currently very hard to write 
without core Python support. The problem is that duck-typing for something 
float-like is easy and widespread in the Python C code (in the math module, in 
float formatting, in *any* function that uses the "d" converter with 
PyArg_ParseTuple), but it's hard to correctly spell the equivalent in pure 
Python.

I've needed this in a few places. Most recently, I needed it for the Enthought 
Traits library: the "Float" trait type accepts something float-like and needs 
to convert it to something of exact Python type float. (That float is then 
often consumed by other third-party libraries that can't reliably be expected 
to do their own duck-typing.)

It would also be useful when trying to create pure Python equivalents for 
modules written in C (e.g., for things like datetime and decimal). Where the C 
code uses PyFloat_AsDouble, there's really no equivalent that can be used in 
Python.

--

___
Python tracker 

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



[issue40811] Allow to create new Event Loops on Threads

2020-05-28 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +19748
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20500

___
Python tracker 

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



[issue40811] Allow to create new Event Loops on Threads

2020-05-28 Thread Christian Exposito


New submission from Christian Exposito :

Right now, Async IO module is not automatically creating a new event loop on 
threads that are not the main thread 
(https://github.com/python/cpython/blob/master/Lib/asyncio/events.py#L638), but 
it should be interesting to do it. For example, WSGI applications handle web 
requests by spawning a new thread. If we allow Async IO module to create event 
loops on those threads, we will improve its adoption for developing web 
applications.

--
components: asyncio
messages: 370257
nosy: Christian Exposito, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Allow to create new Event Loops on Threads
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



[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-05-28 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

`CheckTraceCallbackContent()` in `Lib/sqlite3/test/hooks.py` fails for SQLite 
versions 3.7.3 through 3.7.14.1, apparently because of an SQLite bug that was 
fixed in 3.7.15 (2012-12-12). Extract from the changelog 
https://sqlite.org/changes.html:
```
Avoid invoking the sqlite3_trace() callback multiple times when a statement is 
automatically reprepared due to SQLITE_SCHEMA errors.
```

Either we fix tests for SQLite < 3.7.15, or we drop support for SQLite < 
3.7.15. (I'm +1 for the latter.)

NB: Versions pre 3.7.3 does not build at all, because of 
`sqlite3_create_function_v2()`. See bpo-40744 and GH-20330.

--
components: Library (Lib)
messages: 370256
nosy: erlendaasland
priority: normal
severity: normal
status: open
title: sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 
3.7.14.1
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue40801] Expose PyFloat_AsDouble at Python level: operator.as_float?

2020-05-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The problem with the roundtrip PyFloat_FromDouble(PyFloat_AsDouble(obj)) is 
that (in contrary to PyNumber_Index()) it is lossy. Converting Decimal, 
Fraction, float128 to float before using it in expression can lead to loss of 
precision.

So such conversion looks to me less useful than operator.index().

--

___
Python tracker 

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



[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-05-28 Thread Domenico Ragusa


Domenico Ragusa  added the comment:

I've solved the conflicts with GH-19611 (bpo-23082: Better error message for 
PurePath.relative_to() from pathlib) that was merged in the mean time and 
improved the documentation.

Everything appears to be in order, can you take a look at it?

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



[issue40801] Expose PyFloat_ToDouble at Python level: operator.as_float?

2020-05-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think an alternative constructor is the best option. Some time ago I proposed 
to add more alternative constructors: 
https://mail.python.org/archives/list/python-id...@python.org/thread/5JKQMIC6EUVCD7IBWMRHY7DRTTNSBOWG/

--

___
Python tracker 

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



[issue40801] Expose PyFloat_AsDouble at Python level: operator.as_float?

2020-05-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
title: Expose PyFloat_ToDouble at Python level: operator.as_float? -> Expose 
PyFloat_AsDouble at Python level: operator.as_float?

___
Python tracker 

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



[issue40809] list.Count() isn't working as expected for the series of same numbers in a list

2020-05-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Typo:

"on each step, you delete one item from the from and step forward"

Should be, you delete one item from the FRONT and step forward.

--

___
Python tracker 

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



[issue40809] list.Count() isn't working as expected for the series of same numbers in a list

2020-05-28 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Rémi is correct, this is not a bug.

The problem isn't with list.count. If you print list.count each time through 
the loop, you will see that it is working perfectly. 

The problem is that you are modifying the list as you are iterating over it. 
That means that you skip every second item. It isn't easy to see when all the 
items are the same, but we can alternate int and float values (which are equal) 
to see how every second value is skipped.


py> a = [1, 1.0, 1, 1.0, 1, 1.0, 1, 1.0]
py> for i in a:
... print(a, i, a.count(i))
... if a.count(i) > 1:
... a.remove(i)
...
[1, 1.0, 1, 1.0, 1, 1.0, 1, 1.0] 1 8
[1.0, 1, 1.0, 1, 1.0, 1, 1.0] 1 7
[1, 1.0, 1, 1.0, 1, 1.0] 1 6
[1.0, 1, 1.0, 1, 1.0] 1 5
py> a
[1, 1.0, 1, 1.0]


Notice that every one of the float 1.0 values gets skipped. That's because when 
you resize the list as you walk over it, the value which *would have been* the 
next value gets pushed back into the current position, and then you advance to 
the next position, and skip it.

So there's no bug in list.count, it is working perfectly each time. There's no 
bug in iteration either, it is walking the list correctly too. But there is a 
bug in your code: you are shrinking the list while walking over it, so on each 
step, you delete one item from the from and step forward, so you skip items.

The lesson here is not to delete items from a list while you are iterating over 
it.

Technically, it's okay to delete items so long as they are *ahead* of the 
current item, but not if they are *behind* it. But it is easiest to just use 
the rule, never delete items while iterating over the same list.

If you must delete items from a list, iterate over a copy.

--
nosy: +steven.daprano
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



[issue40806] itertools.product not lazy

2020-05-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e4cc3a7c1f5ba9ea2c3015a5bf09cb5b93db5d47 by Miss Islington (bot) 
in branch '3.9':
bpo-40806: itertools.product immediately consumes its inputs (GH-20492) 
(GH-20498)
https://github.com/python/cpython/commit/e4cc3a7c1f5ba9ea2c3015a5bf09cb5b93db5d47


--

___
Python tracker 

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



[issue40806] itertools.product not lazy

2020-05-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Updated the docs to note that inputs are fully consumed before the iterator is 
run.

FYI, notes on infinite iterable inputs likely belong the FAQs because they 
aren't specific to product().  Similar effects would be seen with list(x(1)), 
sorted(x(1)), set(x(1)), tuple(x(1)), etc.

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



[issue40806] itertools.product not lazy

2020-05-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa by Ramil Nugmanov in 
branch 'master':
bpo-40806: Clarify that itertools.product immediately consumes its inpt 
(GH-20492)
https://github.com/python/cpython/commit/cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa


--

___
Python tracker 

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



[issue1294959] Add sys.platlibdir and configure --with-platlibdir to use /usr/lib64 on Fedora and SuSE

2020-05-28 Thread Michał Górny

Michał Górny  added the comment:

Thank you!

--

___
Python tracker 

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



[issue40801] Expose PyFloat_ToDouble at Python level: operator.as_float?

2020-05-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

On naming, maybe float.from_number or float.from_numeric?

--

___
Python tracker 

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



[issue40806] itertools.product not lazy

2020-05-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +19747
pull_request: https://github.com/python/cpython/pull/20498

___
Python tracker 

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



[issue40809] list.Count() isn't working as expected for the series of same numbers in a list

2020-05-28 Thread chirag maliwal


chirag maliwal  added the comment:

a = [0, 1, 2, 3, 4, 1, 2, 3, 5]

for i in a:
if a.count(i) > 1:
a.remove(i)

print(a)

"""
Output

[0, 4, 1, 2, 3, 5]
"""

It's working fine for the above code.
Yes I can use set for this but I tried with count and remove.

--

___
Python tracker 

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



[issue40801] Expose PyFloat_ToDouble at Python level: operator.as_float?

2020-05-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

> `operator` seems a slightly odd place for this.

Yes, it's not ideal. It's by analogy with operator.index, which provides the 
equivalent duck-typing for integers, and calls __index__.  Similarly, 
operator.as_float is primarily there to call __float__, except that now that 
PyFloat_AsDouble also makes use of __index__, it'll call that, too.

My other thought was putting this in math, since it's what the math module is 
already doing implicitly to most inputs.

An alternative float constructor could work. Though we then run into the messy 
question of what it should do for float subclasses ...

--

___
Python tracker 

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



[issue40777] _datetimemodule.c:3328:16: error: initializer element is not constant

2020-05-28 Thread miss-islington


miss-islington  added the comment:


New changeset eceee544de4b0f885729022c135c53291b6bbb23 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time 
(GH-20493) (GH-20495)
https://github.com/python/cpython/commit/eceee544de4b0f885729022c135c53291b6bbb23


--

___
Python tracker 

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



[issue1294959] Add sys.platlibdir and configure --with-platlibdir to use /usr/lib64 on Fedora and SuSE

2020-05-28 Thread miss-islington


miss-islington  added the comment:


New changeset a5936ad6323b2cda712726a25d9301f766146cff by Miss Islington (bot) 
in branch '3.9':
bpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)
https://github.com/python/cpython/commit/a5936ad6323b2cda712726a25d9301f766146cff


--

___
Python tracker 

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



[issue40809] list.Count() isn't working as expected for the series of same numbers in a list

2020-05-28 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi cmaliwal! You are mutating the list while iterating over it which can lead 
to all sorts of issues, to keep the unique elements of a list you can do 


>>> a = [1, 1, 1, 1]
>>> list(set(a))
[1]


If you think you found a bug in Python please check in the python-help mailing 
list or StackOverflow.

--
nosy: +remi.lapeyre
title: list.count() isn't working as expected for the series of same numbers in 
a list -> list.Count() isn't working as expected for the series of same numbers 
in a list

___
Python tracker 

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



[issue40809] list.count() isn't working as expected for the series of same numbers in a list

2020-05-28 Thread chirag maliwal


Change by chirag maliwal :


--
title: list.Count() isn't working as expected for the series of same numbers in 
a list -> list.count() isn't working as expected for the series of same numbers 
in a list

___
Python tracker 

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2020-05-28 Thread miss-islington


miss-islington  added the comment:


New changeset 6a478641c00e5a52be9d595ad804bf848a498d96 by Miss Islington (bot) 
in branch '3.9':
bpo-37878: PyThreadState_DeleteCurrent() was not removed (GH-20489)
https://github.com/python/cpython/commit/6a478641c00e5a52be9d595ad804bf848a498d96


--

___
Python tracker 

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



[issue40809] list.Count() isn't working as expected for the series of same numbers in a list

2020-05-28 Thread chirag maliwal


New submission from chirag maliwal :

a = [1,1,1,1]

for i in a:
if a.count(i) > 1:
a.remove(i)
 
print(a)


"""
Output:
[1,1]


expected:
[1]
"""

--
files: test.py
messages: 370239
nosy: cmaliwal
priority: normal
severity: normal
status: open
title: list.Count() isn't working as expected for the series of same numbers in 
a list
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file49200/test.py

___
Python tracker 

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



[issue1294959] Add sys.platlibdir and configure --with-platlibdir to use /usr/lib64 on Fedora and SuSE

2020-05-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 242d95659b6b4ff4fb54b58a30454dafa311d4e9 by Michał Górny in 
branch 'master':
bpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)
https://github.com/python/cpython/commit/242d95659b6b4ff4fb54b58a30454dafa311d4e9


--

___
Python tracker 

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



[issue1294959] Add sys.platlibdir and configure --with-platlibdir to use /usr/lib64 on Fedora and SuSE

2020-05-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19746
pull_request: https://github.com/python/cpython/pull/20497

___
Python tracker 

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2020-05-28 Thread STINNER Victor


STINNER Victor  added the comment:

I was very confused by the history of this issue. To be clear, 
PyThreadState_DeleteCurrent() is now documented in Python 3.9:
https://docs.python.org/dev/c-api/init.html#c.PyThreadState_DeleteCurrent

--

___
Python tracker 

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2020-05-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fda7f6d61b13c68f59806db674e892fda4013348 by Victor Stinner in 
branch 'master':
bpo-37878: PyThreadState_DeleteCurrent() was not removed (GH-20489)
https://github.com/python/cpython/commit/fda7f6d61b13c68f59806db674e892fda4013348


--

___
Python tracker 

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2020-05-28 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40777] _datetimemodule.c:3328:16: error: initializer element is not constant

2020-05-28 Thread miss-islington


miss-islington  added the comment:


New changeset 459acc551656785bc4a3363d65c7a60f822da8e3 by Petr Viktorin in 
branch 'master':
bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time 
(GH-20493)
https://github.com/python/cpython/commit/459acc551656785bc4a3363d65c7a60f822da8e3


--
nosy: +miss-islington

___
Python tracker 

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



[issue40777] _datetimemodule.c:3328:16: error: initializer element is not constant

2020-05-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19744
pull_request: https://github.com/python/cpython/pull/20495

___
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-28 Thread Fantix King


Fantix King  added the comment:

Thanks for the comments! Added PR 20494 to properly fix/skip the test for 
(hopefully) all platforms.

--

___
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-28 Thread Fantix King


Change by Fantix King :


--
pull_requests: +19743
pull_request: https://github.com/python/cpython/pull/20494

___
Python tracker 

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



[issue40801] Expose PyFloat_ToDouble at Python level: operator.as_float?

2020-05-28 Thread Zachary Ware


Zachary Ware  added the comment:

`operator` seems a slightly odd place for this.  My naive expectation would be 
that `float(floatlike_obj)` should do what you want, but it seems that's not 
the case (too permissive of input types?).  So then, what about an alternate 
constructor on the float object, `float.from_floatlike(obj)`?  This could be 
implemented as effectively:

class float:
@classmethod
def from_floatlike(cls, obj):
return cls(PyFloat_FromDouble(PyFloat_AsDouble(obj)))

which would work to get an instance of any float subclass after a round-trip 
through a double.  I have no idea whether that's actually useful, though :)

--
nosy: +zach.ware

___
Python tracker 

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



[issue40777] _datetimemodule.c:3328:16: error: initializer element is not constant

2020-05-28 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

There will still be a lot of code written that way, because people need 
compatibility with earlier versions of Python. So I think it should be fixed in 
get_type_hints().

--

___
Python tracker 

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



[issue40777] _datetimemodule.c:3328:16: error: initializer element is not constant

2020-05-28 Thread Petr Viktorin


Change by Petr Viktorin :


--
keywords: +patch
nosy: +petr.viktorin
nosy_count: 1.0 -> 2.0
pull_requests: +19742
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20493

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2020-05-28 Thread Petr Viktorin


Petr Viktorin  added the comment:

This broke compilation with mingw; see https://bugs.python.org/issue40777

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue40806] itertools.product not lazy

2020-05-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue40755] Add missing multiset predicates to collections.Counter

2020-05-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I would also have preferred to use the operators <, >, <=, >=, and ==.  The 
docs in the patch explain why we can't go down this path.

Also, while counters have support for multiset operations, they continue to 
support other use cases a well (negative counts and fractional counts). That 
support can't be removed without breaking existing code that relies on it.

>From the outset, a Counter was just a dictionary that return 0 for missing 
>keys.  Users are free to use that concept however they want.

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



[issue25920] PyOS_AfterFork should reset socketmodule's lock

2020-05-28 Thread STINNER Victor


STINNER Victor  added the comment:

If I understood correctly, Python 3.8 and 3.9 binaries provided by python.org 
is *not* impacted by this issue.

Only Python binaries built manually with explicit support for macOS 10.4 
("MAC_OS_X_VERSION_MIN_REQUIRED") were impacted.

Python 3.9 and older are not fixed (keep the lock). The workaround is to 
require macOS 10.5 or newer. macOS 10.4 was released in 2004, it's maybe time 
to stop support it :-)

Python 3.7 (and newer) requires macOS 10.6 or newer (again, I'm talking about 
binaries provided by python.org).


> bpo-25920: Remove socket.getaddrinfo() lock on macOS (GH-20177)

I chose to leave the lock for gethostbyname(). Ronald wrote that this lock is 
no longer needed:
"As an aside (not to be addressed in the PR): Apparently gethostbyname() and 
related functions are thread-safe on macOS. This is according to the manpage on 
macOS 10.15. I haven't checked in which version that changed. This allows 
avoiding the use of the gethostbyname lock as well."
https://github.com/python/cpython/pull/20177#pullrequestreview-418909595

Please open a separated issue for this lock.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue40755] Add missing multiset predicates to collections.Counter

2020-05-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 60398512c86c5535edd817c99ccb50453b3b0471 by Raymond Hettinger in 
branch 'master':
bpo-40755: Add missing multiset operations to Counter() (GH-20339)
https://github.com/python/cpython/commit/60398512c86c5535edd817c99ccb50453b3b0471


--

___
Python tracker 

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



[issue40806] itertools.product not lazy

2020-05-28 Thread Ramil Nugmanov


Change by Ramil Nugmanov :


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

___
Python tracker 

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



[issue25920] PyOS_AfterFork should reset socketmodule's lock

2020-05-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0de437de6210c2b32b09d6c47a805b23d023bd59 by Victor Stinner in 
branch 'master':
bpo-25920: Remove socket.getaddrinfo() lock on macOS (GH-20177)
https://github.com/python/cpython/commit/0de437de6210c2b32b09d6c47a805b23d023bd59


--

___
Python tracker 

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



[issue40770] RFE: Run linkchecker on documentation on the CI

2020-05-28 Thread Andy Lester


Andy Lester  added the comment:

Some high-level questions to consider:

* Is it run only when a build of the docs is started?  Or should it be done 
regularly (daily/weekly?) to keep an eye on links so that it's not a surprise 
when build time comes along?

* Does a broken link stop the build, or is it just advisory?

* Who sees the results?  Are they emailed to someone?  A mailing list?  Posted 
somewhere publicly?

* Is someone assigned responsibility for acting on the failures?

* What counts as a failure?  Is a 301 redirect OK?  It seems that a 301 might 
be OK to pass, but someone should know about it to update to the new URL.

I am not familiar with the current documentation build process, so forgive me 
if these are already answered somehow.  I'm not looking for answers myself, but 
providing suggestions.

--

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


miss-islington  added the comment:


New changeset bcbe5c59dde5fcb9ad21991c2afd91837b14bbd5 by Miss Islington (bot) 
in branch '3.9':
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/bcbe5c59dde5fcb9ad21991c2afd91837b14bbd5


--

___
Python tracker 

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



[issue40700] Make WSGIRequestHandler easier to be customized by the user

2020-05-28 Thread Manjusaka


Manjusaka  added the comment:

ping~

--

___
Python tracker 

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



[issue38488] Update bundled pip to 19.3

2020-05-28 Thread Xavier Fernandez


Change by Xavier Fernandez :


--
pull_requests: +19740
pull_request: https://github.com/python/cpython/pull/20491

___
Python tracker 

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



[issue40799] Create Lib/_pydatetime.py file to optimize "import datetime" when _datetime is available

2020-05-28 Thread STINNER Victor


STINNER Victor  added the comment:

> I believe that there are other modules that have similar situations like 
> heapq, but datetime is probably the worst offender.

heapq seems to be a little bit different. _heapq is not a drop-in replacement 
of heapq.py. For example, nlargest() seems to only be implemented in pure 
Python.


> I am inclined to say that we should restructure datetime into a folder, 
> containing __init__.py, _datetime.py and possibly _strptime.py (which I think 
> is also only used in datetime), but I think that sort of restructuring is way 
> more sensitive to weird import bugs than this one.

I have no idea what are the side effects of converting datetime.py file into a 
package.

A single file _pydatetime.py seems more convenient to me. I'm aware of 
_strptime.py but I don't see it as a datetime submodule and I don't see the 
value of moving it as a datetime submodule.

I'm fine with _datetime accessing _strptime module. It sounds more complex to 
me if _datetime would be imported by datetime which contains 
datetime._strptime. I see a higher risk of subtle import issues, since datetime 
has two implementations (C and Python). But it may be wrong :-)

Also, all other stdlib modules which have a C implementation are designed with 
files, not folders: io.py (_io and _pyio) and decimal.py (_decimal and 
_pydecimal) are good examples.

I mostly case about reducing the number of indirect imports and import 
performance. I don't have a strong opinion about file vs folder.


> As it is now, I would be shocked if this didn't break *someone*, because 
> people are always relying on weird implementation details (knowingly or 
> unknowingly), but I think it's worth doing; it's good to tackle it this early 
> in the cycle.

I'm fine with breaking applications relying on implementation details. Also, we 
can adjust the code to fix such corner cases later if it's needed, possible and 
justified :-)

--

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


Change by miss-islington :


--
pull_requests: +19739
pull_request: https://github.com/python/cpython/pull/20490

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

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



[issue40799] Create Lib/_pydatetime.py file to optimize "import datetime" when _datetime is available

2020-05-28 Thread Paul Ganssle

Paul Ganssle  added the comment:

I basically agree with this — this is one of the reasons I structured the 
zoneinfo module the way I did rather than mimicking the pattern in datetime.

I believe that there are other modules that have similar situations like heapq, 
but datetime is probably the worst offender.

I am inclined to say that we should restructure datetime into a folder, 
containing __init__.py, _datetime.py and possibly _strptime.py (which I think 
is also only used in datetime), but I think that sort of restructuring is way 
more sensitive to weird import bugs than this one.

As it is now, I would be shocked if this didn't break *someone*, because people 
are always relying on weird implementation details (knowingly or unknowingly), 
but I think it's worth doing; it's good to tackle it this early in the cycle.

@vstinner What do you think about restructuring into a folder-based submodule 
rather than _pydatetime.py? It's way more likely to break someone, but I think 
it might be the better way to organize the code, and I don't want to have to go 
through *two* refactors of this sort.

--

___
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-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 753643205a28531fd43ef36b40b86282ae6956a7 by Victor Stinner in 
branch 'master':
bpo-40275: Fix test.support.threading_helper (GH-20488)
https://github.com/python/cpython/commit/753643205a28531fd43ef36b40b86282ae6956a7


--

___
Python tracker 

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2020-05-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19738
pull_request: https://github.com/python/cpython/pull/20489

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-28 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

An example would be this 
https://github.com/python/cpython/blob/24bddc1b3b58f6899b2d412e51b37f68536e4fe2/Lib/test/test_typing.py#L2744-L2745.
 Either I can change tests in order to reflect now everything is a forward ref 
by default
class Loop:
attr: Final['Loop']
to
class Loop:
attr: Final[Loop]
or resolve everything on get_type_hints.

--

___
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-28 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)

Sorry. You should read "Skip" tests, not "Fix" tests :-p

--

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


miss-islington  added the comment:


New changeset 1d82f003678816ff8dd822452ec91669844d2d09 by Miss Islington (bot) 
in branch '3.9':
bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)
https://github.com/python/cpython/commit/1d82f003678816ff8dd822452ec91669844d2d09


--

___
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-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 24bddc1b3b58f6899b2d412e51b37f68536e4fe2 by Hai Shi in branch 
'master':
 bpo-40275: Remove test.support.TESTFN_ENCODING (GH-20482)
https://github.com/python/cpython/commit/24bddc1b3b58f6899b2d412e51b37f68536e4fe2


--

___
Python tracker 

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



[issue40799] Create Lib/_pydatetime.py file to optimize "import datetime" when _datetime is available

2020-05-28 Thread STINNER Victor


STINNER Victor  added the comment:

> What do decimals have to datetime?

Oops. Sorry, I was confused between "datetime" and "decimal" when I created 
this issue. I fixed the issue title.

My idea is to mimick Lib/decimal.py design for Lib/datetime.py.

--

___
Python tracker 

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



[issue40799] Create Lib/_pydatetime.py file to optimize "import datetime" when _datetime is available

2020-05-28 Thread STINNER Victor


Change by STINNER Victor :


--
title: Create Lib/_pydecimal.py file to optimize "import datetime" when 
_decimal is available -> Create Lib/_pydatetime.py file to optimize "import 
datetime" when _datetime is available

___
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-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19737
pull_request: https://github.com/python/cpython/pull/20488

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


Change by miss-islington :


--
pull_requests: +19736
pull_request: https://github.com/python/cpython/pull/20487

___
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-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 84ee7e1573d166fe7a9be676813e12523b62ab24 by Victor Stinner in 
branch 'master':
bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)
https://github.com/python/cpython/commit/84ee7e1573d166fe7a9be676813e12523b62ab24


--

___
Python tracker 

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



[issue38488] Update bundled pip to 19.3

2020-05-28 Thread Florian Bruhin


Change by Florian Bruhin :


--
nosy: +The Compiler

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think in general it is more insightful to discuss the behavior of 
get_type_hints() given specific things in annotations.

We generally don't write forward refs inside forward refs, like 
"SomeClass['int']". So maybe that code was wrong? Where did you find it?

--

___
Python tracker 

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



[issue38488] Update bundled pip to 19.3

2020-05-28 Thread STINNER Victor


STINNER Victor  added the comment:

The change broke multiple buildbots. Since nobody is available to investigate 
the two regressions (install buildbots and test_venv), I reverted the change 
following this policy:
https://pythondev.readthedocs.io/ci.html#revert-on-fail

Buildbot failures were reported directly the on PR, see:
https://github.com/python/cpython/pull/16782#issuecomment-634640005

The revert is an opportunity to have more time to investigate the issue and 
write a proper fix, rather than working on urgency.

commit 4fd4963ccce5c12f742303dab6e43818b1133c7e (HEAD -> master, 
upstream/master)
Author: Victor Stinner 
Date:   Thu May 28 15:57:49 2020 +0200

Revert "Upgrade bundled versions of pip & setuptools (#16782)" (GH-20484)

This reverts commit feb0846c3a28b05b4cfbc6ab34c764957f3eff55.

--

___
Python tracker 

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



[issue8087] Unupdated source file in traceback

2020-05-28 Thread Robert Reynolds


Robert Reynolds  added the comment:

A pure python demonstration of the problem looks like this (`__file__` stores 
the path to the executed module):

```python
with open(__file__) as f:
src = f.read()
with open(__file__, 'w') as f:
f.write('\n\n\n\n\n# Whoops! Wrong line!\n')
f.write(src)
raise NotImplementedError('The prepended lines have confused you.')
```

--
nosy: +Robert Reynolds

___
Python tracker 

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



[issue37824] IDLE: Handle Shell input warnings properly.

2020-05-28 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thanks, Terry.  I created issue40807 for the codeop warnings.

--

___
Python tracker 

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



[issue40807] CODEOP: Show warnings once during _maybe_compile

2020-05-28 Thread Cheryl Sabella


New submission from Cheryl Sabella :

When calling `codeop._maybe_compile`, `compile` is run three times.  If the 
code being compiled causes a warning message, the warning is generated each 
time that `compile` is called, thus (possibly) showing the message three times.


See msg370163 and that issue for context.

--
components: Library (Lib)
messages: 370208
nosy: cheryl.sabella
priority: normal
severity: normal
status: open
title: CODEOP: Show warnings once during _maybe_compile
type: enhancement
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



  1   2   >