[issue41094] Audit does not work with non-ASCII data on non-UTF-8 locale

2020-06-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20275
pull_request: https://github.com/python/cpython/pull/21108

___
Python tracker 

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



[issue41094] Audit does not work with non-ASCII data on non-UTF-8 locale

2020-06-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +20274
pull_request: https://github.com/python/cpython/pull/21107

___
Python tracker 

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



[issue41094] Audit does not work with non-ASCII data on non-UTF-8 locale

2020-06-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6c6810d98979add7a89391c3c38990d0859f7a29 by Serhiy Storchaka in 
branch 'master':
bpo-41094: Fix decoding errors with audit when open files. (GH-21095)
https://github.com/python/cpython/commit/6c6810d98979add7a89391c3c38990d0859f7a29


--

___
Python tracker 

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



Re: Pycharm Won't Do Long Underscore

2020-06-23 Thread Christian Gollwitzer

Am 23.06.20 um 22:49 schrieb Tony Kaloki:

Alexander,
Thank you so much! It worked! Thank you. One question: in 
your reply, are you saying that Python would have treated the two separate 
underscores the same way as a long  underscore i.e. it's a stylistic choice 
rather than a functional necessity?


Python only ever sees two separate underscores. There is no long 
underscore, its only the way it is printed to your screen that differs. 
The difference is the same as if you would choose Arial, Times, or 
Courier to print your source code. The characters look slightly 
different to your eye, but they are exactly the same for Python. The .py 
file doesn't have a difference, regardless how you set the font.


As others have said, the underscore of some fonts is so long that they 
overlap, if you put more than on in a row.


Christian
--
https://mail.python.org/mailman/listinfo/python-list


Re: FW: Pycharm Won't Do Long Underscore

2020-06-23 Thread Terry Reedy

On 6/23/2020 4:44 PM, MRAB wrote:

On 2020-06-23 20:18, Tony Kaloki wrote:


  When I try to do a long underscore __  for classes in Pycharm, 
it only gives me two separate single underscores _ _.


The "__" is 2 underscores; it's just that they usually appear joined 
together in many fonts.


To really see this, start IDLE either from an icon or 'python -m 
idlelib' (use 'python3' on *nix) on a command line.  Open the settings 
dialog with Options => Configure IDLE.  On the Font tab there is a Font 
Sample box.  Go to the bottom and enter several _s.  In the Windows 
Courier font, and several others, this looks like one line.  On the 
left, try other fonts.  On Windows, switching to Source Code Pro (and 
some others) results in separate underscores.  Source Code Pro, as the 
name suggests, is aimed at programmers, and we need to be able to count 
underscores.


Or maybe you can switch fonts in your mail reader and see what happens 
to the underscores above.



--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


[issue40707] Popen.communicate documentation does not say how to get the return code

2020-06-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thanks for the fix.

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



[issue40707] Popen.communicate documentation does not say how to get the return code

2020-06-23 Thread miss-islington


miss-islington  added the comment:


New changeset 4f5dde463b588fc97cacb4a1905eb422b16daa37 by Miss Islington (bot) 
in branch '3.8':
bpo-40707: Document that Popen.communicate sets the returncode attribute 
(GH-20283)
https://github.com/python/cpython/commit/4f5dde463b588fc97cacb4a1905eb422b16daa37


--

___
Python tracker 

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



[issue40707] Popen.communicate documentation does not say how to get the return code

2020-06-23 Thread miss-islington


miss-islington  added the comment:


New changeset 02d5c74f89709672baa866fcdd04278e59328351 by Miss Islington (bot) 
in branch '3.9':
bpo-40707: Document that Popen.communicate sets the returncode attribute 
(GH-20283)
https://github.com/python/cpython/commit/02d5c74f89709672baa866fcdd04278e59328351


--

___
Python tracker 

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



[issue40707] Popen.communicate documentation does not say how to get the return code

2020-06-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +20272
pull_request: https://github.com/python/cpython/pull/21105

___
Python tracker 

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



[issue40707] Popen.communicate documentation does not say how to get the return code

2020-06-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20273
pull_request: https://github.com/python/cpython/pull/21106

___
Python tracker 

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



[issue40707] Popen.communicate documentation does not say how to get the return code

2020-06-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset bf2e515fa43406d4bd9c4c53ecc9364034d8f9f6 by Gareth Rees in branch 
'master':
bpo-40707: Document that Popen.communicate sets the returncode attribute 
(GH-20283)
https://github.com/python/cpython/commit/bf2e515fa43406d4bd9c4c53ecc9364034d8f9f6


--

___
Python tracker 

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



[issue28806] Improve the netrc library

2020-06-23 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi!

I let a comment on github. The PR was open 3 years agot, so I was wandering to 
know if are there some plans with that PR? Are you interested on the PR?

Cheers,

--
nosy: +eamanu

___
Python tracker 

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



[issue41096] Need command to exit PDB interactive shell

2020-06-23 Thread Kerrick Staley


New submission from Kerrick Staley :

In PDB, when you use "interact" to enter an interactive shell, the only way to 
exit that shell is to send an end-of-transmission (Ctrl+D) character. In some 
environments, such as Jupyter, this is awkward to do. Here is a StackOverflow 
post where a user encountered this issue:
https://stackoverflow.com/questions/47522316/exit-pdb-interactive-mode-from-jupyter-notebook/62546186

I think that the user should be able to type quit() in order to exit the 
interactive Python shell and go back to the PDB shell, similar to a regular 
interactive Python session. I think you should also support exit() because the 
Python shell supports that one as well (quit() and exit() do the same thing, I 
think the alias exists to help discoverability for new users).

I confirmed this issue on Python 3.6.9 and 3.8.3.

--
components: Library (Lib)
messages: 372226
nosy: Kerrick Staley
priority: normal
severity: normal
status: open
title: Need command to exit PDB interactive shell
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue24905] Allow incremental I/O to blobs in sqlite3

2020-06-23 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi everybody, I let a comment on github.

I was asking about if are there some plans with this PR?
Was open 3 years ago and there are not updating 


Cheers

--
nosy: +eamanu

___
Python tracker 

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



[issue40707] Popen.communicate documentation does not say how to get the return code

