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

2020-05-24 Thread Eric L.


Eric L.  added the comment:

On 24/05/2020 20:30, Serhiy Storchaka wrote:
> Maybe just document that tempdir should be a string?
I would definitely prefer to have bytes paths considered as 1st class
citizen.

--

___
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-24 Thread Sidhant Bansal


Sidhant Bansal  added the comment:

The following code
```
import csv
with open("abc.csv", "w") as f:
   data = [b'\xc2a9', b'\xc2a9']
   w = csv.writer(f)
   w.writerow(data)
```
writes "b'\xc2a9',b'\xc2a9'" in "abc.csv", i.e the b-prefixed byte string 
instead of the actual bytes. 

Although one can argue that the write is done in text mode and not binary mode, 
however I believe the more natural expectation by the user will be to have the 
bytes written actually in the "abc.csv". Also take note that writing in binary 
mode is not supported by csv, so the only method to write bytes is this.

Can refer to this https://github.com/pandas-dev/pandas/issues/9712 to see one 
of the issues this brings in Pandas. From the discussion on this issue, the 
main reasons of changing this behaviour in Python would be to avoid leaking 
python's encoding system syntax into a generic data exchange format, i.e CSV.

--

___
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-24 Thread Sidhant Bansal


New submission from Sidhant Bansal :

The following code
```
import csv
with open("abc.csv", "w") as f:
   data = [b'\xc2a9', b'\xc2a9']
   w = csv.writer(f)
   w.writerow(data)
```
writes "b'\xc2a9',b'\xc2a9'" in "abc.csv", i.e the b-prefixed byte string 
instead of the actual bytes. 

Although one can argue that the write is done in text mode and not binary mode, 
however I believe the more natural expectation by the user will be to have the 
bytes written actually in the "abc.csv".

Can refer to this https://github.com/pandas-dev/pandas/issues/9712 to see one 
of the issues this brings in Pandas. From the discussion on this issue, the 
main reasons of changing this behaviour in Python would be to avoid leaking 
python's encoding system syntax into a generic data exchange format, i.e CSV.

--
components: Library (Lib)
messages: 369848
nosy: sidhant
priority: normal
severity: normal
status: open
title: Writing bytes using CSV module results in b prefixed strings
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



[issue40761] unittest.TestCase.asserTrue return True even if the expr is False

2020-05-24 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Works for me in 3.7. See attached file. Can you provide a minimal piece of code 
that demonstrates the bug?

Since Python 3.5 is now only accepting security fixes, and numpy is a 
third-party library, unless you can demonstrate this in a more recent version I 
think we should close this as "Works For Me".

--

___
Python tracker 

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



[issue40761] unittest.TestCase.asserTrue return True even if the expr is False

2020-05-24 Thread Steven D'Aprano


Change by Steven D'Aprano :


Added file: https://bugs.python.org/file49192/test_asserttrue.py

___
Python tracker 

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



[issue40761] unittest.TestCase.asserTrue return True even if the expr is False

2020-05-24 Thread Steven D'Aprano


Change by Steven D'Aprano :


Removed file: https://bugs.python.org/file49191/test_asserttrue.py

___
Python tracker 

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



[issue40761] unittest.TestCase.asserTrue return True even if the expr is False

2020-05-24 Thread Steven D'Aprano


Change by Steven D'Aprano :


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

___
Python tracker 

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



[issue40761] unittest.TestCase.asserTrue return True even if the expr is False

2020-05-24 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Works for me in Python 3.7. See attached file.

Given that Python 3.5 is only longer accepting security fixes, and that numpy 
is a third-party library, unless you can reproduce this in a more recent 
version I think we should close this.

--
nosy: +steven.daprano
Added file: https://bugs.python.org/file49191/test_asserttrue.py

___
Python tracker 

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



[issue40328] Add tools for generating mappings_XX.h

2020-05-24 Thread Dong-hee Na


Dong-hee Na  added the comment:

> Would you close this issue?

mappings_hk.h mappings_tw.h are still left :)

--

___
Python tracker 

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



[issue40328] Add tools for generating mappings_XX.h

2020-05-24 Thread Inada Naoki


Inada Naoki  added the comment:

Would you close this issue?

--

___
Python tracker 

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



[issue40761] unittest.TestCase.asserTrue return True even if the expr is False

2020-05-24 Thread lee yummy


New submission from lee yummy :

self.assertTrue(np.array_equal(x, y), "") # x.shape is [58, 139]

np.array_equal(x, y) is False, but `self.assertTrue(np.array_equal(x, y), "")` 
doesn't raise error.

--
components: Tests
messages: 369843
nosy: lee yummy
priority: normal
severity: normal
status: open
title: unittest.TestCase.asserTrue return True even if the expr is False
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue40373] urlunparse does not escape slash (/) for http+unix:// in netloc field

2020-05-24 Thread Ido Michael


Change by Ido Michael :


--
nosy: +taleinat

___
Python tracker 

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



[issue40373] urlunparse does not escape slash (/) for http+unix:// in netloc field

2020-05-24 Thread Ido Michael


Ido Michael  added the comment:

Did you try using the urllib.urlencode() function? 
Also it's not clear to me what happens if you give the expected string to 
urlunsplit() ? I believe it will keep the format as is, str or URL encoded.

Tal what do you think?

--
nosy: +Ido Michael

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


Change by Fantix King :


--
pull_requests: +19633
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20369

___
Python tracker 

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



