[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-16 Thread STINNER Victor


STINNER Victor  added the comment:

I don't think that it's worth it to backport these changes, so I close the 
issue.

Again, to avoid reintroducing such terms, I proposed 
https://github.com/python/devguide/issues/605 to define some general guidelines 
on the terminology.

Thanks for reviews.

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fbf43f051e7bf479709e122efa4b6edd4b09d4df by Victor Stinner in 
branch 'master':
bpo-41521: Rename blacklist parameter to not_exported (GH-21824)
https://github.com/python/cpython/commit/fbf43f051e7bf479709e122efa4b6edd4b09d4df


--

___
Python tracker 

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



[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-16 Thread song super


New submission from song super <2262720...@qq.com>:

python3.6 
from os.path import join 
join('3', '{:3') 
return  '{:3' in  windows,However,join('3', '{:3') return  '3//{:3' in linux,I 
think this is a bug

--
components: Windows
files: python bug.zip
hgrepos: 391
messages: 375524
nosy: 2262720766, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: from os.path import join join('3', '{:3') return  '{:3' in  windows
type: compile error
versions: Python 3.6
Added file: https://bugs.python.org/file49400/python bug.zip

___
Python tracker 

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-16 Thread Matt Joiner


New submission from Matt Joiner :

I get this error when running pyright for a type of typing.ByteString. All the 
implementations of ByteString (bytes, bytearray, memoryview) have the hex 
method, so this seems unexpected?

--
components: Library (Lib)
messages: 375523
nosy: anacrolix
priority: normal
severity: normal
status: open
title: Cannot access member "hex" for type "ByteString"
type: behavior
versions: Python 3.8

___
Python tracker 

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



Re: I discovered a bug in the no-ip dynamic dns free hostname auto renewal/confirmation script written by loblab

2020-08-16 Thread Turritopsis Dohrnii Teo En Ming

Noted with thanks. I will contact the script authors.



On 2020-08-17 07:16, Cameron Simpson wrote:
On 16Aug2020 17:41, Turritopsis Dohrnii Teo En Ming 
 wrote:

Subject: I discovered a bug in the no-ip dynamic dns free hostname
auto renewal/confirmation script written by loblab


The best thing to do here is to submit this as an issue here:

https://github.com/loblab/noip-renew/issues

Posting to the generic python-list won't help anyone, because the 
script

authors likely will not see it and the python-list members haven't
anything they can do with your bug report.

Cheers,
Cameron Simpson 


--
-BEGIN EMAIL SIGNATURE-

The Gospel for all Targeted Individuals (TIs):

[The New York Times] Microwave Weapons Are Prime Suspect in Ills of
U.S. Embassy Workers

Link: 
https://www.nytimes.com/2018/09/01/science/sonic-attack-cuba-microwave.html




Singaporean Mr. Turritopsis Dohrnii Teo En Ming's Academic
Qualifications as at 14 Feb 2019 and refugee seeking attempts at the 
United Nations Refugee Agency Bangkok (21 Mar 2017), in Taiwan (5 Aug 
2019) and Australia (25 Dec 2019 to 9 Jan 2020):


[1] https://tdtemcerts.wordpress.com/

[2] https://tdtemcerts.blogspot.sg/

[3] https://www.scribd.com/user/270125049/Teo-En-Ming

-END EMAIL SIGNATURE-
--
https://mail.python.org/mailman/listinfo/python-list


Re: I discovered a bug in the no-ip dynamic dns free hostname auto renewal/confirmation script written by loblab

2020-08-16 Thread Cameron Simpson
On 16Aug2020 17:41, Turritopsis Dohrnii Teo En Ming  
wrote:
>Subject: I discovered a bug in the no-ip dynamic dns free hostname 
>auto renewal/confirmation script written by loblab

The best thing to do here is to submit this as an issue here:

https://github.com/loblab/noip-renew/issues

Posting to the generic python-list won't help anyone, because the script 
authors likely will not see it and the python-list members haven't 
anything they can do with your bug report.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40424] AIX: makexp_aix, parallel build (failures) and ld WARNINGS

2020-08-16 Thread Michael Felt

Michael Felt  added the comment:

If #19521 had been merged I would be all for closing this as a duplicate. 
However, if i have read all the comments correctly noone has tested the other 
pr. 

As the approaches are quite different I think both should be open until a 
decision is made on the better approach. 

Closing one (asap) is a good idea, especially if that leads to something being 
merged so this is finally repaired. 

Sent from my iPhone

> On 15 Aug 2020, at 23:07, Stefan Krah  wrote:
> 
> 
> Stefan Krah  added the comment:
> 
> I understand that both of you are in favor of #19521 (the patch of
> which I have not tried yet).
> 
> Can we close this as a duplicate? Please just reopen if you disagree.
> 
> --
> nosy: +skrah
> resolution:  -> duplicate
> stage: patch review -> resolved
> status: open -> closed
> superseder:  -> Parallel build race condition on AIX since python-2.7
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue38379] finalizer resurrection in gc