2020-06-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Will merge after CI passes the addition of 'the'.

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset cde283d16d87024f455e45c6f1b4e4f7d8905836 by Victor Stinner in 
branch 'master':
bpo-40521: Fix _PyContext_Fini() (GH-21103)
https://github.com/python/cpython/commit/cde283d16d87024f455e45c6f1b4e4f7d8905836


--

___
Python tracker 

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



[issue41095] inspect.signature() doesn't parse __text_signature__ containing a newline character

2020-06-23 Thread Anthony Sottile


Anthony Sottile  added the comment:

Looking into this, it appears to be due to the default value and not due to the 
newline

I've stumbled upon two simplifications to the routines in inspect but not a fix 
for this

1. https://github.com/python/cpython/pull/21100
2. https://github.com/python/cpython/pull/21104

the following code is hit because `ast.literal_eval(...)` fails for the `|`d 
expression:

https://github.com/python/cpython/blob/2f9ada96e0d420fed0d09a032b37197f08ef167a/Lib/inspect.py#L2069-L2070

this causes the parameter to be skipped entirely

--

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20271
pull_request: https://github.com/python/cpython/pull/21103

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2f9ada96e0d420fed0d09a032b37197f08ef167a by Victor Stinner in 
branch 'master':
bpo-40521: Make Unicode latin1 singletons per interpreter (GH-21101)
https://github.com/python/cpython/commit/2f9ada96e0d420fed0d09a032b37197f08ef167a


--

___
Python tracker 

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



[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-06-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with the other respondents that this is best left to the application 
code.


Thank you for the suggestion, but I'll mark this as closed.  Don't be deterred 
from making other suggestions :-)

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



[issue41070] Simplify pyshellext.dll build

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks!

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



[issue41070] Simplify pyshellext.dll build

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset bbf36e8903f8e86dcad8131c818e122537c30f9e by Nikita Nemkin in 
branch 'master':
bpo-41070: Simplify pyshellext.dll build (GH-21037)
https://github.com/python/cpython/commit/bbf36e8903f8e86dcad8131c818e122537c30f9e


--

___
Python tracker 

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



[issue41021] ctypes callback with structure crashes in Python 3.8 on Windows x86

2020-06-23 Thread Eryk Sun


Change by Eryk Sun :


--
nosy: +vinay.sajip
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



[issue41094] Audit does not work with non-ASCII data on non-UTF-8 locale

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:

SGTM. Thanks for the PR!

--

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20270
pull_request: https://github.com/python/cpython/pull/21101

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 90ed8a6d71b2d6e0853c14e8e6f85fe730a4329a by Victor Stinner in 
branch 'master':
bpo-40521: Optimize PyUnicode_New(0, maxchar) (GH-21099)
https://github.com/python/cpython/commit/90ed8a6d71b2d6e0853c14e8e6f85fe730a4329a


--

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Anthony Sottile for fixing pydoc select! The fix is now in 3.8, 3.9 and 
master branches.

--

___
Python tracker 

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



[issue41095] inspect.signature() doesn't parse __text_signature__ containing a newline character

2020-06-23 Thread Anthony Sottile


Change by Anthony Sottile :


--
keywords: +patch
nosy: +Anthony Sottile
nosy_count: 3.0 -> 4.0
pull_requests: +20269
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21066

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:

pydoc doesn't show the eventmask parameter whereas it is in 
select.epoll.register.__text_signature__. I created bpo-41095: 
"inspect.signature() doesn't parse __text_signature__ containing a newline 
character".

--

___
Python tracker 

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



[issue41095] inspect.signature() doesn't parse __text_signature__ containing a newline character

2020-06-23 Thread STINNER Victor


New submission from STINNER Victor :

$ ./python
Python 3.10.0a0 (heads/unicode_latin1:40855c7064, Jun 24 2020, 00:20:07) 
>>> import select
>>> select.epoll.register.__text_signature__
'($self, /, fd,\n eventmask=select.EPOLLIN | select.EPOLLPRI | 
select.EPOLLOUT)'

>>> import inspect
>>> inspect.signature(select.epoll.register)


=> eventmask parameter is gone!

Either signature() must raise an exception, or it must handle a 
__text_signature__ containing a newline character.

Issue spotted on bpo-31938 when fixing "./python -m pydoc select".

By the way, as expected, pydoc shows:

Help on method_descriptor in select.epoll:
---
$ ./python -m pydoc select.epoll.register

select.epoll.register = register(self, /, fd)
Registers a new fd or raises an OSError if the fd is already registered.
(...)
---

--
components: Library (Lib)
messages: 372213
nosy: serhiy.storchaka, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: inspect.signature() doesn't parse __text_signature__ containing a 
newline character
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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:

> There is no need to change default-value signatures. The root problem is that 
> select.epoll.register does not have the __module__ attribute.

Oh, I saw your comment after merging Anthony's PR. At least, I confirm that it 
fix the reported issue: "./python -m pydoc select" doesn't fail anymore.

Maybe open a separated issue for the __module__ attribute issue.

--

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread miss-islington


miss-islington  added the comment:


New changeset 48fc35ada7c4237f11bb9638387bfe5b4cebfb12 by Anthony Sottile in 
branch '3.9':
[3.9] bpo-31938: Fix default-value signatures of several functions in the 
select module (GH-21066) (GH-21097)
https://github.com/python/cpython/commit/48fc35ada7c4237f11bb9638387bfe5b4cebfb12


--

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread miss-islington


miss-islington  added the comment:


New changeset 60cbdc81d1bd5c175ff890ee4cfdc85c10090b75 by Anthony Sottile in 
branch '3.8':
[3.8] bpo-31938: Fix default-value signatures of several functions in the 
select module (GH-21066) (GH-21098)
https://github.com/python/cpython/commit/60cbdc81d1bd5c175ff890ee4cfdc85c10090b75


--
nosy: +miss-islington

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20268
pull_request: https://github.com/python/cpython/pull/21099

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f363d0a6e9cfa50677a6de203735fbc0d06c2f49 by Victor Stinner in 
branch 'master':
bpo-40521: Make empty Unicode string per interpreter (GH-21096)
https://github.com/python/cpython/commit/f363d0a6e9cfa50677a6de203735fbc0d06c2f49