[issue38580] select()'s documentation claims only sequences are accepted, but it allows all iterables

2020-05-24 Thread Ido Michael


Ido Michael  added the comment:

Hey Tal, I see this issue is pending and pretty much done, what else there's to 
fix here?

--
nosy: +Ido Michael

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset 82c274e3ba7d011e93805f1552e90baea1752cf1 by Miss Islington (bot) 
in branch '3.9':
bpo-40334: Support suppressing of multiple optional variables in Pegen 
(GH-20367)
https://github.com/python/cpython/commit/82c274e3ba7d011e93805f1552e90baea1752cf1


--

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-05-24 Thread Ido Michael


Ido Michael  added the comment:

Fixed Tal's comments, I took the darwin if check out of the 
reduction.HAVE_SEND_HANDLE, also fixed the test

--

___
Python tracker 

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



[issue23082] pathlib relative_to() can give confusing error message

2020-05-24 Thread Ido Michael


Ido Michael  added the comment:

Hey looks like this PR is good to go?

--
nosy: +Ido Michael

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-24 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset cba503151056b448b7a3730dc36ef660ade5 by Batuhan Taskaya in 
branch 'master':
bpo-40334: Support suppressing of multiple optional variables in Pegen 
(GH-20367)
https://github.com/python/cpython/commit/cba503151056b448b7a3730dc36ef660ade5


--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19632
pull_request: https://github.com/python/cpython/pull/20368

___
Python tracker 

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



[issue40760] Dictionary comprehension using older division behavior

2020-05-24 Thread Amol Sharma


Amol Sharma  added the comment:

My apologies! I didn't realize I was in a different environment which was 
actually 2.7.

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



[issue24464] "sqlite3_enable_shared_cache" deprecation warning when compiling with macOS system SQLite3

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



[issue40760] Dictionary comprehension using older division behavior

2020-05-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

That's not what I see:

$ python3.8
Python 3.8.0b4 (default, Sep 15 2019, 15:56:44)
[GCC 7.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> some_dict = {3:4}
>>> {k: v/5 for k, v in some_dict.items()}
{3: 0.8}
>>>

Granted, this is a beta of 3.8 on cygwin, so maybe it's an outlier.

Can you show us a similar interactive session so we can see exactly what 
platform you're on, and what results you're seeing?

--
nosy: +eric.smith

___
Python tracker 

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



[issue16379] SQLite error code not exposed to python

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



[issue39170] Sqlite3 row_factory for attribute access: NamedRow

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



[issue40334] PEP 617: new PEG-based parser

2020-05-24 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +19631
pull_request: https://github.com/python/cpython/pull/20367

___
Python tracker 

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



[issue40617] sqlite3: expose sqlite3_create_window_function

2020-05-24 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Please see attached patch, @iljau.

--
keywords: +patch
Added file: 
https://bugs.python.org/file49190/0001-Add-support-for-sqlite3-aggregate-window-functions.patch

___
Python tracker 

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



[issue40617] sqlite3: expose sqlite3_create_window_function

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



[issue40760] Dictionary comprehension using older division behavior

2020-05-24 Thread Amol Sharma


New submission from Amol Sharma :

Using comprehension to divide all the values in a dictionary like in the 
following results in integer division in 3.8.

some_dict = {k: v/5 for k, v in some_dict.items()}

This was solved by changing 5 to 5.0, reflecting behavior from python2. I would 
have expected to have the use the // operator for integer division.

Please correct me if this is expected behavior!

--
messages: 369833
nosy: Amol Sharma
priority: normal
severity: normal
status: open
title: Dictionary comprehension using older division behavior
versions: Python 3.8

___
Python tracker 

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



[issue36290] _ast.ast_type_init does not handle args and kwargs correctly.

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset 1a4e9e6f35dad26b37639198f1444591d04399e0 by Miss Islington (bot) 
in branch '3.9':
bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)
https://github.com/python/cpython/commit/1a4e9e6f35dad26b37639198f1444591d04399e0


--

___
Python tracker 

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



[issue17050] argparse.REMAINDER doesn't work as first argument

2020-05-24 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue17050] argparse.REMAINDER doesn't work as first argument

2020-05-24 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 46c1b9c7b595cd9244020ff74ff9cb11bec9870c by Miss Islington (bot) 
in branch '3.9':
bpo-17050: Remove documentation on argparse.REMAINDER (GH-18661) (GH-20363)
https://github.com/python/cpython/commit/46c1b9c7b595cd9244020ff74ff9cb11bec9870c


--

___
Python tracker 

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



[issue36290] _ast.ast_type_init does not handle args and kwargs correctly.

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset 907ee1f14aaf587683ced44818c5a1d1cabf4174 by Miss Islington (bot) 
in branch '3.8':
bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)
https://github.com/python/cpython/commit/907ee1f14aaf587683ced44818c5a1d1cabf4174


--

___
Python tracker 

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



[issue36290] _ast.ast_type_init does not handle args and kwargs correctly.

2020-05-24 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue36290] _ast.ast_type_init does not handle args and kwargs correctly.

2020-05-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19630
pull_request: https://github.com/python/cpython/pull/20366

___
Python tracker 

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



[issue36290] _ast.ast_type_init does not handle args and kwargs correctly.

2020-05-24 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset c73914a562580ae72048876cb42ed8e76e2c83f9 by Rémi Lapeyre in 
branch 'master':
bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)
https://github.com/python/cpython/commit/c73914a562580ae72048876cb42ed8e76e2c83f9


