[issue42627] urllib.request.getproxies() misparses Windows registry proxy settings

2021-03-04 Thread 狂男风

狂男风  added the comment:

We know Windows reslove:
`http=host:port;https=host:port;ftp=host:port;socks=host:port`
as:
`http=http://host:port;https=http://host:port;ftp=http://host:port;socks=socks://host:port`
means:  
Using HTTP type proxy for HTTP, HTTPS and FTP requests, but Socks4/4a type 
proxy for the other TCP requests.
We notice that socks are different from the others.

Now I want to know what if Windows slove this:
`http=socks://host:port;ftp=https://host:port;socks=https://host:port`
Does it mean using Socks4/4a type proxy for HTTP requests, HTTPS type proxy for 
FTP requests, and HTTP type proxy for the other TCP requests? 
Or just invalid settings?

--

___
Python tracker 

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



[issue43300] "bisect" module should support reverse-sorted sequences

2021-03-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank you for the suggestion, but am going close this for the reasons mentioned 
above.

--
resolution:  -> rejected
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



[issue43395] os.path states that bytes can't represent all MBCS paths under Windows

2021-03-04 Thread Eric L.


Eric L.  added the comment:

Very confusing but very interesting. I'm trying to follow as I'm the main 
maintainer of the rdiff-backup software, which goes cross-platforms, so these 
small differences might become important.

Now, looking into the docs, following your explanations, I noticed that 
https://docs.python.org/3/library/os.html#os.fsencode and 
https://docs.python.org/3/library/os.html#os.fsdecode state that the 'strict' 
error handler is used under Windows instead of the stated 'surrogatepass'. 
Again an issue with the documentation?

Also, the 2nd paragraph of 
https://docs.python.org/3.8/library/os.html#file-names-command-line-arguments-and-environment-variables
 speaks only of surrogateescape and doesn't make the difference between POSIX 
and Windows.

Very interesting but very confusing...

--

___
Python tracker 

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



[issue42627] urllib.request.getproxies() misparses Windows registry proxy settings

2021-03-04 Thread 狂男风

Change by 狂男风 :


--
nosy: +CrazyBoyFeng

___
Python tracker 

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



[issue43390] Set the SA_ONSTACK in PyOS_setsig to play well with other VMs like Golang

2021-03-04 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I expect zero fallout from this given the semantics.  SA_ONSTACK really appears 
to be something that should've been the POSIX default since it was introduced 
as a feature in ~BSD4.2 in the early 80s.  But it never was.

It'll be good to have in the beta releases to see if anyone pipes up.

We'll be running our interpreter inside Google with this flag enabled.

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

___
Python tracker 

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



[issue43390] Set the SA_ONSTACK in PyOS_setsig to play well with other VMs like Golang

2021-03-04 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 02ac6f41e5569ec28d625bb005155903f64cc9ee by Gregory P. Smith in 
branch 'master':
bpo-43390: Set SA_ONSTACK in PyOS_setsig (GH-24730)
https://github.com/python/cpython/commit/02ac6f41e5569ec28d625bb005155903f64cc9ee


--

___
Python tracker 

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



[issue43404] No SSL certificates when using the Mac installer

2021-03-04 Thread Ned Deily


Ned Deily  added the comment:

When installing current Pythons for macOS downloaded from python.org, you will 
need to run the "Install Certificates.command" file installed into the 
/Applications/Python 3.x" folder for the version installed. This is noted in 
the initial screen when running the installer:

"At the end of this install, click on Install Certificates to install a set of 
current SSL root certificates."

It is also described in more detail in the "Read Me" file is also displayed by 
the installer and a copy of which is also installed in the /Applications/Python 
3.x folder.

"Certificate verification and OpenSSL