--

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +20265, 20266
pull_request: https://github.com/python/cpython/pull/21098

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +20265
pull_request: https://github.com/python/cpython/pull/21098

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +20265, 20266, 20267
pull_request: https://github.com/python/cpython/pull/21098

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +20264
pull_request: https://github.com/python/cpython/pull/21097

___
Python tracker 

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



[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d051801052211b533c46a593b1c1bccf649a171c by Anthony Sottile in 
branch 'master':
bpo-31938: Fix default-value signatures of several functions in the select 
module (GH-21066)
https://github.com/python/cpython/commit/d051801052211b533c46a593b1c1bccf649a171c


--

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20263
pull_request: https://github.com/python/cpython/pull/21096

___
Python tracker 

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



Re: Pycharm Won't Do Long Underscore

2020-06-23 Thread Alexander Neilson
Hi Tony

Absolutely. The “long underscore” is just a display thing. Underneath it is 
always two underscores. The only difference is what your editor is showing (or 
how the underscore is drawn in the display font - as some fonts make the 
underscore the full width or slightly over the edge of where the character will 
be displayed so that many underscores look all joined up like a line)

These links may provide you with some useful reading around this and what 
underscores signal in Python. 

https://dbader.org/blog/meaning-of-underscores-in-python

https://dbader.org/blog/python-dunder-methods

Happy to have helped and good luck with your Python journey. 

Regards
Alexander

Alexander Neilson
Neilson Productions Limited
021 329 681
alexan...@neilson.net.nz

> On 24/06/2020, at 08:49, Tony Kaloki  wrote:
> 
> 
> Alexander,
>Thank you so much! It worked! Thank you. One question: in 
> your reply, are you saying that Python would have treated the two separate 
> underscores the same way as a long  underscore i.e. it's a stylistic choice 
> rather than a functional necessity?
>In any case, thanks again for your quick and easy to follow - even for me 
> - reply.
> Tony
> 
> Get Outlook for Android
> 
> From: Alexander Neilson 
> Sent: Tuesday, June 23, 2020 9:28:37 PM
> To: Tony Kaloki 
> Cc: python-list@python.org 
> Subject: Re: Pycharm Won't Do Long Underscore
>  
> Hi Tony
> 
> The “long underscore” (often called Dunder as “double underscore”) is 
> actually two underscores as you are seeing shown in PyCharm. 
> 
> However the display of it as one long underscore is a ligature (special font 
> display to communicate clearer) and to enable these in PyCharm go to the 
> settings dialog (depending on windows or Mac this could be in different 
> locations) and select Editor > Font
> 
> In that screen select “enable font ligatures” and if your font supports it 
> (like the default JetBrains Mono does) that will start to display the double 
> underscores as a single long underscore. 
> 
> Regards
> Alexander
> 
> Alexander Neilson
> Neilson Productions Limited
> 021 329 681
> alexan...@neilson.net.nz
> 
> > On 24/06/2020, at 07:57, Tony Kaloki  wrote:
> > 
> > 
> > 
> > Sent from Mail for Windows 
> > 10
> > 
> > From: Tony Kaloki
> > Sent: 23 June 2020 19:45
> > To: python-list@python.org
> > Subject: Pycharm Won't Do Long Underscore
> > 
> > 
> > Hi Guys,
> >   I’ve just begun to learn basic computer programming by 
> > downloading Python and Pycharm and following Youtube tutorials. But I’ve 
> > come across a problem that’s stopped me in my tracks.
> > When I try to do a long underscore __  for classes in Pycharm, it only 
> > gives me two separate single underscores _ _. This is only in Pycharm, no 
> > problems anywhere else. Could you tell me how to fix this, because I can’t 
> > find any answers on the web and I’m not sure if I can go any further in my 
> > learning without being able to get long underscores.
> >Sorry if I’m just being really dense, but like I said I’m an absolute 
> > beginner. Thanks for your time,
> > Tony
> > Sent from Mail for Windows 
> > 10
> > 
> > 
> > -- 
> > https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pycharm Won't Do Long Underscore

2020-06-23 Thread Alexander Neilson
Hi Tony

The “long underscore” (often called Dunder as “double underscore”) is actually 
two underscores as you are seeing shown in PyCharm. 

However the display of it as one long underscore is a ligature (special font 
display to communicate clearer) and to enable these in PyCharm go to the 
settings dialog (depending on windows or Mac this could be in different 
locations) and select Editor > Font

In that screen select “enable font ligatures” and if your font supports it 
(like the default JetBrains Mono does) that will start to display the double 
underscores as a single long underscore. 

Regards
Alexander

Alexander Neilson
Neilson Productions Limited
021 329 681
alexan...@neilson.net.nz

> On 24/06/2020, at 07:57, Tony Kaloki  wrote:
> 
> 
> 
> Sent from Mail for Windows 10
> 
> From: Tony Kaloki
> Sent: 23 June 2020 19:45
> To: python-list@python.org
> Subject: Pycharm Won't Do Long Underscore
> 
> 
> Hi Guys,
>   I’ve just begun to learn basic computer programming by 
> downloading Python and Pycharm and following Youtube tutorials. But I’ve come 
> across a problem that’s stopped me in my tracks.
> When I try to do a long underscore __  for classes in Pycharm, it only 
> gives me two separate single underscores _ _. This is only in Pycharm, no 
> problems anywhere else. Could you tell me how to fix this, because I can’t 
> find any answers on the web and I’m not sure if I can go any further in my 
> learning without being able to get long underscores.
>Sorry if I’m just being really dense, but like I said I’m an absolute 
> beginner. Thanks for your time,
> Tony
> Sent from Mail for Windows 10
> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pycharm Won't Do Long Underscore

2020-06-23 Thread Grant Edwards
On 2020-06-23, Tony Kaloki  wrote:

>in your reply, are you saying that Python would have treated the
>two separate underscores the same way as a long underscore

No.

There is no long underscore in Python.

In Python, it's always two underscores.

In some fonts, two underscores just _looks_ like a single long
underscore.

--
Grant


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Asynchronous generators

2020-06-23 Thread inhahe
I know of a URL that explains asyncio:
https://hackernoon.com/a-simple-introduction-to-pythons-asyncio-595d9c9ecf8c.
As to your specific problem, I can't help and don't know if the URL helps.
I haven't studied asyncio much.

On Tue, Jun 23, 2020 at 3:53 PM Jonathan Gossage  wrote:

> --
> I am attempting to learn how to use asyncio and I have been unable to find
> any documentation or Internet posts that give information on the principles
> underlying asyncio, let alone any examples showing how asynchronous
> generators should be used. I have built a toy program to test trying to
> read a text file, line by line, and process each line asynchronously. I
> wind up with a message complaining that my asynchronous generator is not a
> coroutine. I am posting a copy of my program here along with the results
> from trying to run it. I am hoping for some suggestions about how to fix
> it.  I am using Python 3.8.3 on Ubuntu 20.04
>
> import asyncio
> > from pathlib import Path
> > import timeit
> >
> > async def _read_password() -> str:
> > with Path('/etc/passwd').open() as f:
> > line: str = f.readline()
> > yield line
> > print('read_password has read everything')
> >
> > async def main(_rp) -> int:
> > line = ''
> > async for line in _rp:
> > try:
> > print(f'Got line {line}')
> > except StopAsyncIteration:
> > line = None
> > _rp.aclose()
> > return 0
> >
> > if __name__ == '__main__':
> > _loop = asyncio.get_event_loop()
> > _rp = _read_password()
> > _m = main(_rp)
> > _loop.create_task(_m)
> > _loop.create_task(_rp)
> > timeit.Timer(_loop.run_until_complete()).timeit()
> > _loop.close()
>
>
> Here is the output:
>
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.8/runpy.py", line 194, in
> _run_module_as_main
> return _run_code(code, main_globals, None,
>   File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
> exec(code, run_globals)
>   File
>
> "/home/jgossage/EclipseWorkspaces/GlobalVillage/Infrastructure/Play/Async/passwd.py",
> line 34, in 
> _loop.create_task(_rp)
>   File "/usr/local/lib/python3.8/asyncio/base_events.py", line 431, in
> create_task
> task = tasks.Task(coro, loop=self, name=name)
> TypeError: a coroutine was expected, got  _read_password at 0x7f1f2454b8b0>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 281cce1106568ef9fec17e3c72d289416fac02a5 by Victor Stinner in 
branch 'master':
bpo-40521: Make MemoryError free list per interpreter (GH-21086)
https://github.com/python/cpython/commit/281cce1106568ef9fec17e3c72d289416fac02a5


--

___
Python tracker 

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



Re: Pycharm Won't Do Long Underscore

2020-06-23 Thread Tony Kaloki
Alexander,
   Thank you so much! It worked! Thank you. One question: in 
your reply, are you saying that Python would have treated the two separate 
underscores the same way as a long  underscore i.e. it's a stylistic choice 
rather than a functional necessity?
   In any case, thanks again for your quick and easy to follow - even for me - 
reply.
Tony

Get Outlook for Android


From: Alexander Neilson 
Sent: Tuesday, June 23, 2020 9:28:37 PM
To: Tony Kaloki 
Cc: python-list@python.org 
Subject: Re: Pycharm Won't Do Long Underscore

Hi Tony

The “long underscore” (often called Dunder as “double underscore”) is actually 
two underscores as you are seeing shown in PyCharm.

However the display of it as one long underscore is a ligature (special font 
display to communicate clearer) and to enable these in PyCharm go to the 
settings dialog (depending on windows or Mac this could be in different 
locations) and select Editor > Font

In that screen select “enable font ligatures” and if your font supports it 
(like the default JetBrains Mono does) that will start to display the double 
underscores as a single long underscore.

Regards
Alexander

Alexander Neilson
Neilson Productions Limited
021 329 681
alexan...@neilson.net.nz

> On 24/06/2020, at 07:57, Tony Kaloki  wrote:
>
> 
>
> Sent from Mail for Windows 10
>
> From: Tony Kaloki
> Sent: 23 June 2020 19:45
> To: python-list@python.org
> Subject: Pycharm Won't Do Long Underscore
>
>
> Hi Guys,
>   I’ve just begun to learn basic computer programming by 
> downloading Python and Pycharm and following Youtube tutorials. But I’ve come 
> across a problem that’s stopped me in my tracks.
> When I try to do a long underscore __  for classes in Pycharm, it only 
> gives me two separate single underscores _ _. This is only in Pycharm, no 
> problems anywhere else. Could you tell me how to fix this, because I can’t 
> find any answers on the web and I’m not sure if I can go any further in my 
> learning without being able to get long underscores.
>Sorry if I’m just being really dense, but like I said I’m an absolute 
> beginner. Thanks for your time,
> Tony
> Sent from Mail for Windows 10
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue41069] Use non-ascii file names in tests by default

2020-06-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +Audit does not work with non-ASCII data on non-UTF-8 locale

___
Python tracker 

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



Re: FW: Pycharm Won't Do Long Underscore

2020-06-23 Thread MRAB

On 2020-06-23 20:18, Tony Kaloki wrote:



Sent from Mail for Windows 10

From: Tony Kaloki
Sent: 23 June 2020 19:45
To: python-list@python.org
Subject: Pycharm Won't Do Long Underscore


Hi Guys,
I’ve just begun to learn basic computer programming by 
downloading Python and Pycharm and following Youtube tutorials. But I’ve come 
across a problem that’s stopped me in my tracks.
  When I try to do a long underscore __  for classes in Pycharm, it only 
gives me two separate single underscores _ _. This is only in Pycharm, no 
problems anywhere else. Could you tell me how to fix this, because I can’t find 
any answers on the web and I’m not sure if I can go any further in my learning 
without being able to get long underscores.
 Sorry if I’m just being really dense, but like I said I’m an absolute 
beginner. Thanks for your time,

The "__" is 2 underscores; it's just that they usually appear joined 
together in many fonts.


If you try:

 print('_' * 2)

do they appear joined together or separate? If they appear separate, 
then you can see that that's just how they're displayed in that funt.

--
https://mail.python.org/mailman/listinfo/python-list


[issue31938] Convert selectmodule.c to Argument Clinic

2020-06-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is no need to change default-value signatures. The root problem is that 
select.epoll.register does not have the __module__ attribute.

Well, seems that all method objects do not have the __module__ attribute. There 
are two solutions:

1. Make inspect falling back to __objclass__.__module__.
2. Set __module__ for method objects.

But this is a separate issue.

--

___
Python tracker 

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



[issue41094] Audit does not work with non-ASCII data on non-UTF-8 locale

2020-06-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue41094] Audit does not work with non-ASCII data on non-UTF-8 locale