--
nosy: +pablogsal

___
Python tracker 

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



[issue36290] _ast.ast_type_init does not handle args and kwargs correctly.

2020-05-24 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40617] sqlite3: expose sqlite3_create_window_function

2020-05-24 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

On a second thought and with regards to error reporting, it _would_ make sense 
to expose this as a function instead of embedding it into 
sqlite3.create_aggregate.

--

___
Python tracker 

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



[issue40759] Deprecate the symbol module

2020-05-24 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue40748] Tutorial 4.7 More on Defining Functions missing screen prompts

2020-05-24 Thread Chas Belov


Chas Belov  added the comment:

I created new issue For 7.2.7. Code Examples, distinguish between the Tutorial 
and other documentation https://bugs.python.org/issue40758

--

___
Python tracker 

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



[issue40759] Deprecate the symbol module

2020-05-24 Thread Batuhan Taskaya

New submission from Batuhan Taskaya :

Parser is deprecated so there is no need for the 'symbol' module. I think this 
should be backported to 3.9, so I'm CC-ing @Łukasz.

--
components: Library (Lib)
messages: 369826
nosy: BTaskaya, lukasz.langa
priority: normal
severity: normal
status: open
title: Deprecate the symbol module
versions: Python 3.9

___
Python tracker 

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



[issue40758] For 7.2.7. Code Examples, distinguish between the Tutorial and other documentation

2020-05-24 Thread Chas Belov


New submission from Chas Belov :

7.2.7. Code Examples https://devguide.python.org/documenting/#code-examples 
states:

Short code examples can be a useful adjunct to understanding. Readers can often 
grasp a simple example more quickly than they can digest a formal description 
in prose.

[snip]

The ellipsis for the sys.ps2 secondary interpreter prompt should only be used 
sparingly, where it is necessary to clearly differentiate between input lines 
and output lines. Besides contributing visual clutter, it makes it difficult 
for readers to cut-and-paste examples so they can experiment with variations.

-

I am requesting, as a newcomer to Python who is attempting to navigate the 
Tutorials and encountering challenges, that this be reworded to something like:

Short code examples can be a useful adjunct to understanding. Readers can often 
grasp a simple example more quickly than they can digest a formal description 
in prose.

[snip]

Outside of the Tutorial, the ellipsis for the sys.ps2 secondary interpreter 
prompt should only be used sparingly, where it is necessary to clearly 
differentiate between input lines and output lines. Besides contributing visual 
clutter, it makes it difficult for readers to cut-and-paste examples so they 
can experiment with variations.

Within the Tutorial, however, make the appearance of code blocks as consistent 
with what the student will be experiencing as feasible, to reduce cognitive 
load and allow them to focus on the content.

-

While I can in fact suss out whether a particular unmarked code block is meant 
to be input or output, it is a distraction that uses up some of my attention 
that I would prefer to spend on learning the language.

--
messages: 369825
nosy: Chas Belov
priority: normal
severity: normal
status: open
title: For 7.2.7. Code Examples, distinguish between the Tutorial and other 
documentation
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



[issue40758] For 7.2.7. Code Examples, distinguish between the Tutorial and other documentation

2020-05-24 Thread Chas Belov


Change by Chas Belov :


--
versions: +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



[issue40748] Tutorial 4.7 More on Defining Functions missing screen prompts

2020-05-24 Thread Chas Belov


Chas Belov  added the comment:

Actually, after reviewing the documentation standards, I will hold off my pull 
request on this issue and raise the cited section of documentation as a 
separate issue.

--

___
Python tracker 

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



[issue40748] Tutorial 4.7 More on Defining Functions missing screen prompts

2020-05-24 Thread Chas Belov


Chas Belov  added the comment:

@Ama Aje My Fren, thank you for the advice re backporting.

As to your points on ..., both good points, and thank you for introducing me to 
the Documenting Python document, which I will review. While technically the 
Tutorial is indeed part of Python's documentation, I would argue that the 
Tutorial is not a place for shorthand. Learning a new language is hard enough 
without having to also struggle with inconsistencies in the tutorial interface.

My intent with this issue and my (upcoming) pull request is to make the 
mentioned code blocks consistent with the rest of the page and, indeed, with 
most of the rest of the tutorial. Most of the tutorial does show >>> and ... at 
the beginning of each line where the learner would see a prompt. If we are to 
avoid ... so that learners can copy and paste multiple lines, then why would we 
not do that through the entire tutorial?

I'm guessing your point is that we only need to show >>> and ... when there 
will be print output so that we need to distinguish between what is input and 
what is output. As someone who is currently learning Python, however, 
consistency in presentation is important to me and reduces cognitive load.

There are other places in the tutorial where code blocks were used for things 
which are not typed in, or are not typed without other text. Showing >>> and 
... for all verbatim input makes it unambiguous as to whether something is to 
be typed in.

I'll leave it to psychologists as to whether having to type or copy and paste 
one line at a time leads to better learning. 

By REPL, do you mean Read-Eval-Print Loop? I'm not familiar with the acronym 
and that's what Google is telling me it means. But a Read-Eval-Print Loop would 
have output, and my understanding is that you are arguing against use of ... 
when there is no output.

--

___
Python tracker 

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



[issue40617] sqlite3: expose sqlite3_create_window_function

2020-05-24 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

This is a good idea, but I think the Python interface should stay the same.

>From the user perspective, you'd only need to implement the 'value' and 
>'inverse' callbacks to transform your aggregate class into an aggregate window 
>class.