2020-08-16 Thread Lewis Gaul


Lewis Gaul  added the comment:

You're right that's how I had interpreted it, thanks for clarifying.

I was wondering if this could be related to an issue I've hit with gc.collect() 
getting slower and slower in a test suite, but that now seems unlikely, so I 
won't go into that here.

--

___
Python tracker 

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



[issue38379] finalizer resurrection in gc

2020-08-16 Thread Tim Peters


Tim Peters  added the comment:

I suspect you're reading some specific technical meaning into the word "block" 
that the PR and release note didn't intend by their informal use of the word. 
But I'm unclear on what technical meaning you have in mind.

Before the change, gc "just gave up" after seeing a resurrection, ending the 
then-current cyclic gc run. It that sense, yes, resurrection "blocked" gc from 
making progress. It did not, e.g., "block" the interpreter in the sense of 
deadlock, or of waiting for some lock to be released, or of waiting for a 
network request to respond, or ...

--

___
Python tracker 

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



[issue13322] The io module doesn't support non-blocking files

2020-08-16 Thread Bar Harel

Bar Harel  added the comment:

I have experienced both ״TypeError: can't concat NoneType to bytes״, and the 
fact BufferedIO returns None.

@pitrou @izbyshev contrary to your belief, I think there is at least some 
interest in this issue. Every few months another ticket is opened about a 
different aspect of the same underlying problem.

--
nosy: +bar.harel

___
Python tracker 

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



[issue38379] finalizer resurrection in gc

2020-08-16 Thread Lewis Gaul


Lewis Gaul  added the comment:

I noticed this bug is mentioned in the 3.9 release notes with a note similar to 
the title of the 4th PR: "garbage collection does not block on resurrected 
objects".

I can't see any mention of a blocking issue here on the issue:

> The bug:  the stats keep claiming gc is collecting an enormous number of 
> objects, but in fact it's not collecting any.  Objects in the unreachable set 
> shouldn't add to the "collected" count unless they _are_ collected.

Would someone be able to elaborate on the blocking issue that was fixed as part 
of this BPO?

--
nosy: +LewisGaul

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-08-16 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Implementing a work-around solely based on x64 ABI is not correct.

But AFAIK the test_array_in_struct test passes on AIX and exercises the 
workaround - why does it work if the workaround is faulty? If OTOH the test is 
faulty, could you update it with code that fails on AIX, as I suggested earlier?

--

___
Python tracker 

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



[issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler

2020-08-16 Thread Vinay Sajip


Change by Vinay Sajip :


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



[issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler

2020-08-16 Thread miss-islington


miss-islington  added the comment:


New changeset 08f0a2109297e8a64e8636d47dce737e5b7ccf2c by Miss Islington (bot) 
in branch '3.8':
[3.8] bpo-41503: Fix race between setTarget and flush in 
logging.handlers.MemoryHandler (GH-21765) (GH-21898)
https://github.com/python/cpython/commit/08f0a2109297e8a64e8636d47dce737e5b7ccf2c


--

___
Python tracker 

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



[issue35058] Unable to Install Python on Windows

2020-08-16 Thread sahiba


sahiba  added the comment:

Can you please find the log files and attach them or you could also provide the 
download link as without it there is nothing that can be done.

--
nosy: +sahiba007

___
Python tracker 

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



[issue41032] locale.setlocale example incorrect

2020-08-16 Thread Barathwaja


Barathwaja  added the comment:

Hi Marco,

Can I work on this?

--
nosy: +Barathwaja

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-16 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Further proposal: Rename my _login_tty to login_tty and make it available as a 
part of the pty library. Note that usually login_tty accompanies openpty and 
forkpty on a system; for example, see

https://www.man7.org/linux/man-pages/man3/login_tty.3.html
https://man.openbsd.org/login_tty
https://netbsd.gw.com/cgi-bin/man-cgi?login_tty++NetBSD-current

However, python's pty only offers openpty and forkpty in the form of 
pty.openpty and pty.fork respectively. While it is true that forkpty [ pty.fork 
] combines openpty, fork, and login_tty, it also closes the slave end of the 
pty, making it unsuitable for situations where the slave end needs to be kept 
open; for example, in my patch, the slave end is used to set the window size; 
or, in case someone wants to do even better and register a SIGWINCH handler for 
situations in which the window size can change.

--

___
Python tracker 

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



I discovered a bug in the no-ip dynamic dns free hostname auto renewal/confirmation script written by loblab

2020-08-16 Thread Turritopsis Dohrnii Teo En Ming
Subject: I discovered a bug in the no-ip dynamic dns free hostname auto 
renewal/confirmation script written by loblab


Good day from Singapore,

Programming code troubleshooting person: Mr. Turritopsis Dohrnii Teo En 
Ming (Targeted Individual)

Country: Singapore
Date: 15 to 16 August 2020 Singapore Time (Saturday and Sunday)

My IT consulting company in Singapore asked me to install a Linux 
virtual machine so that we can run no-ip dynamic dns free hostname auto 
renewal/confirmation script written by loblab. I am an IT consultant in 
Singapore, 42 years old as of 16 Aug 2020.


I am not a Python or Java programmer or software developer. The last 
time I had formal training in structured C programming (not C++ objected 
oriented programming) was more than 20 years ago at Singapore 
Polytechnic (Diploma in Mechatronics Engineering course year 1995-1998). 
Although I am not a programmer or software developer, I can still more 
or less understand the flow of programming code.


I chose Debian 10.5 64-bit Linux to install as my virtual machine/guest 
operating system because loblab mentioned that his scripts have been 
tested on Debian 9.x/10.x. But first I have to install VMware 
Workstation Pro 15.5.6 in my Ubuntu 18.04.3 LTS Linux desktop operating 
system. The iso file I downloaded is debian-10.5.0-amd64-netinst.iso.


The virtual network adapter in my Debian 10.5 Linux virtual machine was 
configured to use Network Address Translation (NAT). You can verify the 
IP address of your VM with the following Linux commands:


$ ip a

$ ip route

Give your Debian 10.5 Linux VM at least 2 GB of RAM.

After installing Debian 10.5 Linux virtual machine (minimal installation 
with SSH server and standard system utilities), I need to do a few more 
things, as follows.


# apt install sudo

# usermod -aG sudo teo-en-ming

# groups teo-en-ming

So that I can sudo as a regular Linux user.

# apt install git

Then I downloaded the no-ip ddns free hostname auto renewal/confirmation 
script using git clone.


Software: Script to auto renew/confirm noip.com free hosts
Download link: https://github.com/loblab/noip-renew
Programmer: loblab

I believe programmer loblab is based in China.

The version of the scripts I downloaded is 1.1 dated 18 May 2020.

The composition of the software is 58.4% Python programming language, 
36% Linux shell scripts, and 5.6% Dockerfile.


I tried to run setup.sh Linux shell script and choose "Install/Repair 
Script". But I found out that nothing is being installed in 
/usr/local/bin after a few installation attempts.


I thought the scripts/installation were being blocked by AppArmor, so I 
went to disable AppArmor using the following Linux commands.


$ sudo mkdir -p /etc/default/grub.d
$ echo 'GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT 
apparmor=0"' \

  | sudo tee /etc/default/grub.d/apparmor.cfg
$ sudo update-grub
$ sudo reboot

$ aa-enabled
$ sudo aa-status

But AppArmor is NOT the cause of the problem.

I began to examine the Python programming code and Linux shell scripts.

For the setup.sh script, when you choose "Install/Repair Script", it 
will call the installer() function. Inside the installer() function, it 
will call the following functions, in sequence:


config(), install(), deploy()

When the install() function was called, it tried to execute the 
following Linux command:


$SUDO apt -y install chromium-browser # Update Chromium Browser or 
script won't work.


Executing the above Linux command resulted in an ERROR because Debian 
10.5 Linux does not have the chromium-browser software package. Instead 
it has the chromium package.


When the above error is encountered, the installer script ABORTED 
PREMATURELY and could not continue running. The installer script could 
not run to completion. This is the bug.


To fix the bug, I have to COMMENT OUT/DISABLE the following line in 
setup.sh script:


$SUDO apt -y install chromium-browser # Update Chromium Browser or 
script won't work.


And add the following line below the above-mentioned line:

$SUDO apt -y install chromium

It fixed the bug. I ran setup.sh script again, choose "Install/Repair 
Script", and the installer ran to completion. Finally the scripts are 
installed in /usr/local/bin.


Please DO NOT add your no-ip account password to noip-renew.sh script 
manually in plain text because it has to be Base64 encoded/encrypted. If 
you add your no-ip account password directly to noip-renew.sh script, 
you will get an "Incorrect Padding" Python programming base64 error 
code.


You need to supply the no-ip account password when you run the installer 
script. When the installer script calls the deploy() function, it will 
also call the noip() function.


The noip() function is as follows:

function noip() {
echo "Enter your No-IP Account details..."
read -p 'Username: ' uservar
read -sp 'Password: ' passvar

passvar=`echo -n $passvar | base64`
echo

$SUDO sed -i 

[issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler

2020-08-16 Thread miss-islington


miss-islington  added the comment:


New changeset 2c050e52f1ccf5db03819e4ed70690521d67e9fa by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-41503: Fix race between setTarget and flush in 
logging.handlers.MemoryHandler (GH-21765) (GH-21897)
https://github.com/python/cpython/commit/2c050e52f1ccf5db03819e4ed70690521d67e9fa


--

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-08-16 Thread David Edelsohn


David Edelsohn  added the comment:

Yes, it doesn't appear that it will be solved in libffi.  I don't fully 
understand the need for the work-around because it should gracefully overflow 
to the stack.  I can't tell if the issue is a problem with arguments passed by 
value that need to be passed partially in registers and partially in the stack.

But if the work-around is necessary, it is target- and ABI-dependent: the 
number of arguments passed in registers is target- and ABI-dependent.  
Implementing a work-around solely based on x64 ABI is not correct.  The ctypes 
stgdict.c code needs to define MAX_STRUCT_SIZE based on the target, at least 
for the targets that experience the problem.

--

___
Python tracker 

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



[issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler

2020-08-16 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +21016
pull_request: https://github.com/python/cpython/pull/21897

___
Python tracker 

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



[issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler

2020-08-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21017
pull_request: https://github.com/python/cpython/pull/21898

___
Python tracker 

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



[issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler

2020-08-16 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 2353d77fad7ed9d11d8a4d66b5dd1306cdb94125 by Irit Katriel in 
branch 'master':
bpo-41503: Fix race between setTarget and flush in 
logging.handlers.MemoryHandler (GH-21765)
https://github.com/python/cpython/commit/2353d77fad7ed9d11d8a4d66b5dd1306cdb94125


--

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-08-16 Thread Vinay Sajip


Vinay Sajip  added the comment:

> an array definition in a structure is always part of the struct itself and is 
> never a pointer

True, but a problem only arises in practice when passing by value in registers. 
It's still an open libffi issue that doesn't look like it's going to be solved 
any time soon, hence the attempted workaround in ctypes.

https://github.com/libffi/libffi/issues/33

--

___
Python tracker 

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



[issue33051] IDLE: Create new tab for editor options in configdialog

2020-08-16 Thread E. Paine


E. Paine  added the comment:

Thank you Cheryl for linking this issue on #40468 (I didn't find this when 
researching for existing issues). I have briefly tested the PR and it seems 
perfect, though seeing `init_validators` made me think we should possibly have 
an ABC for the tab pages. This would be a separate issue, but I think there 
would be three main advantages:
1. We could enforce a more standard naming of page methods (`create_page_*` 
would become `create_page` and be called by the parent, for example)
2. We could share methods like `init_validators` (which would preferably be 
part of the class but I appreciate the need to move it in this PR)
3. We can also potentially remove the example `TabPage` as the ABC would serve 
as its own example

Back to this issue, I didn't scrutinise it but the PR looks good and the 
"result" (user-facing) is exactly as I would propose based on #40468.

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-16 Thread aaliddell


Change by aaliddell :


--
nosy: +aaliddell

___
Python tracker 

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



Re: try..except or type() or isinstance()?

2020-08-16 Thread Alexa Oña
Sorry... i have received a lot of messages from python support and I still 
didn’t understand how to fix it

Obtener Outlook para iOS

De: Python-list  
en nombre de Manfred Lotz 
Enviado: Sunday, August 16, 2020 9:48:07 AM
Para: python-list@python.org 
Asunto: Re: try..except or type() or isinstance()?

On Sun, 16 Aug 2020 09:40:12 +0200
Manfred Lotz  wrote:

> On Sat, 15 Aug 2020 12:20:48 -0400
> Dennis Lee Bieber  wrote:
>
> > On Sat, 15 Aug 2020 15:31:56 +0200, Manfred Lotz 
> > declaimed the following:
> >
> > >On Sat, 15 Aug 2020 11:47:03 +0200
> > >Sibylle Koczian  wrote:
> > >
> >
> > >> if the value comes from a file, isn't it a
> > >> string in any case? A string that may be convertible to int or
> > >> not? Or what sort of file do I overlook?
> > >>
> > >
> > >In this case it is a TOML file.
> >
> >  Based on https://en.wikipedia.org/wiki/TOML this means you
> > need a parser...
> > """
> > In TOML the syntax determines the data types ("syntax typing")
> > """
> >
> >  String data is surrounded with " marks, numbers are not
> > (though the example doesn't show if integers are treated differently
> > from floating point), arrays/lists in [] with embedded comma ([] are
> > also overloaded for section headers, with subsections using
> > section.subsection naming), dates are some ugly creation, and looks
> > like true/false are reserved values.
> >
> >  However, as pointed out -- all data read from the file will
> > be seen as a Python string data type. It is only after determining
> > the TOML data type -- by examining the string itself -- that one can
> > convert to internal format.
> >
> >  Unfortunately, TOML is not compatible with INI -- for which
> > Python already has a read/write module. But there is
> > https://pypi.org/project/toml/
> > (uses the same example file as Wikipedia) -- latest version was from
> > May.
> >
> >
>
> I use tomlkit as the toml package doesn't support quoted keys
> sufficiently.
>

Just checked again. It seems I was wrong. Both toml and tomlkit do
support quoted keys ok.

--
Manfred

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


[issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler

2020-08-16 Thread Irit Katriel


Change by Irit Katriel :


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



[issue38628] Issue with ctypes in AIX

2020-08-16 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

As mentioned before I haven't studied the ctypes code base, but I am a bit 
worried about the use of MAX_STRUCT_SIZE, an array definition in a structure is 
always part of the struct itself and is never a pointer.

I agree with Vinay that there needs to be a unittest that demonstrates the 
problem.

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



[issue41563] .python_history file causes considerable slowdown

2020-08-16 Thread bytecookie


bytecookie  added the comment:

Using Python 3.8.3 on Windows 10 1803

--

___
Python tracker 

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



[issue41563] .python_history file causes considerable slowdown

2020-08-16 Thread Denniver


New submission from Denniver :

The seemingly unlimited growth of the ".python_history"-file seems to cause a 
massive slowdown when starting or exiting python, the same after running 
commands.
On one machine python took about 3 minutes to start and I found out that while 
it is seemingly doing nothing, it was constantly aceesing the 
".python_history"-file, which was 130 Mb large. After deleting the file, 
anything was back to normal.

--
components: Build
messages: 375505
nosy: bytecookie
priority: normal
severity: normal
status: open
title: .python_history file causes considerable slowdown
type: performance
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



Re: Syntax question

2020-08-16 Thread Manfred Lotz
On Sun, 16 Aug 2020 06:09:17 -0500
Skip Montanaro  wrote:

> > Typing is not required by
> > Python. However, you may find the extra error-checking helpful...  
> 
> I haven't used type hints much, if at all, but my understanding is
> that the "extra error-checking" of which you speak is gotten through
> other static checkers, correct? 

Yes.

> I know the syntax was developed with
> the MyPy folks (http://mypy-lang.org/), but I'm not sure what other
> tools currently make use of it. Any pointers?
> 

I heard about the following (not tried all, though)

- mypy (Dropbox)
- pyre-check (Facebook)
- pytype (Google)
- pyright (Microsoft)


-- 
Manfred

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


Re: Syntax question

2020-08-16 Thread Skip Montanaro
> Typing is not required by
> Python. However, you may find the extra error-checking helpful...

I haven't used type hints much, if at all, but my understanding is
that the "extra error-checking" of which you speak is gotten through
other static checkers, correct? I know the syntax was developed with
the MyPy folks (http://mypy-lang.org/), but I'm not sure what other
tools currently make use of it. Any pointers?

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


Re: Syntax question

2020-08-16 Thread Manfred Lotz
On Sun, 16 Aug 2020 10:12:04 +0200
Klaus Jantzen  wrote:

> Hi,
> 
> the other day I came across the book "Classic Computer Science
> Problems in Python" by David Kopec.
> 
> The function definitions in the examples  like
> 
> =
> def fib2(n: int) -> int:
>      if n < 2:  # base case
>      return n
>      return fib2(n - 2) + fib2(n - 1)  # recursive case
> 
> 
> if __name__ == "__main__":
>      print(fib2(5))
>      print(fib2(10))
> 
> =
> 
> use a syntax that I have never seen on this list or in other
> publications.
> 

What do you mean? The 'n:int' and '-> int'? If yes, this is type
hinting.

See here: https://docs.python.org/3/library/typing.html

-- 
Manfred

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


Re: Syntax question

2020-08-16 Thread dn via Python-list

On 16/08/2020 20:12, Klaus Jantzen wrote:

Hi,

the other day I came across the book "Classic Computer Science Problems 
in Python" by David Kopec.


The function definitions in the examples  like

=
def fib2(n: int) -> int:
     if n < 2:  # base case
     return n
     return fib2(n - 2) + fib2(n - 1)  # recursive case


if __name__ == "__main__":
     print(fib2(5))
     print(fib2(10))

=

use a syntax that I have never seen on this list or in other publications.


About which line of code are you asking?

> def fib2(n: int) -> int:

Please review: Type Hints:
https://docs.python.org/3/library/typing.html

> if __name__ == "__main__":

https://docs.python.org/3/library/__main__.html
https://docs.python.org/3/reference/import.html


My questions:

Is that new?


Typing: v3.5+ (IIRC)



Is is 'recommended' to use this is the future?


Yes and no. The operative word is "Hints". Typing is not required by 
Python. However, you may find the extra error-checking helpful...



I can only see a certain advantage of using this type of function 
definition in resp. to the documentation, as it does not provide an 
automatic check of the type of the argument(s) or of the result as in Java.


There are 'pros' and 'cons'!
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


[issue41551] test.support has way too many imports in libregrtest

2020-08-16 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



Syntax question

2020-08-16 Thread Klaus Jantzen

Hi,

the other day I came across the book "Classic Computer Science Problems 
in Python" by David Kopec.


The function definitions in the examples  like

=
def fib2(n: int) -> int:
    if n < 2:  # base case
    return n
    return fib2(n - 2) + fib2(n - 1)  # recursive case


if __name__ == "__main__":
    print(fib2(5))
    print(fib2(10))

=

use a syntax that I have never seen on this list or in other publications.

My questions:

Is that new?

Is is 'recommended' to use this is the future?

I can only see a certain advantage of using this type of function 
definition in resp. to the documentation, as it does not provide an 
automatic check of the type of the argument(s) or of the result as in Java.


--

K.D.J.

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


Re: try..except or type() or isinstance()?

2020-08-16 Thread Manfred Lotz
On Sun, 16 Aug 2020 09:40:12 +0200
Manfred Lotz  wrote:

> On Sat, 15 Aug 2020 12:20:48 -0400
> Dennis Lee Bieber  wrote:
> 
> > On Sat, 15 Aug 2020 15:31:56 +0200, Manfred Lotz 
> > declaimed the following:
> >   
> > >On Sat, 15 Aug 2020 11:47:03 +0200
> > >Sibylle Koczian  wrote:
> > >
> >   
> > >> if the value comes from a file, isn't it a
> > >> string in any case? A string that may be convertible to int or
> > >> not? Or what sort of file do I overlook?
> > >> 
> > >
> > >In this case it is a TOML file. 
> > 
> > Based on https://en.wikipedia.org/wiki/TOML this means you
> > need a parser... 
> > """
> > In TOML the syntax determines the data types ("syntax typing")
> > """
> > 
> > String data is surrounded with " marks, numbers are not
> > (though the example doesn't show if integers are treated differently
> > from floating point), arrays/lists in [] with embedded comma ([] are
> > also overloaded for section headers, with subsections using
> > section.subsection naming), dates are some ugly creation, and looks
> > like true/false are reserved values.
> > 
> > However, as pointed out -- all data read from the file will
> > be seen as a Python string data type. It is only after determining
> > the TOML data type -- by examining the string itself -- that one can
> > convert to internal format.
> > 
> > Unfortunately, TOML is not compatible with INI -- for which
> > Python already has a read/write module. But there is
> > https://pypi.org/project/toml/
> > (uses the same example file as Wikipedia) -- latest version was from
> > May.
> > 
> >   
> 
> I use tomlkit as the toml package doesn't support quoted keys
> sufficiently.
> 

Just checked again. It seems I was wrong. Both toml and tomlkit do
support quoted keys ok.

-- 
Manfred

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


Re: try..except or type() or isinstance()?

2020-08-16 Thread Manfred Lotz
On 15 Aug 2020 14:49:48 GMT
r...@zedat.fu-berlin.de (Stefan Ram) wrote:

> Manfred Lotz  writes:
> >Here a minimal example  
> 
>   main.py
> 
> source="""
> sehr gut
> 1
> """[ 1: -1 ].split( "\n" )
> 
> class grades:
> names =[ "sehr gut" ]
> @staticmethod
> def is_numeric( text ):
> return text.isdigit()
> @staticmethod
> def get_number( text ):
> return grades.names.index( text )+ 1
> @staticmethod
> def get_name( text ):
> return grades.names[ int( text )- 1 ]
> 
> class O1:
> def init_from_number( self, text ):
> self.myid = int( text )
> self.name = grades.get_name( text )
> def init_from_name( self, text ):
> self.myid = grades.get_number( text )
> self.name = text
> def __init__( self, text ):
> if grades.is_numeric( text ):
> self.init_from_number( text )
> else:
> self.init_from_name( text )
> def __str__( self ):
> return "O1( " + str( self.myid )+ ", " + str( self.name ) + "
> )" 
> for line in source:
> print( O1( line ))
> 
> 
>   transcript:
> 
> O1( 1, sehr gut )
> O1( 1, sehr gut )
> 
> 

Thanks for this interesting variation. 

-- 
Manfred

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


Re: try..except or type() or isinstance()?

2020-08-16 Thread Manfred Lotz
On Sat, 15 Aug 2020 12:20:48 -0400
Dennis Lee Bieber  wrote:

> On Sat, 15 Aug 2020 15:31:56 +0200, Manfred Lotz 
> declaimed the following:
> 
> >On Sat, 15 Aug 2020 11:47:03 +0200
> >Sibylle Koczian  wrote:
> >  
> 
> >> if the value comes from a file, isn't it a
> >> string in any case? A string that may be convertible to int or
> >> not? Or what sort of file do I overlook?
> >>   
> >
> >In this case it is a TOML file.   
> 
>   Based on https://en.wikipedia.org/wiki/TOML this means you
> need a parser... 
> """
> In TOML the syntax determines the data types ("syntax typing")
> """
> 
>   String data is surrounded with " marks, numbers are not
> (though the example doesn't show if integers are treated differently
> from floating point), arrays/lists in [] with embedded comma ([] are
> also overloaded for section headers, with subsections using
> section.subsection naming), dates are some ugly creation, and looks
> like true/false are reserved values.
> 
>   However, as pointed out -- all data read from the file will
> be seen as a Python string data type. It is only after determining
> the TOML data type -- by examining the string itself -- that one can
> convert to internal format.
> 
>   Unfortunately, TOML is not compatible with INI -- for which
> Python already has a read/write module. But there is
> https://pypi.org/project/toml/
> (uses the same example file as Wikipedia) -- latest version was from
> May.
> 
> 

I use tomlkit as the toml package doesn't support quoted keys
sufficiently.

-- 
Manfred


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


[issue41562] StreamReaderProtocol inheritance

2020-08-16 Thread Dan Pascu


New submission from Dan Pascu :

I noticed that StreamReaderProtocol is defined like this:

class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
...

but FlowControlMixin already inherits protocols.Protocol:

class FlowControlMixin(protocols.Protocol):
...

It seems redundant that StreamReaderProtocol has protocols.Protocol as a second 
base class (is this an oversight or I'm missing some hidden reasoning behind it 
in which case it might be useful to have it mentioned in a comment to avoid 
confusion).

--
components: asyncio
messages: 375504
nosy: asvetlov, danpascu777, yselivanov
priority: normal
severity: normal
status: open
title: StreamReaderProtocol inheritance
type: enhancement
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



Re: How to install your personal module/package on site.

2020-08-16 Thread Marco Sulla
Sorry, didn't read well, Apart the other suggestion, you (or your
sysop) can create a private Pypi:
https://pypi.org/project/private-pypi/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to install your personal module/package on site.

2020-08-16 Thread dn via Python-list

Does the word "public" mean world-wide, or perhaps only amongst your 
work-colleagues?


Only among work-colleagues.

We only want that anyone writing and running python scripts on particular 
hosts, can
easily import these modules/packages.



Of possible interest:-
Private Python package management
https://stackoverflow.com/questions/63320653/private-python-package-management
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list