2020-06-23 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There are issues with using PySys_Audit() with non-ASCII data on non-UTF-8 
locale.

One example is with PYTHONSTARTUP. In pymain_run_startup() in Modules/main.c 
the value of the PYTHONSTARTUP environment variable is passed to PySys_Audit() 
as UTF-8 encoded data. If it contains non-ASCII characters and the locale 
encoding is different from UTF-8, it fails.

There are similar bugs in _Py_fopen() and _Py_fopen_obj().

--
components: Interpreter Core
messages: 372205
nosy: serhiy.storchaka, steve.dower, vstinner
priority: normal
severity: normal
status: open
title: Audit does not work with non-ASCII data on non-UTF-8 locale
type: behavior
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



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

2020-06-23 Thread Tony


Change by Tony :


--
pull_requests: +20260
pull_request: https://github.com/python/cpython/pull/21094

___
Python tracker 

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



[issue40707] Popen.communicate documentation does not say how to get the return code

2020-06-23 Thread Gareth Rees


Gareth Rees  added the comment:

Is there anything I can do to move this forward?

--

___
Python tracker 

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



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

2020-06-23 Thread Tony


Change by Tony :


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

___
Python tracker 

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



FW: Pycharm Won't Do Long Underscore

2020-06-23 Thread Tony Kaloki