>From the CPython perspective, we'd only need to use 
>sqlite3_create_window_function() instead of sqlite3_create_function_v2(), if 
>we are compiling against SQLite 3.25.3 or newer.

I guess it would be nice to output a warning if the user aggregate class 
contains 'value' and 'inverse' callbacks, but sqlite3 _doesn't_ support 
aggregate window functions.

--
nosy: +erlendaasland

___
Python tracker 

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



[issue40344] Programming FAQ about "What is the most efficient way to concatenate many strings together?" -- Improving the example

2020-05-24 Thread Andy Lester


Andy Lester  added the comment:

I'd also like to suggest that the question not be "most efficient" but 
"fastest".  I don't think it should treat "efficient" and "fast" as synonyms. 
"Efficient" can mean things other than execution speed, such as memory usage, 
or programmer time.  Are there space/time considerations besides execution 
time?  What if the user has a huge list and wants to use as little new 
allocated RAM as possible?

I understand that it's immediately after the "How do I speed up my program?" 
question, and I think it's worth considering making the question more explicit 
what kind of efficiency we're talking about.

--

___
Python tracker 

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



[issue35883] Change invalid unicode characters to replacement characters in argv

2020-05-24 Thread Johannes Berg


Johannes Berg  added the comment:

I've also filed https://sourceware.org/bugzilla/show_bug.cgi?id=26034 for 
glibc, because that's where really the issues seems to be?

But perhaps python should be forgiving of glibc errors here.

--

___
Python tracker 

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



[issue35883] Change invalid unicode characters to replacement characters in argv

2020-05-24 Thread Johannes Berg


Johannes Berg  added the comment:

Like I said above, it could be argued that the bug is in glibc, and then

https://p.sipsolutions.net/6a4e9fce82dbbfa0.txt

could be used as a simple LD_PRELOAD wrapper to work around this, just to 
illustrate the problem from that side.


Arguably, that makes glibc in violation of RFC 3629, since it says:


3.  UTF-8 definition

[...]

   In UTF-8, characters from the U+..U+10 range (the UTF-16
   accessible range) are encoded using sequences of 1 to 4 octets.

[...]

  (hexadecimal)|  (binary)
   +-
    - 007F | 0xxx
    0080- 07FF | 110x 10xx
    0800-  | 1110 10xx 10xx
   0001 -0010  | 0xxx 10xx 10xx 10xx

[...]

   Implementations of the decoding algorithm above MUST protect against
   decoding invalid sequences.

[...]

Here's a simple test program:

https://p.sipsolutions.net/ac091b4ea4b7f742.txt

--

___
Python tracker 

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



[issue17050] argparse.REMAINDER doesn't work as first argument

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset 59f5022b5d3e5fcc60ac61cc256b627decf8ee68 by Albert in branch 
'master':
bpo-17050: Remove documentation on argparse.REMAINDER (GH-18661)
https://github.com/python/cpython/commit/59f5022b5d3e5fcc60ac61cc256b627decf8ee68


--
nosy: +miss-islington

___
Python tracker 

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



[issue17050] argparse.REMAINDER doesn't work as first argument

2020-05-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19627
pull_request: https://github.com/python/cpython/pull/20363

___
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-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Maybe just document that tempdir should be a string?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40756] Second argument of LoggerAdapter.__init__ should default to None

2020-05-24 Thread Arturo Escaip


Change by Arturo Escaip :


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

___
Python tracker 

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



[issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs

2020-05-24 Thread mxmlnkn


New submission from mxmlnkn :

Normally, when opening an existing non-TAR file, e.g., a file with random data, 
an exception is raised:

tarfile.open( "foo.txt" )

---
ReadError Traceback (most recent call last)
 in ()
> 1 f = tarfile.open( "notes.txt", ignore_zeros = False )

/usr/lib/python3.7/tarfile.py in open(cls, name, mode, fileobj, bufsize, 
**kwargs)
   1576 fileobj.seek(saved_pos)
   1577 continue
-> 1578 raise ReadError("file could not be opened successfully")
   1579 
   1580 elif ":" in mode:

ReadError: file could not be opened successfully

However, when specifying ignore_zeros = True, this check against invalid data 
seems to be turned off. Note that it is >invalid< data not >zero< data and 
therefore should still raise an exception!

tarfile.open( "foo.txt", ignore_zeros = True )

Iterating over that opened tarfile also works without exception however nothing 
will be iterated over, i.e., it behaves like an empty TAR instead of like an 
invalid TAR.

--
components: Library (Lib)
messages: 369816
nosy: mxmlnkn
priority: normal
severity: normal
status: open
title: tarfile: ignore_zeros = True won't raise exception even on invalid 
(non-zero) TARs
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue40756] Second argument of LoggerAdapter.__init__ should default to None

2020-05-24 Thread Arturo Escaip


New submission from Arturo Escaip :

The 'extra' argument is not always used by custom logger adapters. There
example:

class IndentAdapter(logging.LoggerAdapter):
def process(self, msg, kwargs):
indent = kwargs.pop(indent, 1)
return ' ' * indent + msg, kwargs

It is cleaner and friendlier to default the 'extra' argument to None
instead of either forcing the subclasses of LoggerAdapter to pass a None
value directly or to override the constructor.

--
components: Library (Lib)
messages: 369815
nosy: arturoescaip
priority: normal
severity: normal
status: open
title: Second argument of LoggerAdapter.__init__ should default to None
type: enhancement