This package includes its own private copy of OpenSSL 1.1.1.   The trust 
certificates in system and user keychains managed by the Keychain Access 
application and the security command line utility are not used as defaults by 
the Python ssl module.  A sample command script is included in 
/Applications/Python 3.9 to install a curated bundle of default root 
certificates from the third-party certifi package 
(https://pypi.org/project/certifi/).  Double-click on Install Certificates to 
run it.

The bundled pip has its own default certificate store for verifying download 
connections."

The installer also opens the /Applications/Python 3.x folder in a Finder window 
to make all of these files immediately accessible.

--
nosy: +ned.deily
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



[issue43372] ctypes: test_frozentable fails when make regen-frozen

2021-03-04 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
assignee:  -> nascheme

___
Python tracker 

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



[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-04 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
pull_requests: +23532
pull_request: https://github.com/python/cpython/pull/24759

___
Python tracker 

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



[issue43372] ctypes: test_frozentable fails when make regen-frozen

2021-03-04 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
pull_requests: +23531
pull_request: https://github.com/python/cpython/pull/24759

___
Python tracker 

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



[issue43400] Improve recipes and howtos for the unittest.mock

2021-03-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Renaming this issue to reflect a shift in focus towards broader improvements to 
the documentation.

--
title: Remove "Mock is very easy to use" from unittest.mock documentation -> 
Improve recipes and howtos for the unittest.mock
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



[issue43400] Improve recipes and howtos for the unittest.mock

2021-03-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue43405] DeprecationWarnings in test_unicode

2021-03-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The changes were introduced in https://bugs.python.org/issue36346

--
nosy: +methane, xtreak

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Mock has a section on getting started that has several recipes but it's not 
under howto section. Perhaps this page could be updated if you want to make a 
PR : https://docs.python.org/3/library/unittest.mock-examples.html

There is also a section on where to patch : 
https://docs.python.org/3/library/unittest.mock.html#where-to-patch

I admit it also bites me few times and I have to do trial and error to get the 
right patch object.

--

___
Python tracker 

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



[issue40578] Deprecate numeric item access for platform.uname()

2021-03-04 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

For posterity, I'll share my motivation.

> Why is it a problem that people are using something which is documented as a 
> tuple?

It's not a problem that they access it by tuple if it's documented.

The problem is that it's documented for access as a tuple when there is a 
superior method to access (by attribute) that's less opaque than the historical 
method by index.

I apologize for not documenting that in the original post. It seemed obvious to 
me at the time that having one obvious way to access the items would be 
preferred.

For example, `uname()[0]` doesn't mean anything to me without a comment or 
referencing the documetation, whereas `uname().system` does.

Access by numerical index hearkens back to C-style arrays and in my mind is an 
anti-pattern.

--

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 0dd4cb944b497dc6bd0b3763e461d72e9a7b6490 by Miss Islington (bot) 
in branch '3.9':
bpo-43400: Remove "easy to use" from mock docs (GH-24752) (GH-24758)
https://github.com/python/cpython/commit/0dd4cb944b497dc6bd0b3763e461d72e9a7b6490


--

___
Python tracker 

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



[issue43364] Windows: Make UTF-8 mode more accessible

2021-03-04 Thread Inada Naoki


Change by Inada Naoki :


--
title: Add shortcut to enable UTF-8 mode in start menu. -> Windows: Make UTF-8 
mode more accessible

___
Python tracker 

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



[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 2122e486307d5577cb5fb5e7cfd24095695bc7e9 by Eddie Peters in 
branch 'master':
bpo-43400: Remove "easy to use" from mock docs (GH-24752)
https://github.com/python/cpython/commit/2122e486307d5577cb5fb5e7cfd24095695bc7e9


--

___
Python tracker 

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



[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 for back porting, but check with the RM first.

--
nosy: +rhettinger

___
Python tracker 

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



[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2021-03-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Turns out this didn't fix all possible situations. See bpo-43406 for an updated 
patch.

--

___
Python tracker 

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



[issue39169] TypeError: 'int' object is not callable if the signal handler is SIG_IGN

2021-03-04 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder:  -> Possible race condition between signal catching and 
signal.signal

___
Python tracker 

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



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer


Change by Alex Willmer :


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

___
Python tracker 

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



Re: program python

2021-03-04 Thread Igor Korot
Hi,

On Thu, Mar 4, 2021 at 4:42 PM alberto  wrote:
>
> Il giorno giovedì 4 marzo 2021 alle 22:04:57 UTC+1 Paul Bryan ha scritto:
> > I don't see a Python program in that link.
> >
> > Are you asking how to extract data from a CSV?
> > A good start will be to look into the csv.reader function and
> > csv.DictReader class.
> >
> > Paul
> > On Thu, 2021-03-04 at 12:36 -0800, alberto wrote:
> > > Hi I'm tring to write a program with python to evaluate data of csv
> > > data
> > > In particular I would extract this information
> > >
> > > View data on the presence of men and women in Affori over time.
> > >
> > > * Carry out an analysis relating to the last available year. Of the
> > > 10 most populous neighborhoods show:
> > > * the proportion of births out of the total
> > > * the proportion of 80+ to the total
> > > * The ratio of minors / number of kindergartens
> > >
> > > this is the file
> > > https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing
> > >
> > > How could fix it?
> > >
> > > regards
>
> Hi,
> with this code
> import pandas as pd
> df = pd.read_csv('data.csv',usecols=['Uomini','Donne'])
>
> print(df)
> I extract two columns, but I would see 'Affori over time'

And if you add this column to the list - what happens?

Thank you.

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


Re: program python

2021-03-04 Thread alberto
Il giorno giovedì 4 marzo 2021 alle 22:04:57 UTC+1 Paul Bryan ha scritto:
> I don't see a Python program in that link. 
> 
> Are you asking how to extract data from a CSV? 
> A good start will be to look into the csv.reader function and 
> csv.DictReader class. 
> 
> Paul
> On Thu, 2021-03-04 at 12:36 -0800, alberto wrote: 
> > Hi I'm tring to write a program with python to evaluate data of csv 
> > data 
> > In particular I would extract this information 
> > 
> > View data on the presence of men and women in Affori over time. 
> > 
> > * Carry out an analysis relating to the last available year. Of the 
> > 10 most populous neighborhoods show: 
> > * the proportion of births out of the total 
> > * the proportion of 80+ to the total 
> > * The ratio of minors / number of kindergartens 
> > 
> > this is the file 
> > https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing
> >  
> > 
> > How could fix it? 
> > 
> > regards

Hi, 
with this code
import pandas as pd
df = pd.read_csv('data.csv',usecols=['Uomini','Donne'])

print(df)
I extract two columns, but I would see 'Affori over time'

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


[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer


Alex Willmer  added the comment:

Discussion from #python IRC

[21:51]  Given `a=time.monotonic(); b=time.monotonic(); 
c=time.monotonic()` is `c-a < delta` a valid comparison? Until this evening I 
thought so, but I've just read 
https://docs.python.org/3/library/time.html#time.monotonic and the wording it 
uses is "only the difference between the results of consecutive calls is valid" 
implying `b-a < delta` is valid, or `c-b < delta`; but not `c-a < delta`. Am I 
understanding the wording correctly?
[21:52]  IOW is it literally only call n, and n+1. or n, and n+m?
[21:53]  moreati, I think "consecutive" is incorrect there, based on 
the rest of that sentence.
[21:57]  moreati SnoopJ yes, I agree, the consecutive wording has 
tripped me up when I first started using monotonic. I think there's an 
understated transitive property that allows a to c comparisons just fine.
[21:58]  jarthur, yea, it would be deeply weird if `b-a` and `c-b` were 
meaningful deltas, but `c-a` was not
[21:59]  re time.monotonic() the only reason I could of for the 
literal interpretation of the wording is an overflow, or integer wraparound 
corner case
[22:00]  weirdly, the CPython doc uses the same language
[22:02]  I actually ended up looking at the monotonic code a while 
back, and at least back then the wraparound case is really hard to reach, maybe 
possible on Windows if you haven't called it in a while. Either way, there was 
nothing in the Linux/glibc or Windows calls used that would have made the 
wraparound/overflow case apply to skipped evaluation of a middle observation 
more than it would consecutive observations.
...
[22:06]  moreati, looks like this language was added when the function 
was, and I guess maybe nobody's ever raised this complaint about the wording: 
https://hg.python.org/cpython/rev/376ce937823c
[22:07]  nice catch :)
...
[22:22]  FTR https://bugs.python.org/issue43407
[22:28]  moreati, I would recommend just submitting the PR, since it's 
docs.
[22:28]  ok
[22:28]  but I think the best wording would be something like "only the 
difference between two calls of this function is meaningful"
[22:30]  agreed, subsequent is a $5 word in a 50c requirement. May I 
quote our conversation in the ticket? Ditto jarthur
[22:30]  absolutely
[22:30]  yep
[22:30]  ty
[22:30]  but yea, just open a PR, that way you need a single pass from 
someone with authority here rather than two ;)
[22:31]  >Never use a long word where a short one will do.

--

___
Python tracker 

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



[issue28712] Non-Windows mappings for a couple of Windows code pages

2021-03-04 Thread Larry Hastings


Change by Larry Hastings :


--
nosy:  -larry

___
Python tracker 

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



[issue41324] Add a minimal decimal capsule API

2021-03-04 Thread mattip


mattip  added the comment:

Was expanding the C-API discussed on the mailing list or in any wider forum? It 
seems vstinner is working hard to reduce the public API exposure while this 
issue + PR makes it even larger. Please reconsider putting this in for 3.10.

--
nosy: +mattip

___
Python tracker 

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



Re: Problem with printing statement when condition is false

2021-03-04 Thread Terry Reedy

On 3/4/2021 3:15 PM, Terry Reedy wrote:

On 3/4/2021 12:10 PM, Quentin Bock wrote:


I won't paste the code into
this because it's 164 lines so I will attach a file copy,


The alternative to posting too much is to reduce your code to the 
minimum needed to exhibit the behavior you want to change.  Doing so may 
reveal to you the solution.  It will certainly make it easier for anyone 
else to help you and will make any answer more useful to other readers.


Quentin privately sent me 12 lines (which should have been posted here 
instead), which can be reduced to the following 4 that exhibit his bug.


if a == b:
print('correct')
if a != b:
print('incorrect')

The bug is a != b will never be true when a == b and will not be tested 
when a != b.  The fix is to use else.


if a == b:
print('correct')
else:
print('incorrect')

This should not be reduced to a conditional expression since different 
code follows the print statements in the actual example.


--
Terry Jan Reedy


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


[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer


New submission from Alex Willmer :

I believe the documentation for time.monotonic() and time.perf_counter() could 
be misleading. Taken literally they could imply that given

delta = 0.1
a = time.monotonic()
b = time.monotonic()
c = time.monotonic()

the comparisons `b - a < delta`, and `c - b < delta` are valid; but `c - a < 
delta` is not valid.

I believe that `c - a < delta` is a valid comparison, and that what the 
documentation means to say is "only the difference between the results of 
*subsequent* calls is valid."

The exact wording (present since the functions were added in 
https://hg.python.org/cpython/rev/376ce937823c)

> The reference point of the returned value is undefined, so that only
> the difference between the results of consecutive calls is valid.

If there is agreement I'll submit a PR.

--
assignee: docs@python
components: Documentation
messages: 388133
nosy: Alex.Willmer, docs@python
priority: normal
severity: normal
status: open
title: time.monotonic(): Docs imply comparing call N and call N+M is invalid 
for M>1
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43406] Possible race condition between signal catching and signal.signal

2021-03-04 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy: +neologix

___
Python tracker 

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



[issue43406] Possible race condition between signal catching and signal.signal

2021-03-04 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
keywords: +patch
pull_requests: +23527
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24756

___
Python tracker 

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



[issue28712] Non-Windows mappings for a couple of Windows code pages

2021-03-04 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue43406] Possible race condition between signal catching and signal.signal

2021-03-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Here is a reproducer:
https://gist.github.com/pitrou/e5a566e644730516b51de71145c5ea06

If you execute it, it will fail after a few iterations:

sig 2
sig 2
sig 2
Traceback (most recent call last):
  File "/home/antoine/cpython/default/setinterrupt.py", line 30, in 
main()
  File "/home/antoine/cpython/default/setinterrupt.py", line 27, in main
cycle_handlers(signum)
  File "/home/antoine/cpython/default/setinterrupt.py", line 19, in 
cycle_handlers
signal.signal(signum, handler)
  File "/home/antoine/cpython/default/Lib/signal.py", line 48, in signal
return _int_to_enum(handler, Handlers)
  File "/home/antoine/cpython/default/Lib/signal.py", line 30, in _int_to_enum
return enum_klass(value)
  File "/home/antoine/cpython/default/Lib/enum.py", line 606, in __call__
return cls.__new__(cls, value)
  File "/home/antoine/cpython/default/Lib/enum.py", line 927, in __new__
ve_exc = ValueError("%r is not a valid %s" % (value, cls.__qualname__))
TypeError: 'int' object is not callable

--

___
Python tracker 

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



[issue43406] Possible race condition between signal catching and signal.signal

2021-03-04 Thread Antoine Pitrou


New submission from Antoine Pitrou :

We can receive signals (at the C level, in trip_signal() in signalmodule.c) 
while signal.signal is being called to modify the corresponding handler.  Later 
when PyErr_CheckSignals() is called to handle the given signal, the handler may 
be a non-callable object and will raise a cryptic asynchronous exception.

--
components: Interpreter Core, Library (Lib)
messages: 388131
nosy: pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Possible race condition between signal catching and signal.signal
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



[issue43402] IDLE shell adds newline after print even when `end=''` is specificied

2021-03-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I don't know how many core devs would agree that inserting '\n' would be 
preferable.  They might say that users who want clean interaction should not 
use the 'end' parameter the way you did in interactive mode.

IDLE is more aimed at beginners and can be more protective and/or opinionated.  
In any case, I agree with whoever wrote or edited this part of IDLE before me 
as to what IDLE should do.

There are also technical  issues.  Interactive python uses the common features 
of the various OS text and line-oriented terminal/consoles.  These do not know 
and do not care that they are displaying python input and output.  They display 
chars received from the executing program and have no way of knowing that the 
last n chars match python's sys.ps1 or sys.ps2.  The prompts comes from python 
executing "input(prompt)" after user code finishes.  To conditionally insert a 
newline, python would have to keep track of whether or not the last char sent 
by user code was a newline or not.

IDLE, on the other hand, is customized to run python code.  It *emulates* 
interactive mode with exec() calls.  IDLE, not python, displays prompts however 
programmed to do so.  It is trivial to check whether the last char inserted in 
the text widget is '\n' or not.

Side note: you only need '-i' for interactive mode when you also run a file 
because 'python -i' by itself is the same as 'python'.

'python -i somefile' is different from 'python somefile' because in the latter 
case, python exits after executing somefile, whereas in the former case, python 
executes 'input(sys.ps1)' and possibly 'input(sys.ps2)' until told to quit.  
'Run module' in an IDLE editor emulates 'python -i '.

--

___
Python tracker 

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



Re: program python

2021-03-04 Thread Paul Bryan
I don't see a Python program in that link.

Are you asking how to extract data from a CSV?
A good start will be to look into the csv.reader function and
csv.DictReader class.

Paul

On Thu, 2021-03-04 at 12:36 -0800, alberto wrote:
> Hi I'm tring to write a program with python to evaluate data of csv
> data
> In particular I would extract this information 
> 
> View data on the presence of men and women in Affori over time.
> 
> * Carry out an analysis relating to the last available year. Of the
> 10 most populous neighborhoods show:
> * the proportion of births out of the total
> * the proportion of 80+ to the total
> * The ratio of minors / number of kindergartens
> 
> this is the file
> https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing
> 
> How could fix it?
> 
> regards 

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


Re: program python

2021-03-04 Thread dn via Python-list
Hi, and welcome to the list.

On 05/03/2021 09.36, alberto wrote:
> Hi I'm tring to write a program with python to evaluate data of csv data
> In particular I would extract this information 
> 
> View data on the presence of men and women in Affori over time.
> 
> * Carry out an analysis relating to the last available year. Of the 10 most 
> populous neighborhoods show:
> * the proportion of births out of the total
> * the proportion of 80+ to the total
> * The ratio of minors / number of kindergartens
> 
> this is the file
> https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing
> 
> How could fix it?


NB For security reasons, many will not follow this link/see the data-file!

There are several libraries which can be import-ed into Python, which
enable access to .csv-formatted files. The PSL (Python Standard Library)
offers "csv — CSV File Reading and Writing"
(https://docs.python.org/3/library/csv.html).

Start by writing the Python code to open the .csv file, and close it
again (as you would at the end of the program). Leave plenty of
blank/empty lines between the two, and use that space to continue with
the next steps...

There are three objectives.

To start, assume that the file is open in front of you. How will you
solve the first problem? Can you describe this in English (and/or your
preferred language)?

Write this as a Python comment. Next, can you translate the
spoken-language into Python?

Thereafter tackle problems two and three.


We don't know your level of Python skill. So, let us know how you
get-on, and come back with sample code, if you strike a problem at any step.
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43356] PyErr_SetInterrupt should have an equivalent that takes a signal number

2021-03-04 Thread Antoine Pitrou


Change by Antoine Pitrou :


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

___
Python tracker 

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



Re: program python

2021-03-04 Thread Igor Korot
Hi,

On Thu, Mar 4, 2021 at 2:42 PM alberto  wrote:
>
> Hi I'm tring to write a program with python to evaluate data of csv data
> In particular I would extract this information
>
> View data on the presence of men and women in Affori over time.
>
> * Carry out an analysis relating to the last available year. Of the 10 most 
> populous neighborhoods show:
> * the proportion of births out of the total
> * the proportion of 80+ to the total
> * The ratio of minors / number of kindergartens
>
> this is the file
> https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing
>
> How could fix it?

What seems to be the problem?

Thank you.

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


program python

2021-03-04 Thread alberto
Hi I'm tring to write a program with python to evaluate data of csv data
In particular I would extract this information 

View data on the presence of men and women in Affori over time.

* Carry out an analysis relating to the last available year. Of the 10 most 
populous neighborhoods show:
* the proportion of births out of the total
* the proportion of 80+ to the total
* The ratio of minors / number of kindergartens

this is the file
https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing

How could fix it?

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


Re: Problem with printing statement when condition is false

2021-03-04 Thread Terry Reedy

On 3/4/2021 12:10 PM, Quentin Bock wrote:


I won't paste the code into
this because it's 164 lines so I will attach a file copy,


The alternative to posting too much is to reduce your code to the 
minimum needed to exhibit the behavior you want to change.  Doing so may 
reveal to you the solution.  It will certainly make it easier for anyone 
else to help you and will make any answer more useful to other readers.


--
Terry Jan Reedy

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


[issue43405] DeprecationWarnings in test_unicode

2021-03-04 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue43405] DeprecationWarnings in test_unicode

2021-03-04 Thread Zackery Spytz


New submission from Zackery Spytz :

./python -m test test_unicode
0:00:00 load avg: 0.33 Run tests sequentially
0:00:00 load avg: 0.33 [1/1] test_unicode
/home/lubuntu2/cpython/Lib/test/test_unicode.py:2941: DeprecationWarning: 
getargs: The 'u' format is deprecated. Use 'U' instead.
  self.assertEqual(unicode_encodedecimal('123'),
/home/lubuntu2/cpython/Lib/test/test_unicode.py:2943: DeprecationWarning: 
getargs: The 'u' format is deprecated. Use 'U' instead.
  self.assertEqual(unicode_encodedecimal('\u0663.\u0661\u0664'),
/home/lubuntu2/cpython/Lib/test/test_unicode.py:2945: DeprecationWarning: 
getargs: The 'u' format is deprecated. Use 'U' instead.
  self.assertEqual(unicode_encodedecimal("\N{EM SPACE}3.14\N{EN SPACE}"),
/home/lubuntu2/cpython/Lib/unittest/case.py:201: DeprecationWarning: getargs: 
The 'u' format is deprecated. Use 'U' instead.
  callable_obj(*args, **kwargs)
/home/lubuntu2/cpython/Lib/test/test_unicode.py:2958: DeprecationWarning: 
getargs: The 'u' format is deprecated. Use 'U' instead.
  self.assertEqual(transform_decimal('123'),
/home/lubuntu2/cpython/Lib/test/test_unicode.py:2960: DeprecationWarning: 
getargs: The 'u' format is deprecated. Use 'U' instead.
  self.assertEqual(transform_decimal('\u0663.\u0661\u0664'),
/home/lubuntu2/cpython/Lib/test/test_unicode.py:2962: DeprecationWarning: 
getargs: The 'u' format is deprecated. Use 'U' instead.
  self.assertEqual(transform_decimal("\N{EM SPACE}3.14\N{EN SPACE}"),
/home/lubuntu2/cpython/Lib/test/test_unicode.py:2964: DeprecationWarning: 
getargs: The 'u' format is deprecated. Use 'U' instead.
  self.assertEqual(transform_decimal('123\u20ac'),

== Tests result: SUCCESS ==

1 test OK.

Total duration: 12.8 sec
Tests result: SUCCESS

--
components: Tests
messages: 388129
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: DeprecationWarnings in test_unicode
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



[issue43402] IDLE shell adds newline after print even when `end=''` is specificied

2021-03-04 Thread Hugo Nobrega


Hugo Nobrega  added the comment:

I see, thank you. But, in that case, shouldn't the interactive `python -i` 
shell have the same (now seen as desired) behavior as the IDLE shell?

--

___
Python tracker 

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



[issue43402] IDLE shell adds newline after print even when `end=''` is specificied

2021-03-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Starting interactive code input on a new line is intentional and not a bug.  
IDLE has other code to keep user program output separate from user code input, 
as when there is delayed asynchonous output. I plan to do more work to keep the 
two separate.

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



[issue29561] Interactive mode gives sys.ps2 not sys.ps1 after comment-only line

2021-03-04 Thread Eryk Sun


Eryk Sun  added the comment:

The is fixed in 3.7+.

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



[issue30431] input function truncates prompt by NULL byte

2021-03-04 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Interpreter Core -IO
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.6, Python 
3.7

___
Python tracker 

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



[issue43375] memory leak in threading ?

2021-03-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Since Timer thread is never joined, should not it be a daemon?

Possibly, but I think that's a new question/issue. :-) And presumably there's 
no reason you can't make your Timer threads into daemon threads if you have a 
need to.

--

___
Python tracker 

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



[issue43403] Misleading statement about bytes not being able to represent windows filenames in documentation

2021-03-04 Thread Eryk Sun


Eryk Sun  added the comment:

> lets not claim that bytes cannot represent everything on a filesystem 
> with an encoding.

Gregory, before changing the filesystem encoding to UTF-8 in Python 3.6, the 
[A]NSI file API (e.g. CreateFileA) was used for bytes paths and the [W]ide 
character file API was used for str paths (e.g. CreateFileW). The ANSI API is a 
set of wrapper functions that automatically translate strings between the ANSI 
code page of the current process and the system's native UTF-16 encoding, 
before and after calling the wide-character function (or a common internal 
function). Starting with Windows 10, the ANSI and OEM code pages of a process 
are finally allowed to be UTF-8 (code page 65001), but it's still considered 
beta and barely used. Usually the ANSI API is set to a legacy single-byte or 
double-byte code page such as 1252 (Western Europe) or 932 (Japanese). 

Natively, Windows is UTF-16, and native Windows filesystems store filenames on 
disk using 16-bit characters. The system doesn't check for valid Unicode, so 
lone surrogate codes are allowed. This is sometimes called a "Wobbly" format. 
In Python it requires the "surrogatepass" error handler.

--

___
Python tracker 

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



[issue43403] Misleading statement about bytes not being able to represent windows filenames in documentation

2021-03-04 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> os.path states that bytes can't represent all MBCS paths under 
Windows

___
Python tracker 

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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2021-03-04 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue43404] No SSL certificates when using the Mac installer

2021-03-04 Thread Sam Bull


New submission from Sam Bull :

After installing the latest version of Python on Mac OS X using the installer 
downloaded from python.org 
(https://www.python.org/ftp/python/3.9.2/python-3.9.2-macosx10.9.pkg), the 
installed version of Python is unable to find the system certificates.

Using the old version of Python located at 
/usr/local/Cellar/python/3.7.5/bin/python3, I get:

>>> ssl.create_default_context().cert_store_stats()
{'x509': 168, 'crl': 0, 'x509_ca': 168}

But, with the new version located at 
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3, I get:

>>> ssl.create_default_context().cert_store_stats()
{'x509': 0, 'crl': 0, 'x509_ca': 0}


Looking around on the internet, this seems to be a pretty common issue on Mac, 
but is often getting misdiagnosed as an actual problem with the server's 
certificate. Because of that, nobody seems to have proposed any methods to fix 
it.

Examples:
https://github.com/aio-libs/aiohttp/issues/5375
https://stackoverflow.com/questions/65039677/unable-to-get-local-issuer-certificate-mac-os#comment115039330_65040851

--
assignee: christian.heimes
components: SSL
messages: 388123
nosy: christian.heimes, dreamsorcerer
priority: normal
severity: normal
status: open
title: No SSL certificates when using the Mac installer
type: behavior
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



[issue43403] Misleading statement about bytes not being able to represent windows filenames in documentation

2021-03-04 Thread Ammar Askar


Change by Ammar Askar :


--
nosy: +eryksun

___
Python tracker 

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



[issue43403] Misleading statement about bytes not being able to represent windows filenames in documentation

2021-03-04 Thread Gregory P. Smith


New submission from Gregory P. Smith :

As noted in the comment on 
https://github.com/rdiff-backup/rdiff-backup/issues/540#issuecomment-789485896

The Python documentation in https://docs.python.org/3/library/os.path.html 
makes an odd claim that bytes cannot represent all file names on Windows.  That 
doesn't make sense.  bytes can by definition represent everything.

"""Vice versa, using bytes objects cannot represent all file names on Windows 
(in the standard mbcs encoding), hence Windows applications should use string 
objects to access all files."""

Could we get this clarified and corrected to cover what any actual technical 
limitation is?

Every OS is going to reject some bytes objects as a pathname for containing 
invalid byte sequences for their filesystem (ex: I doubt any OS allows null 
b'\0' characters).  But lets not claim that bytes cannot represent everything 
on a filesystem with an encoding.

--
assignee: docs@python
components: Documentation
messages: 388122
nosy: docs@python, gregory.p.smith, steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Misleading statement about bytes not being able to represent windows 
filenames in documentation
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



[issue42129] Support resources in namespace packages

2021-03-04 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue42129] Support resources in namespace packages

2021-03-04 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 67148254146948041a77d8a2989f41b88cdb2f99 by Jason R. Coombs in 
branch 'master':
bpo-42129: Add support for resources in namespaces (GH-24670)
https://github.com/python/cpython/commit/67148254146948041a77d8a2989f41b88cdb2f99


--

___
Python tracker 

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



[issue42405] Add distutils mvsccompiler support for Windows ARM64 build

2021-03-04 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset fbf75b9997e280b1220755d0a17dbed71240d42e by Jason R. Coombs in 
branch 'master':
Revert "bpo-42405: fix C extensions build on Windows ARM64 (GH-23399)" (#24753)
https://github.com/python/cpython/commit/fbf75b9997e280b1220755d0a17dbed71240d42e


--

___
Python tracker 

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



[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Stefan Behnel


Stefan Behnel  added the comment:

Thanks for the report and the PR. I would argue that this can still be fixed in 
Py3.8, given the low impact (but not earlier). The behaviour is clearly wrong 
(in a subtle way) and most users won't notice it because they won't switch off 
the C accelerator module.

--
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Your proposed fix LGTM. Please open a PR. Don't forget about test and NEWS 
entry.

--

___
Python tracker 

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



[issue43391] The comments have invalid license information (broken Python 2.4 URL for Python 3)

2021-03-04 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset b225d91f0a92d657d9a1b62daa53ab239c8191e3 by Kamil Turek in branch 
'master':
bpo-43391: Remove the broken Python 2.4 link from the comment (GH-24736)
https://github.com/python/cpython/commit/b225d91f0a92d657d9a1b62daa53ab239c8191e3


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue39375] Document os.environ[x] = y and os.putenv() as thread unsafe

2021-03-04 Thread Eryk Sun


Change by Eryk Sun :


--
type:  -> enhancement
versions: +Python 3.10 -Python 2.7, Python 3.7

___
Python tracker 

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



[issue23946] zero-valued timestamps are mishandled by os.stat() in Windows

2021-03-04 Thread Eryk Sun


Eryk Sun  added the comment:

For example, the named-pipe filesystem (NPFS), doesn't return timestamps for 
pipes in the directory listing, so the timestamps are all 0 (i.e. 1601-01-01):

>>> write_time = win32file.FindFilesW('//./pipe/*')[0][3]
>>> format(write_time, '%Y-%m-%d %H:%M')
'1601-01-01 00:00'

>>> next(os.scandir('//./pipe')).stat().st_mtime
-11644473600.0

I agree that a zero-valued NT timestamp should be converted to a zero-valued 
Unix timestamp. No one has a file that was created, modified, changed, or 
accessed in 1601.

As mentioned above, the 1601 date doesn't roundtrip in Windows as a Unix 
timestamp since dates before the Unix epoch aren't supported:

>>> write_time.timestamp()
-11644473600.0
>>> datetime.fromtimestamp(write_time.timestamp())
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument

--
components: +Library (Lib) -Interpreter Core
nosy: +paul.moore
title: Invalid timestamps reported by os.stat() when Windows FILETIME 
structures are mistakenly reset. -> zero-valued timestamps are mishandled by 
os.stat() in Windows
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7

___
Python tracker 

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



[issue43402] IDLE shell adds newline after print even when `end=''` is specificied

2021-03-04 Thread Hugo Nobrega


New submission from Hugo Nobrega :

When evaluting a call to the `print` function with argument `end=''` in the 
IDLE shell, a newline is unexpectedly added at the end, before the next shell 
prompt.

The expected behavior is to have the shell prompt next to the last printed 
line. The expected behavior is seen when evaluting the same expression in an 
interactive python shell from a terminal (`python -i`)

Example:

IDLE shell (not expected):
>>> print('a',end='')
a
>>> 

Interactive python shell (expected): 
>>> print('a',end='')
a>>>

I could not find any settings in IDLE that might be governing this behavior, 
not any other issues mentioning this same thing.


Tested on Python 3.9.1 on Manjaro Linux.

--
assignee: terry.reedy
components: IDLE
messages: 388115
nosy: hugonobrega, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE shell adds newline after print even when `end=''` is specificied
type: behavior
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



[issue42405] Add distutils mvsccompiler support for Windows ARM64 build

2021-03-04 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +23524
pull_request: https://github.com/python/cpython/pull/24753

___
Python tracker 

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



[issue42405] Add distutils mvsccompiler support for Windows ARM64 build

2021-03-04 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Hey Steve. Thanks for the clarification. I'd forgotten the context, 
specifically that any patches needed to be merged before the PEP was accepted, 
and was working from a memory that we were willing to accept this change. Happy 
to revert it, as that also saves me the time of making sure the change is 
backported to pypa/distutils. Adrian, please submit the change to 
pypa/distutils.

--

___
Python tracker 

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



[issue43401] dbm module doc page redirects to itself

2021-03-04 Thread Numerlor


New submission from Numerlor :

In [32]: requests.get("https://docs.python.org/3/library/dbm.html;, 
allow_redirects=False)
Out[32]: 

In [33]: _.headers["Location"]
Out[33]: 'https://docs.python.org/3/library/dbm.html#module-dbm.ndbm'

--
assignee: docs@python
components: Documentation
messages: 388113
nosy: Numerlor, docs@python
priority: normal
severity: normal
status: open
title: dbm module doc page redirects to itself

___
Python tracker 

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



[issue42405] Add distutils mvsccompiler support for Windows ARM64 build

2021-03-04 Thread Steve Dower


Steve Dower  added the comment:

Jason, this issue and the associated PR are out of date and should not be 
merged.

The PR also only affects completely unused code, so it has no value whatsoever 
being in CPython. I don't really care too much about the unused code, but I 
will *insist* on the NEWS entry being reverted, to avoid causing confusion.

(As an aside, I'd love setuptools to gain this functionality, and I'm trying to 
get access to hardware for you so you can validate it in CI.)

--

___
Python tracker 

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



[issue43364] Add shortcut to enable UTF-8 mode in start menu.

2021-03-04 Thread Steve Dower


Steve Dower  added the comment:

Maybe as a global setting, the better thing to copy is the button at the end of 
installation that offers to change the long path policy?

That would give a bit more room that a checkbox to explain what is being set 
and what the implications are, which will help users who select it when they 
shouldn't.

IIRC, all of that code exists in the boostrapper app (one of the .cpp files). 
The UI is probably in the bundle wxl/thm files.

--

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Doug Harris


Doug Harris  added the comment:

+1 on this documentation change.

@xtreak yes, patching the correct object has bit me a couple times.

The pattern that I work with the most is when mocking calls to external 
services and APIs. I want to test my code that, say, sends email or sends user 
information to a partner, but without actual HTTP calls. Whenever I add a new 
test that does this, I need to rethink exactly what the sequence of mocked 
objects, calls, and returns will be.

The HOWTO section of the official Python docs has nothing on unittest or mock. 
Perhaps something there... (makes note to think about drafting something).

--
nosy: +dougharris

___
Python tracker 

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



[issue22107] tempfile module misinterprets access denied error on Windows

2021-03-04 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 for the OP's suggestion.

--
nosy: +rhettinger

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I don't have any opinion on removing the part of the sentence. It will be 
helpful if you can list the scenarios where you feel document is lacking so 
that it can be improved. One area I have found to be little tricky is patching 
the correct object during testing which has a section and needs some 
understanding of Python's import mechanism. The other was about setting return 
value properly for nested attributes.

Mock has a lot of features and has a wide range of API so listing places where 
you feel some of the things are not clear will help in improving them.

--
nosy: +xtreak

___
Python tracker 

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



[issue4928] tempfile.NamedTemporaryFile: automatic cleanup by OS

2021-03-04 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue43396] Use more descriptive variable names in sqlite3 docs

2021-03-04 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43396] Use more descriptive variable names in sqlite3 docs

2021-03-04 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 213c155a460b8dd9e43901e4d61aa088cbac4221 by Miss Islington (bot) 
in branch '3.8':
bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746)
https://github.com/python/cpython/commit/213c155a460b8dd9e43901e4d61aa088cbac4221


--

___
Python tracker 

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



Problem with printing statement when condition is false

2021-03-04 Thread Quentin Bock
Okay so, this is my biggest project, I'm not advanced in Python in any
way so don't expect it to be perfect. I made a trivia game and for the most
part, it works but I can't get it to print "Incorrect" and then what the
answer was for all but one of my questions and I don't know why. I use
PyCharm as my IDE for his just as a heads up. I won't paste the code into
this because it's 164 lines so I will attach a file copy, please don't send
back the edited file only write them out and where I need to fix them,
thank you!
Stay Safe Everyone! :)


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43396] Use more descriptive variable names in sqlite3 docs

2021-03-04 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 374ee449331bc95d18c37f5032aaea1448462e58 by Miss Islington (bot) 
in branch '3.9':
bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746)
https://github.com/python/cpython/commit/374ee449331bc95d18c37f5032aaea1448462e58


--

___
Python tracker 

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



[issue42405] Add distutils mvsccompiler support for Windows ARM64 build

2021-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset cb7bc7640935f6b05e9d2acfe4b33d496e8f8666 by Adrian Vladu in 
branch 'master':
bpo-42405: fix C extensions build on Windows ARM64 (GH-23399)
https://github.com/python/cpython/commit/cb7bc7640935f6b05e9d2acfe4b33d496e8f8666


--
nosy: +miss-islington

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2021-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset 0064d561b8e44f7a991188d7c5016c165bc89326 by Miss Islington (bot) 
in branch '3.8':
[3.8] bpo-37193: Remove thread objects which finished process its request 
(GH-23127) (GH-24749)
https://github.com/python/cpython/commit/0064d561b8e44f7a991188d7c5016c165bc89326


--

___
Python tracker 

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Eddie Peters


Change by Eddie Peters :


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

___
Python tracker 

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



[issue19809] Doc: subprocess should warn uses on race conditions when multiple threads spawn child processes

2021-03-04 Thread Eryk Sun


Eryk Sun  added the comment:

I'm closing this issue because the behavior was addressed for Python 3 in POSIX 
and mostly addressed in Windows (PEP 443, bpo-19764). The switch to using 
PROC_THREAD_ATTRIBUTE_HANDLE_LIST with subprocess.Popen() in Windows at least 
makes scripts safe from race conditions as long as only the subprocess module 
is used. 

Eventually it would be better to use subprocess.Popen() to implement 
os.system() and, in Windows, os.spawnv[e] -- as was already implemented for 
os.popen(). In that case it may even be reasonable to use the handle list to 
implement pass_fds in Windows.

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



[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Eddie Peters

New submission from Eddie Peters :

The unittest.mock library is very useful and very powerful, but it is not "very 
easy to use." Docs are useful and important, or we wouldn't be here in a 
documentation issue.

I have watched several of the most experienced Python programmers I know 
struggle with various aspects of mock, including basic usage. I have sat with 
frustrated developers who have used mocking utilities in other languages but 
had little Python experience, and they were surprised by some mock behaviors 
and just couldn't get things "right" until they were helped by someone with all 
the tiny little healed-over cuts from lots of mock usage.

Again, mock is great, but maybe if I have these opinions, I should contribute 
to making mock more intuitive. That's true. For now, though, the documentation 
contains this little line in the opening paragraphs that is unnecessary and can 
only make new mock users feel bad about having trouble: "Mock is very easy to 
use and is designed for use with unittest."

I propose we remove the opinion "Mock is very easy to use" and change this line 
to "Mock is designed for use with unittest." The rest of the paragraph flows 
just fine without this:

"Mock is very easy to use and is designed for use with unittest. Mock is based 
on the ‘action -> assertion’ pattern instead of ‘record -> replay’ used by many 
mocking frameworks."

--
assignee: docs@python
components: Documentation
messages: 388102
nosy: docs@python, eppeters
priority: normal
severity: normal
status: open
title: Remove "Mock is very easy to use" from unittest.mock documentation
type: enhancement
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eli.bendersky, scoder, serhiy.storchaka

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2021-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset 0e76157b0ca70bd38157fed56680a7752a52668d by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-37193: Remove thread objects which finished process its request 
(GH-23127) (GH-24750)
https://github.com/python/cpython/commit/0e76157b0ca70bd38157fed56680a7752a52668d


--

___
Python tracker 

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



[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Alex


Change by Alex :


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

___
Python tracker 

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



[issue29829] Documentation lacks clear warning of subprocess issue with pythonw

2021-03-04 Thread Eryk Sun


Eryk Sun  added the comment:

I forgot about the much older issue for this problem. I'm closing this issue, 
because the broken behavior should be fixed, not documented.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> subprocess failing in GUI applications on Windows

___
Python tracker 

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



[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Alex


New submission from Alex :

This issue is only visible when the C accelerator of ElementTree is *not* used. 
It is the counterpart of the following issue on PyPy3: 
https://foss.heptapod.net/pypy/pypy/-/issues/3181

 >>> from xml.etree.ElementTree import Element
 >>> r = Element("root")
 >>> r.extend((Element(str(i)) for i in range(3)))
 >>> print(list(r))
 []

When using the C accelerator, the list is not empty, as expected. In the Python 
code, a check on the input empties the input iterator.

The fix is trivial (one-line change), so if you are interested I could open a 
PR, which would be my first, so a good occasion to go through the devguide ;)
I understand that since Python3.3 the C accelerator is used by default, so I 
would agree that this is not really a bug, and I can just fix it on PyPy side.

--
components: XML
messages: 388099
nosy: alexprengere
priority: normal
severity: normal
status: open
title: xml.etree.ElementTree.extend does not work with iterators when using the 
Python implementation
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue3905] subprocess failing in GUI applications on Windows

2021-03-04 Thread Eryk Sun


Eryk Sun  added the comment:

For whatever the reason and Windows version, it's still the case that 
_get_handles() should work around any bad standard handles in the current 
process. In bpo-25492, I suggested checking os.get_handle_inheritable(). That's 
too permissive. It should require a valid file handle, checked via 
_winapi.GetFileType(). For example:

if stdin is None:
p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE)
if p2cread is not None:
try:
_winapi.GetFileType(p2cread)
except OSError:
p2cread = None

--
components: +Library (Lib)
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.7

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2021-03-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23520
pull_request: https://github.com/python/cpython/pull/24750

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2021-03-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23519
pull_request: https://github.com/python/cpython/pull/24749

___
Python tracker 

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



[issue43396] Use more descriptive variable names in sqlite3 docs

2021-03-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43396] Use more descriptive variable names in sqlite3 docs

2021-03-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23518
pull_request: https://github.com/python/cpython/pull/24748

___
Python tracker 

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



[issue43396] Use more descriptive variable names in sqlite3 docs

2021-03-04 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 40d1b831ecd1b5b6a4fce9a908a6e61b50b360a0 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746)
https://github.com/python/cpython/commit/40d1b831ecd1b5b6a4fce9a908a6e61b50b360a0


--

___
Python tracker 

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



[issue43396] Use more descriptive variable names in sqlite3 docs

2021-03-04 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +23516
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24746

___
Python tracker 

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



[issue43396] Use more descriptive variable names in sqlite3 docs

2021-03-04 Thread Berker Peksag


Berker Peksag  added the comment:

LGTM!

--
resolution: not a bug -> 
stage: resolved -> needs patch
status: closed -> open
title: Non-existent method sqlite3.Connection.fetchone() used in docs -> Use 
more descriptive variable names in sqlite3 docs
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



[issue20088] locale.getlocale() fails if locale name doesn't include encoding

2021-03-04 Thread Eryk Sun


Eryk Sun  added the comment:

The locale_alias database was extended to support "en_AG" and many others, but 
I'd still prefer Serhiy's suggestion to not guess the codeset when checking the 
default LC_CTYPE category. Use locale.nl_langinfo(locale.CODESET), if it's 
available. 

In Windows, I'd prefer to never guess since the encoding for a BCP-47 locale 
name can be directly queried. But this issue can be restricted to POSIX. What 
to do in Windows is already being considered in more recent issues: bpo-23425, 
bpo-37945, and bpo-43115.

--
components:  -Windows
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



Re: Why assert is not a function?

2021-03-04 Thread Grant Edwards
On 2021-03-03, Chris Angelico  wrote:
> On Thu, Mar 4, 2021 at 1:40 AM Grant Edwards  
> wrote:
>
>> I thought the entire point of asser being a keyword was so that if you
>> disable asserts then they go away completely: the arguments aren't
>> even evaluated.
>
> It depends on what the point of "removing the assertions" is, but
> yes, that will indeed still evaluate the arguments. IMO the cost of
> running assertions isn't that high compared to the value of keeping
> them (which is why I never run -O), and the performance argument is
> a weak one compared to the much stronger value of having the actual
> failing expression available in the exception report.

Good point. I had forgotten about having the expression available in
the exception output. That's definitly valuable.


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


  1   2   >