Sent from Mail for Windows 10

From: Tony Kaloki
Sent: 23 June 2020 19:45
To: python-list@python.org
Subject: Pycharm Won't Do Long Underscore


Hi Guys,
   I’ve just begun to learn basic computer programming by 
downloading Python and Pycharm and following Youtube tutorials. But I’ve come 
across a problem that’s stopped me in my tracks.
 When I try to do a long underscore __  for classes in Pycharm, it only 
gives me two separate single underscores _ _. This is only in Pycharm, no 
problems anywhere else. Could you tell me how to fix this, because I can’t find 
any answers on the web and I’m not sure if I can go any further in my learning 
without being able to get long underscores.
Sorry if I’m just being really dense, but like I said I’m an absolute 
beginner. Thanks for your time,
Tony
Sent from Mail for Windows 10


-- 
https://mail.python.org/mailman/listinfo/python-list


Asynchronous generators

2020-06-23 Thread Jonathan Gossage
-- 
I am attempting to learn how to use asyncio and I have been unable to find
any documentation or Internet posts that give information on the principles
underlying asyncio, let alone any examples showing how asynchronous
generators should be used. I have built a toy program to test trying to
read a text file, line by line, and process each line asynchronously. I
wind up with a message complaining that my asynchronous generator is not a
coroutine. I am posting a copy of my program here along with the results
from trying to run it. I am hoping for some suggestions about how to fix
it.  I am using Python 3.8.3 on Ubuntu 20.04

import asyncio
> from pathlib import Path
> import timeit
>
> async def _read_password() -> str:
> with Path('/etc/passwd').open() as f:
> line: str = f.readline()
> yield line
> print('read_password has read everything')
>
> async def main(_rp) -> int:
> line = ''
> async for line in _rp:
> try:
> print(f'Got line {line}')
> except StopAsyncIteration:
> line = None
> _rp.aclose()
> return 0
>
> if __name__ == '__main__':
> _loop = asyncio.get_event_loop()
> _rp = _read_password()
> _m = main(_rp)
> _loop.create_task(_m)
> _loop.create_task(_rp)
> timeit.Timer(_loop.run_until_complete()).timeit()
> _loop.close()


Here is the output:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
  File
"/home/jgossage/EclipseWorkspaces/GlobalVillage/Infrastructure/Play/Async/passwd.py",
line 34, in 
_loop.create_task(_rp)
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 431, in
create_task
task = tasks.Task(coro, loop=self, name=name)
TypeError: a coroutine was expected, got 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Stefan Behnel


Change by Stefan Behnel :


--
stage:  -> patch review

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Stefan Behnel


Stefan Behnel  added the comment:

I chose to go through the MRO, which takes multiple inheritance into account.

--
stage: patch review -> 

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Stefan Behnel


Change by Stefan Behnel :


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

___
Python tracker 

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



[issue41054] Simplify resource compilation on Windows

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks!

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



[issue41039] Simplify python3.dll build

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks!

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



[issue41039] Simplify python3.dll build

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset 2c6e4e91c5a4d3f25908108f4ed32aba936df70c by Nikita Nemkin in 
branch 'master':
bpo-41039: Simplify python3.dll build (GH-20989)
https://github.com/python/cpython/commit/2c6e4e91c5a4d3f25908108f4ed32aba936df70c


--

___
Python tracker 

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



[issue41089] Filters and other issues in Visual Studio projects

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset 47cd931a61146793faa44e01516bf07b0c23380c by Steve Dower in branch 
'3.9':
bpo-41089: Filters and other issues in Visual Studio projects (GH-21070)
https://github.com/python/cpython/commit/47cd931a61146793faa44e01516bf07b0c23380c


--

___
Python tracker 

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



[issue41054] Simplify resource compilation on Windows

2020-06-23 Thread miss-islington


miss-islington  added the comment:


New changeset cebd43fbfd25a80404728f73edc301f9558d9410 by Miss Islington (bot) 
in branch '3.9':
bpo-41054: Simplify resource compilation on Windows (GH-21004)
https://github.com/python/cpython/commit/cebd43fbfd25a80404728f73edc301f9558d9410


--

___
Python tracker 

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



Re: parsing encrypted netrc file

2020-06-23 Thread Barry Scott



> On 22 Jun 2020, at 23:38, Seb  wrote:
> 
> Hello,
> 
> What's the pythonic way to do this without polluting the user's
> directory with the decrypted file?  I wrongly thought this should do it:
> 
> import os.path as osp
> import gnupg
> import netrc
> import tempfile
> 
> gpg = gnupg.GPG()
> 
> with open(osp.expanduser("~/.authinfo.gpg"), "rb") as f:
>with tempfile.NamedTemporaryFile("w+") as tf:
>status = gpg.decrypt_file(f, output=tf.name)
>info = netrc.netrc(tf.name)
> 
> which fails as the temporary file doesn't even get created.