___
Python tracker 

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



[issue35883] Change invalid unicode characters to replacement characters in argv

2020-05-24 Thread Johannes Berg


Johannes Berg  added the comment:

And wrt. _Py_DecodeUTF8Ex() - it doesn't seem to help. But that's probably 
because I'm not __ANDROID__, nor __APPLE__, and then regardless of 
current_locale being non-zero or not, we end up in decode_current_locale() 
where the impedance mismatch happens.

Setting PYTHONUTF8=1 in the environment works too, in that case we do get into 
_Py_DecodeUTF8Ex().

--

___
Python tracker 

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



[issue35883] Change invalid unicode characters to replacement characters in argv

2020-05-24 Thread Johannes Berg


Johannes Berg  added the comment:

In fact that python one-liner works with just about everything else that you 
can throw at it, just not something that "looks like utf-8 but isn't".

And of course adding LC_CTYPE=ascii or something like that fixes it, as you'd 
expect. Then the "surrogateescape" works fine, since mbstowcs() won't try to 
decode it as utf-8.

--

___
Python tracker 

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



[issue35883] Change invalid unicode characters to replacement characters in argv

2020-05-24 Thread Johannes Berg


Johannes Berg  added the comment:

A simple test case is something like

  ./python -c 'import sys; 
print(sys.argv[1].encode(sys.getfilesystemencoding(), "surrogateescape"))' 
"$(echo -ne '\xfa\xbd\x83\x96\x80')"


Which you'd probably expect to print

  b'\xfa\xbd\x83\x96\x80'

i.e. the same bytes that were passed in, but currently that fails.

--
versions: +Python 3.10, Python 3.5, 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



[issue35883] Change invalid unicode characters to replacement characters in argv

2020-05-24 Thread Johannes Berg


Johannes Berg  added the comment:

Pretty sure this is an issue still, I see it on current git master.

This seems to work around it?

https://p.sipsolutions.net/603927f1537226b3.txt

Basically, it seems that mbstowcs() and mbrtowc() on glibc with utf-8 just 
blindly decode even invalid UTF-8 to a too large wchar_t, rather than failing.

--
nosy: +jberg

___
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-24 Thread Eric L.


Eric L.  added the comment:

On 23/05/2020 21:41, Gregory P. Smith wrote:
> Could you please turn that into a Github PR?
I can, if you don't tell me that I need to setup a full-blown Python
development environment to do this.

--

___
Python tracker 

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



[issue21724] resetwarnings doesn't reset warnings registry

2020-05-24 Thread Julian Berman


Julian Berman  added the comment:

Just ran into this myself -- not sure what the intended fix is (hopefully it's 
"add a function that restores the warnings configuration to its defaults?" 
Changing resetwarnings seems likely to be not doable I assume.)

But in the meanwhile, is a doc patch acceptable? The current documentation for 
resetwarnings is really deceptive, and makes it look like it does what @pitrou 
(and I) thought it did:

> Reset the warnings filter. This discards the effect of all previous calls to 
> filterwarnings(), including that of the -W command line options and calls to 
> simplefilter().

Compare to the docstring of the function (and to what it actually does):

> """Clear the list of warning filters, so that no filters are active."""

But there are still too many implementation details of the warnings module 
leaking through here -- for end users it's just "restore the warnings 
configuration to its defaults" (what it looks like resetwarnings should do) or 
"unfilter all warnings, even beyond the filters configured by default" (what it 
actually does).

Is at least making the docs reflect the latter a reasonable patch to submit, to 
start, while what to do about the former is thought about?

--
assignee:  -> docs@python
components: +Documentation
nosy: +Julian, docs@python
versions: +Python 3.10, 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



[issue40344] Programming FAQ about "What is the most efficient way to concatenate many strings together?" -- Improving the example

2020-05-24 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests:  -19625

___
Python tracker 

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



[issue40344] Programming FAQ about "What is the most efficient way to concatenate many strings together?" -- Improving the example

2020-05-24 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +19625
pull_request: https://github.com/python/cpython/pull/20360

___
Python tracker 

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



[issue40344] Programming FAQ about "What is the most efficient way to concatenate many strings together?" -- Improving the example

2020-05-24 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests:  -19624

___
Python tracker 

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



[issue40344] Programming FAQ about "What is the most efficient way to concatenate many strings together?" -- Improving the example

2020-05-24 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
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-24 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
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-24 Thread Raymond Hettinger


New submission from Raymond Hettinger :

These missing predicates have been requested a number of times:

   isequal()
   issubset()
   issuperset()
   isdisjoint()

--
assignee: rhettinger
components: Library (Lib)
messages: 369808
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Add missing multiset predicates to collections.Counter
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



[issue40443] Remove unused imports in the stdlib (April 2020 edition)

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset 4bb4cde1777267c92c1bfc0f537cee08102d66a4 by Miss Islington (bot) 
in branch '3.9':
bpo-40443: Remove unused imports in the zoneinfo (GH-20354)
https://github.com/python/cpython/commit/4bb4cde1777267c92c1bfc0f537cee08102d66a4


--

___
Python tracker 

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



[issue40705] use-after-free in _zoneinfo.c's module_free function

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset ebf650532b41f5e64a5620b8e47acc3a99555e14 by Miss Islington (bot) 
in branch '3.9':
bpo-40705: Fix use-after-free in _zoneinfo's module_free (GH-20280)
https://github.com/python/cpython/commit/ebf650532b41f5e64a5620b8e47acc3a99555e14