I do not how to do this. But I would decrypt into a string in memory.
Then have netrc parse from the string.

There is no point in having an encrypted file if you are going to decrypt in to
a temp file. A deleted files leaves it in the contents on the disk
to be grab by bad actors.

Barry



> 
> --
> Seb
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue41054] Simplify resource compilation on Windows

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset 4efc3360c9a83d5891f27ed67b4f0ab7275d2ab4 by Nikita Nemkin in 
branch 'master':
bpo-41054: Simplify resource compilation on Windows (GH-21004)
https://github.com/python/cpython/commit/4efc3360c9a83d5891f27ed67b4f0ab7275d2ab4


--

___
Python tracker 

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



[issue41054] Simplify resource compilation on Windows

2020-06-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +20257
pull_request: https://github.com/python/cpython/pull/21091

___
Python tracker 

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



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

2020-06-23 Thread Tony


Tony  added the comment:

By the way I have to ask, if I want this feature to be merged (this is my first 
PR) should I make a PR to 3.6/3.7/3.8/3.9 and master?

Or should I create a PR to master only? 

thanks

--

___
Python tracker 

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



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

2020-06-23 Thread Tony


New submission from Tony :

Currently calling BaseServer's shutdown() function will not make 
serve_forever() return immediately from it's select().

I suggest adding a new function called server_shutdown() that will make 
serve_forever() shutdown immediately.

Then in TCPServer(BaseServer) all we need to do is call 
self.socket.shutdown(socket.SHUT_RDWR) in server_shutdown()'s implementation.

To test this I made a simple script:

import threading
import time
from functools import partial
from http.server import HTTPServer, SimpleHTTPRequestHandler


def serve_http(server):
server.serve_forever(poll_interval=2.5)

def main():
with HTTPServer(('', 8000), SimpleHTTPRequestHandler) as server:
t = threading.Thread(target=partial(serve_http, server))
t.start()

time.sleep(3)

start = time.time()
print('shutdown')
server.shutdown()
print(f'time it took: {time.time() - start}')


if __name__ == "__main__":
main()

--
components: Library (Lib)
messages: 372194
nosy: tontinton
priority: normal
severity: normal
status: open
title: BaseServer's server_forever() shutdown immediately when calling 
shutdown()
type: enhancement
versions: 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



[issue41089] Filters and other issues in Visual Studio projects

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks!

--

___
Python tracker 

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



Re: Floating point problem

2020-06-23 Thread Tony Flury via Python-list



On 18/04/2020 15:29, Grant Edwards wrote:

On 2020-04-18, Souvik Dutta  wrote:

I literally tried it!!! And it did not stop because I did not get any 1.0
rather I got 0.999 But why does this happen. This is a simple math
which according to normal human logic should give perfect numbers which are
not endless. Then why does a computer behave so differently?

Because computers _don't_do_math_.  That is a very important thing to
remember.

Computer do something that _approximates_ math... in some
situations...  if you know what you're doing.

In you're case you're doing IEEE floating point operations. Before you
use floating point, you should read the article by Goldman that has been
suggested:

https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
https://dl.acm.org/doi/10.1145/103162.103163


There is also

https://docs.python.org/3/tutorial/floatingpoint.html

In the official Python documentation, well worth reading.



--
Grant


--
https://mail.python.org/mailman/listinfo/python-list


[issue41089] Filters and other issues in Visual Studio projects

2020-06-23 Thread Steve Dower


Change by Steve Dower :


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



[issue41089] Filters and other issues in Visual Studio projects

2020-06-23 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +20256
pull_request: https://github.com/python/cpython/pull/21090

___
Python tracker 

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



[issue41089] Filters and other issues in Visual Studio projects

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset fe2a48c605d98ac02ab2b9593cb87ce364aeae2d by Nikita Nemkin in 
branch 'master':
bpo-41089: Filters and other issues in Visual Studio projects (GH-21070)
https://github.com/python/cpython/commit/fe2a48c605d98ac02ab2b9593cb87ce364aeae2d


--

___
Python tracker 

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



[issue41072] Python 3.8.3 passively introduced open source software contains CVE vulnerability

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:

It depends on your application. Almost all of these are exposed directly, so 
you will be vulnerable if your application uses them in the way described by 
the CVE.

I'm not familiar enough with the vulnerabilities in question to tell you for 
sure, and I doubt any of the other volunteers here are either. 

I do seem to recall that one of the OpenSSL vulnerabilities only applied if you 
were serving a particular TLS version, which won't impact most Python apps. And 
the wininst*.exe files are only used with bdist_wininst packages, which nobody 
should be using anymore.

If you're not able to evaluate them yourself, you might look for a paid company 
or consultant who can help you out. We've already updated the dependencies that 
need to be updated for upcoming releases.

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

___
Python tracker 

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



[issue39699] Some CIs silence potentially useful output from make

2020-06-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset 6eab52ffadb2836adb59d0578c84d247f05e19b1 by Ammar Askar in branch 
'3.8':
bpo-39699: Remove accidentally committed test change (GH-21089)
https://github.com/python/cpython/commit/6eab52ffadb2836adb59d0578c84d247f05e19b1


--

___
Python tracker 

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



[issue41087] Argparse int / float default

2020-06-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue41087] Argparse int / float default

2020-06-23 Thread Bryan

Bryan  added the comment:

So you agree, Python lacks common sense...

On Wed, 24 Jun 2020 at 03:32, Vedran Čačić  wrote:

>
> Vedran Čačić  added the comment:
>
> Yes, it is common sense in statically typed languages. Python is not
> statically typed. Many other things are also "common sense" in various
> paradigms, which doesn't mean they should also be in Python.
>
> --
> nosy: +veky
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39699] Some CIs silence potentially useful output from make

2020-06-23 Thread Ammar Askar


Ammar Askar  added the comment:

Opened up a quick pull request to fix it: 
https://github.com/python/cpython/pull/21089

--

___
Python tracker 

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



[issue39699] Some CIs silence potentially useful output from make

2020-06-23 Thread Ammar Askar


Ammar Askar  added the comment:

Thanks for finding this Mark, looks like this was accidentally introduced in 
the 3.8 backport for testing the changes: 
https://github.com/python/cpython/pull/18670

The master (6aa1f1ecf7142a4117eedb8c570f30da1598616c) and 3.7 
(3bf9de2fb954bd1131f4f41517d7d5c316fb95f8) commits look clean.

--

___
Python tracker 

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



[issue39699] Some CIs silence potentially useful output from make

2020-06-23 Thread Ammar Askar


Change by Ammar Askar :


--
pull_requests: +20255
pull_request: https://github.com/python/cpython/pull/21089

___
Python tracker 

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



[issue41087] Argparse int / float default

2020-06-23 Thread Vedran Čačić

Vedran Čačić  added the comment:

Yes, it is common sense in statically typed languages. Python is not statically 
typed. Many other things are also "common sense" in various paradigms, which 
doesn't mean they should also be in Python.

--
nosy: +veky

___
Python tracker 

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



[issue41083] plistlib can't decode date from year 0

2020-06-23 Thread Michael Shields


Michael Shields  added the comment:

You're correct that there is no year 0, but as you see Apple does use 
-12-30T00:00:00Z in their plists. I did not set that in order 
to test plistlib; it's what I found on my system.

If it's a goal that plistlib be able to parse system-generated plists and 
round-trip them to an equivalent serialization -- and I think that should be a 
goal -- then using strings or None also won't work. Maybe there could be a 
plistlib.Datetime for dates which are outside what datetime can represent?

--

___
Python tracker 

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



[issue41087] Argparse int / float default

2020-06-23 Thread Bryan


Bryan  added the comment:

This sort of ambiguity is why I like strongly typed languages and languages
where timtoady is not seen often.

I can guarantee you, that if argparse was implemented in Pascal (and copt
most probably has been), that if type was specified and a default given,
that the default would have to adhere to that type. It is just programming
common sense

On Wed, 24 Jun 2020 02:20 paul j3,  wrote:

>
> paul j3  added the comment:
>
> No, parameters like `type` let the developer control what his users
> provides.  Violating that produces a runtime error, and exit.
>
> But in general argparse does not try to control values that the developer
> uses.  There's plenty of time during development to catch error such as
> this - if they are errors at all.
>
> 'type' does not 'declare' what the attribute will be.  It is a function
> that is applied to the input string, and converts that to something or
> other, or raises a TypeError.  It is used only if there is a string value
> to work on, either from the user, or a string default.
>
> This is not a bug, so should be closed.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41092] Report actual size from 'os.path.getsize'

2020-06-23 Thread Stephen Finucane


Change by Stephen Finucane :


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

___
Python tracker 

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



[issue41092] Report actual size from 'os.path.getsize'

2020-06-23 Thread Stephen Finucane


New submission from Stephen Finucane :

The 'os.path.getsize' API returns the apparent size of the file at *path*, that 
is, the number of bytes the file reports itself as consuming. However, it's 
often useful to get the actual size of the file, or the size of file on disk. 
It would be helpful if one could get this same information from 
'os.path.getsize'.

--
components: Library (Lib)
messages: 372183
nosy: stephenfin
priority: normal
severity: normal
status: open
title: Report actual size from 'os.path.getsize'
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



[issue41087] Argparse int / float default

2020-06-23 Thread paul j3


paul j3  added the comment:

No, parameters like `type` let the developer control what his users provides.  
Violating that produces a runtime error, and exit.

But in general argparse does not try to control values that the developer uses. 
 There's plenty of time during development to catch error such as this - if 
they are errors at all.  

'type' does not 'declare' what the attribute will be.  It is a function that is 
applied to the input string, and converts that to something or other, or raises 
a TypeError.  It is used only if there is a string value to work on, either 
from the user, or a string default.  

This is not a bug, so should be closed.

--

___
Python tracker 

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



Re: [Python-ideas] asyncio: return from multiple coroutines

2020-06-23 Thread Pablo Alcain
Thank you very much Kyle for your answer, I am moving this conversation to
the more proper python-list for whoever wants to chime in. I summarize here
the key points of my original question (full question on the quoted email):

I have an application that listens on two websockets through the async
library https://websockets.readthedocs.io/ and I have to perform the same
function on the result, no matter where the message came from. I have
implemented a rather cumbersome solution with async Queues:
https://pastebin.com/BzaxRbtF, but i think there has to be a more
async-friendly option I am missing.

Now I move on to the comments that Kyle made

On Tue, Jun 23, 2020 at 12:32 AM Kyle Stanley  wrote:

> I believe asyncio.wait() with "return_when=FIRST_COMPLETED" would
> perform the functionality you're looking for with the
> "asyncio.on_first_return()". For details on the functionality of
> asyncio.wait(), see
> https://docs.python.org/3/library/asyncio-task.html#asyncio.wait.
>
> I understand that I can create two coroutines that call the same
> function, but it would be much cleaner (because of implementation issues)
> if I can simply create a coroutine that yields the result of whichever
> connection arrives first.
>
> You can use an asynchronous generator that will continuously yield the
> result of the first recv() that finishes (I'm assuming you mean
> "yields" literally and want multiple results from a generator, but I
> might be misinterpreting that part).
>

Yes, I want to have multiple results: the connections listening forever,
returning a result for each message received.


>
> Here's a brief example, using the recv() coroutine function from the
> pastebin linked:
>
> ```
> import asyncio
> import random
>
> async def recv(message: str, max_sleep: int):
> sleep_time = max_sleep * random.random()
> await asyncio.sleep(sleep_time)
> return f'{message} awaited for {sleep_time:.2f}s'
>
> async def _start():
> while True:
> msgs = [
> asyncio.create_task(recv("Messager 1", max_sleep=1)),
> asyncio.create_task(recv("Messager 2", max_sleep=1))
> ]
> done, _ = await asyncio.wait(msgs,
> return_when=asyncio.FIRST_COMPLETED)
> result = done.pop()
> yield await result
>
> async def main():
> async for result in _start():
> print(result)
>
> asyncio.run(main())
> ```