--

___
Python tracker 

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



[issue40443] Remove unused imports in the stdlib (April 2020 edition)

2020-05-24 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 3436f5f899f272d7164add072beb18eebd46d777 by Dong-hee Na in branch 
'master':
bpo-40443: Remove unused imports in the zoneinfo (GH-20354)
https://github.com/python/cpython/commit/3436f5f899f272d7164add072beb18eebd46d777


--

___
Python tracker 

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



[issue40443] Remove unused imports in the stdlib (April 2020 edition)

2020-05-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19622
pull_request: https://github.com/python/cpython/pull/20359

___
Python tracker 

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



[issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge

2020-05-24 Thread Albert Christianto


Albert Christianto  added the comment:

Sorry for my late response. 
Well, thank you very much for your fast response to help me. 
Actually, I have solved the problem in 3 hours after I posted my question. 
hehehe.
I found this tip about uncleaned files after executing "make clean" 
(https://bugs.python.org/msg346553). So, I decided to wipe out all python3.7 
files from my computer and repeat the installation process. It worked!!
Anyway, thank you again for your response and your tip. It really made my day 
like I am not alone while doing some python program debugging. (^v^)
best regards,
Albert Christianto

--

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +19621
pull_request: https://github.com/python/cpython/pull/20358

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset 21a9af193c35394f560d9517e7a4b579f40b8ef7 by Miss Islington (bot) 
in branch '3.9':
bpo-37309: Update IDLE NEWS.txt (GH-20356)
https://github.com/python/cpython/commit/21a9af193c35394f560d9517e7a4b579f40b8ef7


--

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19620
pull_request: https://github.com/python/cpython/pull/20357

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 16ef3241939a3a64a447e5d7aabaf2e29deca621 by Terry Jan Reedy in 
branch 'master':
bpo-37309: Update IDLE NEWS.txt (GH-20356)
https://github.com/python/cpython/commit/16ef3241939a3a64a447e5d7aabaf2e29deca621


--

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 1ae0fd87a072426e35ff84dc6d1b2759d9ebee70 by Terry Jan Reedy in 
branch '3.8':
[3.8] bpo-37309: Update IDLE NEWS.txt for 3.8.4 (GH-20355)
https://github.com/python/cpython/commit/1ae0fd87a072426e35ff84dc6d1b2759d9ebee70


--

___
Python tracker 

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



[issue40283] Documentation of turtle.circle()

2020-05-24 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

I tested it and can confirm the findings from @cajetan.rodrigues. However, this 
does not seem to be _not_ documented. The documentation clearly states that 
using a positive value for radius results in a counter-clockwise direction, 
whereas a negative number results in a clockwise direction. This is true.

Now, let's have a look at using radius _together_ with extent, which is not 
(clearly) documented as this point. Using a positive value results in the same 
direction, but in a not full drawn circle. This seems intuitive and is 
documented:

If extent is not given, draw the entire circle.
If extent is not a full circle, one endpoint of the arc is the current pen 
position.

Using a negative value changes the direction of radius, which does also seem 
reasonable and intuitive.

My suggestion is not to replace "radius" by "extent" as suggested by @guchao as 
it is IMHO wrong. But I agree that it would be good to leave a note there or to 
add examples demonstrating the behaviour of different (signed) values of radius 
and extent, so the intent and behaviour is clearly documented.

--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 3269a0e56b02da61d8f6e7a5e2cca9f83d50694b by Terry Jan Reedy in 
branch '3.7':
bpo-37309: Update NEWS.txt for 3.7.8 (GH-20353)
https://github.com/python/cpython/commit/3269a0e56b02da61d8f6e7a5e2cca9f83d50694b


--

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +19619
pull_request: https://github.com/python/cpython/pull/20356

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +19618
pull_request: https://github.com/python/cpython/pull/20355

___
Python tracker 

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



[issue40443] Remove unused imports in the stdlib (April 2020 edition)

2020-05-24 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10
nosy_count: 3.0 -> 4.0
pull_requests: +19617
pull_request: https://github.com/python/cpython/pull/20354

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2020-05-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +19616
pull_request: https://github.com/python/cpython/pull/20353

___
Python tracker 

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



[issue40754] ModuleNotFoundError: No module named '_testinternalcapi' under Win10

2020-05-24 Thread honglei jiang


New submission from honglei jiang :

https://www.python.org/ftp/python/3.9.0/python-3.9.0b1-amd64.exe

C:\Python39>python.exe -m test test_deque -v
== CPython 3.9.0b1 (tags/v3.9.0b1:97fe9cf, May 19 2020, 09:02:07) [MSC v.1924 
64 bit (AMD64)]
== Windows-10-10.0.18362-SP0 little-endian
== cwd: C:\Users\jhong\AppData\Local\Temp\test_python_3376
== CPU count: 4
== encodings: locale=cp936, FS=utf-8
0:00:00 Run tests sequentially
0:00:00 [1/1] test_deque
test_add (test.test_deque.TestBasic) ... ok
test_basics (test.test_deque.TestBasic) ... ok
test_big_queue_popleft (test.test_deque.TestBasic) ... ok
test_big_queue_popright (test.test_deque.TestBasic) ... ok
test_big_stack_left (test.test_deque.TestBasic) ... ok
test_big_stack_right (test.test_deque.TestBasic) ... ok
test_clear (test.test_deque.TestBasic) ... ok
test_comparisons (test.test_deque.TestBasic) ... ok
test_container_iterator (test.test_deque.TestBasic) ... ok
test_contains (test.test_deque.TestBasic) ... ok
test_contains_count_stop_crashes (test.test_deque.TestBasic) ... ok
test_copy (test.test_deque.TestBasic) ... ok
test_copy_method (test.test_deque.TestBasic) ... ok
test_count (test.test_deque.TestBasic) ... ok
test_deepcopy (test.test_deque.TestBasic) ... ok
test_delitem (test.test_deque.TestBasic) ... ok
test_extend (test.test_deque.TestBasic) ... ok
test_extendleft (test.test_deque.TestBasic) ... ok
test_gc_doesnt_blowup (test.test_deque.TestBasic) ... ok
test_getitem (test.test_deque.TestBasic) ... ok
test_hash (test.test_deque.TestBasic) ... ok
test_iadd (test.test_deque.TestBasic) ... ok
test_imul (test.test_deque.TestBasic) ... ok
test_index (test.test_deque.TestBasic) ... ok
test_index_bug_24913 (test.test_deque.TestBasic) ... ok
test_init (test.test_deque.TestBasic) ... ok
test_insert (test.test_deque.TestBasic) ... ok
test_insert_bug_26194 (test.test_deque.TestBasic) ... ok
test_iterator_pickle (test.test_deque.TestBasic) ... ok
test_len (test.test_deque.TestBasic) ... ok
test_long_steadystate_queue_popleft (test.test_deque.TestBasic) ... ok
test_long_steadystate_queue_popright (test.test_deque.TestBasic) ... ok
test_maxlen (test.test_deque.TestBasic) ... ok
test_maxlen_attribute (test.test_deque.TestBasic) ... ok
test_maxlen_zero (test.test_deque.TestBasic) ... ok
test_mul (test.test_deque.TestBasic) ... ok
test_pickle (test.test_deque.TestBasic) ... ok
test_pickle_recursive (test.test_deque.TestBasic) ... ok
test_print (test.test_deque.TestBasic) ... ok
test_remove (test.test_deque.TestBasic) ... ok
test_repr (test.test_deque.TestBasic) ... ok
test_reverse (test.test_deque.TestBasic) ... ok
test_reversed (test.test_deque.TestBasic) ... ok
test_reversed_new (test.test_deque.TestBasic) ... ok
test_rotate (test.test_deque.TestBasic) ... ok
test_roundtrip_iter_init (test.test_deque.TestBasic) ... ok
test_setitem (test.test_deque.TestBasic) ... ok
test_sizeof (test.test_deque.TestBasic) ... ERROR
test_underflow (test.test_deque.TestBasic) ... ok
test_constructor (test.test_deque.TestVariousIteratorArgs) ... ok
test_iter_with_altered_data (test.test_deque.TestVariousIteratorArgs) ... ok
test_runtime_error_on_empty_deque (test.test_deque.TestVariousIteratorArgs) ... 
ok
test_basics (test.test_deque.TestSubclass) ... ok
test_bug_31608 (test.test_deque.TestSubclass) ... ok
test_copy_pickle (test.test_deque.TestSubclass) ... ok
test_pickle_recursive (test.test_deque.TestSubclass) ... ok
test_strange_subclass (test.test_deque.TestSubclass) ... ok
test_weakref (test.test_deque.TestSubclass) ... ok
test_subclass_with_kwargs (test.test_deque.TestSubclassWithKwargs) ... ok
test_addmul (test.test_deque.TestSequence) ... ok
test_bigrepeat (test.test_deque.TestSequence) ... ok
test_constructors (test.test_deque.TestSequence) ... ok
test_contains (test.test_deque.TestSequence) ... ok
test_contains_fake (test.test_deque.TestSequence) ... ok
test_contains_order (test.test_deque.TestSequence) ... ok
test_count (test.test_deque.TestSequence) ... ok
test_free_after_iterating (test.test_deque.TestSequence) ... skipped "Exhausted 
deque iterator doesn't free a deque"
test_getitem (test.test_deque.TestSequence) ... ok
test_getitemoverwriteiter (test.test_deque.TestSequence) ... ok
test_getslice (test.test_deque.TestSequence) ... ok
test_iadd (test.test_deque.TestSequence) ... ok
test_imul (test.test_deque.TestSequence) ... ok
test_index (test.test_deque.TestSequence) ... ok
test_len (test.test_deque.TestSequence) ... ok
test_minmax (test.test_deque.TestSequence) ... ok
test_pickle (test.test_deque.TestSequence) ... ok
test_repeat (test.test_deque.TestSequence) ... ok
test_subscript (test.test_deque.TestSequence) ... ok
test_truth (test.test_deque.TestSequence) ... ok

==
ERROR: test_sizeof (test.test_deque.TestBasic)
--
Traceback (most recent call last):
  File "C:\Python39\lib\test\test_deque.py", line 781, in test_sizeof
  

[issue39050] The "Help" button in IDLE's config dialog does not work

2020-05-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

closed

--

___
Python tracker 

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



[issue40372] doctest example programs should exit 1 if any test fails

2020-05-24 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> tim.peters

___
Python tracker 

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



[issue40748] Tutorial 4.7 More on Defining Functions missing screen prompts

2020-05-24 Thread Ama Aje My Fren


Ama Aje My Fren  added the comment:

Hi @Chas Belov,

On Sun, May 24, 2020 at 1:27 AM Chas Belov  wrote:

> The tutorial on More on Defining Functions at 
> https://docs.python.org/3.7/tutorial/controlflow.html#more-on-defining-functions
>  is missing most of the >>> and ... screen prompts that show elsewhere in the 
> tutorial. This is potentially confusing to readers.
>
> I am going to attempt a PR by May 26, 2020.

Are those sections really to be entered in the REPL or could they be
seen as independent code blocks in a file e.g.?
>From the dev guide https://devguide.python.org/documenting/#code-examples

> The ellipsis for the sys.ps2 secondary interpreter prompt should only be used 
> sparingly,
> where it is necessary to clearly differentiate between input lines and output 
> lines.
> Besides contributing visual clutter, it makes it difficult for readers to 
> cut-and-paste
> examples so they can experiment with variations.

None of those sections has output ... so maybe not put the ellipsis?

--
title: Tutorial 4 More Control Flow Tools missing screen prompts in some code 
blocks -> Tutorial 4.7 More on Defining Functions missing screen prompts

___
Python tracker 

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



[issue27495] Pretty printing sorting for set and frozenset instances

2020-05-24 Thread SilentGhost


SilentGhost  added the comment:

Serhiy, would you be interested in converting your patch to a PR?

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

[Rémi Lapeyre]

> In the end, if some core devs think that putting together the various 
> discussions for an imath module in a coherent PEP [...]

I can't answer for other core devs. My *guess* is that there's a reasonable 
chance that a well-written PEP for this would be accepted, but that's just a 
guess.

For myself, I'm not opposed to the addition, but neither am I yet convinced 
it's a good idea; call me +0. The number of bad prime-checking and 
factorisation algorithms that turn up on Stack Overflow (and not just in the 
questions, either) is enough to convince me that it's worth having _something_ 
basic and non-terrible for people to use.

I *am* strongly opposed to adding an imath module without first having a PEP - 
many aspects are unclear and in need of wider discussion. I unfortunately don't 
personally have sufficient time and energy available to push a PEP discussion 
through myself.

If you want to take this further, restarting a discussion on the python-ideas 
mailing list may be the way to go. It may still be worth drafting a PEP first, 
though: a draft PEP would likely help guide that discussion, and perhaps avoid 
it going totally off-topic.

--

___
Python tracker 

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



[issue40748] Tutorial 4 More Control Flow Tools missing screen prompts in some code blocks

2020-05-24 Thread Ama Aje My Fren


Ama Aje My Fren  added the comment:

On Sun, May 24, 2020 at 2:54 AM Chas Belov  wrote:

> Do I need a separate issue for each code block that is not common across
3.5 through 3.10? Or would this be handled during the back-porting process?

Unless there is an issue, automatic back-porting should handle it.
PR against master(dev/3.10) should be enough.

--
nosy: +amaajemyfren

___
Python tracker 

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



[issue40056] more user-friendly turtledemo

2020-05-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I will look at the two changes separately.  Spaces could be backported, but 
since they are not really typos, there is no real need to.  I will compare td 
for master and 3.9 to compare appearance.

--

___
Python tracker 

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



[issue40160] documentation example of os.walk should be less destructive

2020-05-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

1. There is already a warning before example.
2. Even if you blindly copy-paste the example it will not work. You have to set 
the top variable.

So I don't see any problem here. You always can shoot yourself in the foot if 
try enough.

--
resolution:  -> not a bug
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



[issue37973] improve docstrings of sys.float_info

2020-05-24 Thread Mark Dickinson


Mark Dickinson  added the comment:

PR applied. Thank you!

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



[issue20002] Cleanup and microoptimize pathlib

2020-05-24 Thread Ram Rachum


Ram Rachum  added the comment:

Antoine: Serhiy linked me to this issue when I opened #40753 . Do you think 
that this patch by Serhiy could now be merged?

--
nosy: +cool-RR

___
Python tracker 

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



[issue40753] Remove Python 2 compatibility code from pathlib

2020-05-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Similar cleanup (and many many others) was proposed when pathlib was initially 
added to the stdlib. They were rejected, so now we need a new discussion to 
revise the old decision. See issue20002.

--

___
Python tracker 

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



[issue40751] command 'elif' does not work

2020-05-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Beginners should ask on python-list or elsewhere whether something is a bug 
before posting here.

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



[issue40723] IDLE: make autocomplete test run without __main__.__file__

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset 874506cff9aff2cb5eb0192c878e08ded18326a9 by Miss Islington (bot) 
in branch '3.9':
bpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)
https://github.com/python/cpython/commit/874506cff9aff2cb5eb0192c878e08ded18326a9


--

___
Python tracker 

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



[issue40723] IDLE: make autocomplete test run without __main__.__file__

2020-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset 82397e2d97f89fdf36cb8eaf3b2d7c407456ec78 by Miss Islington (bot) 
in branch '3.7':
bpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)
https://github.com/python/cpython/commit/82397e2d97f89fdf36cb8eaf3b2d7c407456ec78


--

___
Python tracker 

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



[issue40753] Remove Python 2 compatibility code from pathlib

2020-05-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +pitrou

___
Python tracker 

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



[issue40752] Implement PurePath.__len__

2020-05-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Path is not a string with bells and whistles. It was intentionally made not a 
string subclass because some string operations (including len()) just do not 
make sense for path or are ambiguous.

I am closing this as it goes against the initial design of pathlib. If you 
disagree, discuss this idea on Python-ideas first and get the support of other 
core developers.

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



  1   2   >