I forgot to mention thatI did try to use asyncio.wait with
`FIRST_COMPLETED`; however, the problem is that it seems to evict the
not-completed coroutines, so the messenger that arrives second does not
send the message. To check it, I have run that script without the random
sleep. just msgr1 waits 1s and msgr2 waits 2s, so msgr1 always ends first.
I expect a result like this (which I am currently getting with queues):

Messenger 1 waits for 1.0s
Messenger 1 waits for 1.0s
Messenger 2 waits for 2.0s
Messenger 1 waits for 1.0s
Messenger 1 waits for 1.0s
Messenger 2 waits for 2.0s
Messenger 1 waits for 1.0s
...

but instead I got this:

Messenger 1 waits for 1.0s
Messenger 1 waits for 1.0s
Messenger 1 waits for 1.0s
Messenger 1 waits for 1.0s
Messenger 1 waits for 1.0s
...





> Note that in the above example, in "msgs", you can technically pass
> the coroutine objects directly to asyncio.wait(), as they will be
> implicitly converted to tasks. However, we decided to deprecate that
> functionality in Python 3.8 since it can be rather confusing. So
> creating and passing the tasks is a better practice.
>

Thanks for that info, I am still trying to grasp the best practices
surrounding mostly the explicitness in async.


> > Again, it's quite likely I am not seeing something obvious, but I didn't
> know where else to ask.
>
> If you're not mostly certain or relatively inexperienced with the
> specific area that the question pertains to, I'd recommend asking on
> python-list first (or another Python user community). python-ideas is
> primarily intended for new feature proposals/suggestions. Although if
> you've tried other resources and haven't found an answer, it's
> perfectly fine to ask a question as part of the suggestion post.
>
>
>
Original question, as posted in python-ideas:


> On Mon, Jun 22, 2020 at 6:24 PM Pablo Alcain 
> wrote:
> >
> > Hey everyone. I have been looking into asyncio lately, and even though I
> have had my fair share of work, I still have some of it very shaky, so
> first of all forgive me if what I am saying here is already implemented and
> I totally missed it (so far, it looks *really* likely).
> >
> > Basically this is the situation: I have an application that listens on
> two websockets through the async library
> https://websockets.readthedocs.io/ and I have to perform the same
> function on the result, no matter where the message came from. I understand
> that I can create two coroutines that call the same function, but it would
> be much cleaner (because of implementation issues) if I can simply create a
> 

[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2020-06-23 Thread SilentGhost


Change by SilentGhost :


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

___
Python tracker 

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



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

2020-06-23 Thread hai shi


Change by hai shi :


--
pull_requests: +20253
pull_request: https://github.com/python/cpython/pull/21087

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f9bd05e83e32bece49de5af0c9a232325c57648a by Raymond Hettinger in 
branch 'master':
bpo-40521: Empty frozenset is no longer a singleton (GH-21085)
https://github.com/python/cpython/commit/f9bd05e83e32bece49de5af0c9a232325c57648a


--

___
Python tracker 

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



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2020-06-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

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

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

> do we still only support single inheritance at the C level?

Not any more. Heap types may have multiple bases, and they can be created at 
the C level (since Python 3.2, PEP 384).

>  So, I think we should do something like walking up the hierarchy to find the 
> C function in it that is currently being called, and then check if it's the 
> one we would expect or if a subclass defines a different one. The current 
> check does not bother to search and just assumes that it knows which 
> (super)type defines the right function to call.

Should we be bold and skip the check for heap types?
That would mean that when/if `str` is converted to a heap type, you could do 
`object.__delattr__(str, "lower")`. That would break your Python, but only at 
the Python level (similar to things like `import builtins; del 
builtins.__build_class__`).
Heap types are not shared between interpreters, so that reason is gone. But 
Guido's [2003 mail] suggests there are other reasons to prevent changing 
built-in types. What are they?

[2003 mail] https://mail.python.org/pipermail/python-dev/2003-April/034535.html

--

___
Python tracker 

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



[issue41091] Remove recommendation in curses module documentation to initialize LC_ALL and encode strings

2020-06-23 Thread Manuel Jacob

New submission from Manuel Jacob :

The documentation for the curses module 
(https://docs.python.org/3.9/library/curses.html) has the following note:

> Since version 5.4, the ncurses library decides how to interpret non-ASCII 
> data using the nl_langinfo function. That means that you have to call 
> locale.setlocale() in the application and encode Unicode strings using one of 
> the system’s available encodings. This example uses the system’s default 
> encoding:
> 
> import locale
> locale.setlocale(locale.LC_ALL, '')
> code = locale.getpreferredencoding()
> 
> Then use code as the encoding for str.encode() calls.

The recommendation to call `locale.setlocale(locale.LC_ALL, '')` is problematic 
as it initializes all locale categories to the user settings, which might be 
unintended and is not necessary for curses to work correctly. Initializing 
LC_CTYPE is sufficient for nl_langinfo() to return the correct encoding. 
Current versions of Python (*) initialize LC_CTYPE at interpreter startup. 
Therefore calling locale.setlocale() should not be necessary at all.

The curses module automatically encodes strings. Therefore the recommendation 
to manually encode strings is outdated.

(*) It seems to be the case since 177d921c8c03d30daa32994362023f777624b10d. Why 
was is not previously done on Python 2 and on Python 3 on Windows?

--
assignee: docs@python
components: Documentation
messages: 372178
nosy: docs@python, mjacob
priority: normal
severity: normal
status: open
title: Remove recommendation in curses module documentation to initialize 
LC_ALL and encode strings

___
Python tracker 

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



[issue36921] Deprecate yield from and @coroutine in asyncio

2020-06-23 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Was this supposed to deprecate using types.coroutine as a decorator as well? 
Because that's not clearly documented, which means people can still use it to 
make generator-based coroutines without async def.

--
nosy: +josh.r

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20252
pull_request: https://github.com/python/cpython/pull/21086

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +20251
pull_request: https://github.com/python/cpython/pull/21085

___
Python tracker 

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



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-23 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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

___
Python tracker 

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



[issue41004] Hash collisions in IPv4Interface and IPv6Interface

2020-06-23 Thread Beuc


Change by Beuc :


--
nosy: +Beuc

___
Python tracker 

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



  1   2   >