[issue38307] Provide Class' end line in pyclbr module

2021-01-26 Thread Aviral


Change by Aviral :


--
pull_requests: +23168
pull_request: https://github.com/python/cpython/pull/24348

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I hope this is not your last contribution.  Another hint: if one uses issue 
12643 or #12643, then the tracker makes the link -- and strikes it out if 
closed.

--

___
Python tracker 

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



[issue41459] pickle.load raises SystemError on malformed input

2021-01-26 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> wont fix
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



[issue43030] signed/unsigned mismatch in Py_UNICODE_ISSPACE macro

2021-01-26 Thread Inada Naoki


Inada Naoki  added the comment:

Just replacing "128U" with "128" enough?
Will `ch < 128` emit warning on platforms wchar_t is unsigned?

--

___
Python tracker 

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



[issue43034] Python tutorial misleads users about floor division behavior

2021-01-26 Thread Jesse Silverman


New submission from Jesse Silverman :

I had never worked thru the Python tutorial, it's kind of awesome.

I noticed multiple independent presenters incorrectly describe the behavior of 
floor division when the signs of the operands don't match.  Not just sloppy 
ones, some who are usually pretty careful -- people forget.  I found it odd.

Today I read:
https://docs.python.org/3.9/tutorial/introduction.html#using-python-as-a-calculator
'Division (/) always returns a float. To do floor division and get an integer 
result (discarding any fractional result) you can use the // operator; to 
calculate the remainder you can use %:'

I know what they mean (there will never be a non-zero fractional component in 
the result) however, stating that it "discards any fraction result" explicitly 
suggests that it will round towards zero for all results.  The name of the 
operator tells us the true story, as does a test, it rounds towards negative 
infinity for all results.

Hopefully all the people using Python to treat cancer, fly to Mars and run 
power plants know what the behavior is.  However, anecdotally, I have seen 
evidence that generally cautious, fairly-detail oriented programmers seem to 
forget the details of the behavior, this is one place in the docs from which 
many people first learn about the floor division operator and this page would 
lead me to believe it operates differently than it does in reality.

If the words right there don't get changed, or the example of -10/3 doesn't get 
added, would this be a good excuse for a third footnote?  I would actually wish 
for both the wording to be changed and to show an example like -10 / 3, tho 
admittedly I came from an Engineering background so I am always worried 
someone's going to blow up somewhere...

Deepest regards for everyone who gets to regularly close the complaints about 
floor division working as designed and documented -- but not quite documented 
on this page which more people may read than others covering the operator.

--
assignee: docs@python
components: Documentation
messages: 385746
nosy: docs@python, jessevsilverman
priority: normal
severity: normal
status: open
title: Python tutorial misleads users about floor division 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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread Ken Hilton


Ken Hilton  added the comment:

Oops, gotcha. Thanks for doing the tests. I'm a Python contributor! :D

--

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Ken, for next time -- there is a separate News category for IDLE.

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread miss-islington


miss-islington  added the comment:


New changeset 6f0346d09f78180886982e070cc92425ada96144 by Miss Islington (bot) 
in branch '3.8':
bpo-43008: Make IDLE respect sys.excepthook (GH-24302)
https://github.com/python/cpython/commit/6f0346d09f78180886982e070cc92425ada96144


--

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread miss-islington


miss-islington  added the comment:


New changeset 68102fb9987338a70d69a0162917866e5710458d by Miss Islington (bot) 
in branch '3.9':
bpo-43008: Make IDLE respect sys.excepthook (GH-24302)
https://github.com/python/cpython/commit/68102fb9987338a70d69a0162917866e5710458d


--

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23167
pull_request: https://github.com/python/cpython/pull/24347

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +23166
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/24346

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 7a34380ad76f5ad50d4175ceb2d5715b8cff by Ken in branch 
'master':
bpo-43008: Make IDLE respect sys.excepthook (GH-24302)
https://github.com/python/cpython/commit/7a34380ad76f5ad50d4175ceb2d5715b8cff


--

___
Python tracker 

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



[issue42606] Support POSIX atomicity guarantee of O_APPEND on Windows

2021-01-26 Thread Eryk Sun


Eryk Sun  added the comment:

> So the idea is to delete the file for a brief period, but then 
> undelete it. 

Currently NTFS defaults to using classic delete semantics for delete-on-close. 
However, it supports POSIX delete semantics for delete-on-close, so the default 
could change in a future release. When delete-on-close uses POSIX semantics, 
closing the last handle to the kernel File immediately unlinks the file. The 
upside is that a filesystem that uses POSIX delete semantics for 
delete-on-close should support SetFileInformationByHandle: 
FileDispositionInfoEx, which allows directly removing the delete-on-close flag.

That said, I can't stomach having to manually overwrite, truncate, delete and 
undelete files in order to avoid side effects if _open_osfhandle() fails. IMO, 
if opening a file has serious side effects, then we need a public API to 
allocate the fd beforehand. Or the idea needs to be put on hold until Python 
divorces itself from the C runtime's low I/O layer.

> If the file type is FILE_TYPE_CHAR and the first byte to write 
> was 26 (Ctrl-Z), it's treated as success. I don't think I 
> understand: it *seems* like it's handling something like writing 
> to the *input* of a console, but I'm not sure it's even possible 
> in this manner.

Writing to the console input buffer is possible, but not supported with 
WriteFile() or WriteConsoleW(). It requires WriteConsoleInputW(), which writes 
low-level input records.

ReadFile() on a console input handle is special cased to return that 0 bytes 
were read if the string read from the console starts with Ctrl+Z. But I don't 
know of a device that special cases WriteFile() like this. The documentation of 
_write() says "[w]hen writing to a device, _write treats a CTRL+Z character in 
the buffer as an output terminator". Whatever this meant in the past in OS/2 or 
DOS, I doubt that it's meaningful nowadays.

> Anything else is a failure with ENOSPC. This is mysterious too.

Possibly someone picked an error code that was good enough. Maybe it was 
selected for the case of a full pipe that's in non-blocking mode. The named 
pipe device doesn't fail an NtWriteFile() system call for a non-blocking pipe 
when there isn't enough space. It simply succeeds with 0 bytes written. For 
example:

>>> fdr, fdw = os.pipe()
>>> hw = msvcrt.get_osfhandle(fdw)
>>> win32pipe.SetNamedPipeHandleState(hw, 1, None, None)
>>> os.write(fdw, b'a'*4096)
4096
>>> os.write(fdw, b'a')
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 28] No space left on device

A POSIX developer would expect this case to fail with EAGAIN and raise 
BlockingIOError. But support for non-blocking mode is poorly implemented by 
pipes in Windows. Developers are encouraged to use asynchronous I/O instead.

--

___
Python tracker 

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



[issue43033] Incorrect handling of PyObject_SetAttrString() in the _zoneinfo module

2021-01-26 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue43033] Incorrect handling of PyObject_SetAttrString() in the _zoneinfo module

2021-01-26 Thread Zackery Spytz


New submission from Zackery Spytz :

There is a PyObject_SetAttrString() call in zoneinfo_init_subclass() which
is not checked for failure.  This could lead to serious bugs if an
exception occurs in PyObject_SetAttrString().

--
components: Extension Modules
messages: 385739
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: Incorrect handling of PyObject_SetAttrString() in the _zoneinfo module
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



[issue38250] enum.Flag should be more set-like

2021-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

PPC64LE Fedora Rawhide Clang Installed 3.x is back to green, thanks for the fix 
;-)
https://buildbot.python.org/all/#/builders/312/builds/600

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



[issue3353] make built-in tokenizer available via Python C API

2021-01-26 Thread Anthony Sottile


Anthony Sottile  added the comment:

Serhiy Storchaka is this still blocked?  it's been a few years on either this 
or the linked issue and I'm reaching for this one :)

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue38250] enum.Flag should be more set-like

2021-01-26 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 01faf4542a8652adfbd3b3f897ba718e8ce43f5e by Ethan Furman in 
branch 'master':
bpo-38250: [Enum] only include .rst test if file available (GH-24342)
https://github.com/python/cpython/commit/01faf4542a8652adfbd3b3f897ba718e8ce43f5e


--

___
Python tracker 

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



[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-26 Thread Tadek Kijkowski


Tadek Kijkowski  added the comment:

Paul,

> The basic logic of argparse is to accept optionals in any order, and 
> positionals in strict positional order.  'nargs' allows us to pair any number 
> of strings with each optional's flag.

I started this issue because that was insufficient for my project.

> I wonder if adding a new nargs, such as '**' would be better than than the 
> new parameter 'greedy_star=True'.

Yeah, I considered that earlier, but I thought that would be too much effort to 
review all the places where it would have to be treated as equal to '*'. But 
now I agree with you, I'll try to change that.

--

___
Python tracker 

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



[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-26 Thread Glenn Linderman


Glenn Linderman  added the comment:

Paul said:
I haven't had a chance to study your longer posts, but it seems to me that the 
AddFruitAction example could just as well be implemented with 

parser.add_argument('--color', nargs='*', action='append')

with post parsing processing to create the 'fruits' dicts from the appended 
lists.  


That was also my first reaction, Paul, when I read Tadek's proposal. But I 
quickly realized that particularly with the feature of "capture and reset to 
default" that the number of instances of a particular optional and the number 
of positionals do not always match, and there is no way to correlate them 
later, even if they are all captured and saved.

--

___
Python tracker 

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



[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-26 Thread Glenn Linderman


Glenn Linderman  added the comment:

This sounds very good to me.  Might also want action='store_capture' for a 
single positional definition?

capture could be a string, or any iterable of strings (tuple comes to mind)

capture_once have similar value as capture, but I wonder if the naming would be 
better as capture_reset to indicate the value is reset to default, rather than 
just captured.


Tadek said:
There could be new predefined action, e.g. 'extend_with_capture' (or just 
'extend_capture') which could be used like this:

  parser.add_argument('fruits', nargs='*', action='extend_capture', 
capture_once=['color'])

Where 'capture' would be one of: a list of parameters to capture (could be a 
string instead of a list if it's just one parameter) or '*' to capture all 
optional parameters and 'capture_once' would be similar list of parameters to 
capture and reset to default.

--

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset a178473dd6a3b527a67ab3f9dc38ef8b1a60881a by Terry Jan Reedy in 
branch '3.8':
[3.8] bpo-41841: Prepare IDLE NEWS for 3.8.8 (GH-24344)
https://github.com/python/cpython/commit/a178473dd6a3b527a67ab3f9dc38ef8b1a60881a


--

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset fd668bc62b7f6de95448344b6650e1c3c2a997fa by Terry Jan Reedy in 
branch '3.9':
[3.9] bpo-41841: Prepare IDLE NEWS for 3.9.2 (#GH-4343)
https://github.com/python/cpython/commit/fd668bc62b7f6de95448344b6650e1c3c2a997fa


--

___
Python tracker 

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



[issue42825] Build libraries with "/OPT:REF" linker optimization on Windows

2021-01-26 Thread Austin Lamb


Austin Lamb  added the comment:

I don't know much about how ctypes exposes stuff - are these exposed as DLL 
exports?  Or if not, how do they get exposed?

The linker will remove things it can't find a callsite for, but it leaves in 
exported functions as of course those are by definition externally callable.  
If ctypes is called another way, I can help confirm whether anything is 
accidentally being stripped out.

--

___
Python tracker 

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



[issue42997] Improve error message for missing : before suites

2021-01-26 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

> Yeah, but the cut is "absolute" (because of the syntax Error). IIRC the 
> normal cut only affects that rule, no?

Right.

--

___
Python tracker 

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



[issue43024] improve signature (in help, etc) for functions taking sentinel defaults

2021-01-26 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +ZackerySpytz, pablogsal

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-01-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +23163
pull_request: https://github.com/python/cpython/pull/24344

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-01-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +23162
pull_request: https://github.com/python/cpython/pull/24343

___
Python tracker 

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



[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-26 Thread paul j3


paul j3  added the comment:

I haven't had a chance to study your longer posts, but it seems to me that the 
AddFruitAction example could just as well be implemented with 

parser.add_argument('--color', nargs='*', action='append')

with post parsing processing to create the 'fruits' dicts from the appended 
lists.  

The basic logic of argparse is to accept optionals in any order, and 
positionals in strict positional order.  'nargs' allows us to pair any number 
of strings with each optional's flag.

While custom Action classes can implement interactions between arguments based 
on values in the namespace, it is usually easier to do this after parsing.  

But back to your core change, I wonder if adding a new nargs, such as '**' 
would be better than than the new parameter 'greedy_star=True'.  I prefer not 
to add parameters that are hard to document.  At this point in the argparse 
development, changes should be minimally invasive.

--

___
Python tracker 

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



[issue42948] bytearray.copy is undocumented

2021-01-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> not a bug

___
Python tracker 

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



[issue42997] Improve error message for missing : before suites

2021-01-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> It's basically a positive lookahead with a cut, but the extra feature that it 
> raises a SyntaxError, right?

Yeah, but the cut is "absolute" (because of the syntax Error). IIRC the normal 
cut only affects that rule, no?

--

___
Python tracker 

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



[issue42997] Improve error message for missing : before suites

2021-01-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> See also issue1634034.

The problem with issue1634034 is that is not anymore possible without manual 
changes to the grammar with the PEG parser (or new infrastructure). The new 
parser does not have a defined concept of "i expected this token and now I am 
going to hard fail because is not there", but instead it will backtrack and try 
something else. We also did some work on something similar and we deemed it not 
useful as it was:

bugs.python.org/issue40599

--

___
Python tracker 

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



[issue38250] enum.Flag should be more set-like

2021-01-26 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +23161
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/24342

___
Python tracker 

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



[issue43031] aarch64 RHEL7 LTO + PGO 3.7: "make" hangs when running test_asyncio

2021-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

I created https://github.com/python/buildmaster-config/pull/228 to skip PGO 
builds on Python 3.7, since test_asyncio hangs on PGO builds.

--

___
Python tracker 

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



[issue42384] Inconsistent sys.path between python and pdb

2021-01-26 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-26 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-26 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset d863deeff27f00ac33e9f169d23ca56d69af3f86 by Andrey Bienkowski in 
branch '3.8':
 [3.8] bpo-42383: pdb: do not fail to restart the target if the current 
directory changed (GH-23412) (#24323)
https://github.com/python/cpython/commit/d863deeff27f00ac33e9f169d23ca56d69af3f86


--

___
Python tracker 

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-26 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset f8cfe54e5a7082edcec74a34b3d7e6afab051afd by Andrey Bienkowski in 
branch '3.9':
[3.9] bpo-42383: pdb: do not fail to restart the target if the current 
directory changed (GH-23412) (#24322)
https://github.com/python/cpython/commit/f8cfe54e5a7082edcec74a34b3d7e6afab051afd


--

___
Python tracker 

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



[issue42988] Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-01-26 Thread Ken Jin


Ken Jin  added the comment:

@Serhiy,

While this approach solves the getfile problem, I don't think this will solve 
the other problem of pydoc leaking secrets stored in python files:

Quoting from Marc-Andre Lemburg's message:
> the tool also makes available all Python modules which can be found on 
> sys.path of the user starting pydoc -p. It shows all doc-strings, functions, 
> the class structure and literal values of any constants found in those 
> modules.
> In a corporate environment this can easily result in data leaks of e.g. 
> unreleased software, personal information, disclosure of NDA protected code, 
> designs, algorithms and other secrets.

Quoting from Victor's messages:
> pydoc shows global constant values in the doc. So yes, if you find a 
> settings.py of a Django project, you can discover secrets.

Ultimately, the problem seems to be that .py files (other than those in the 
stdlib) may contain sensitive info, which pydoc can read.

--

___
Python tracker 

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



[issue42997] Improve error message for missing : before suites

2021-01-26 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I propose to go with the first approach. I really like that and I can see us 
using it in various place in the future. It's basically a positive lookahead 
with a cut, but the extra feature that it raises a SyntaxError, right?

I'll have a look at the PR now.

--

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-26 Thread Ken Hilton


Ken Hilton  added the comment:

CLA registers as signed now.

--

___
Python tracker 

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



[issue42775] __init_subclass__ should be called in __init__

2021-01-26 Thread Carlton Gibson


Change by Carlton Gibson :


--
nosy: +carltongibson

___
Python tracker 

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



[issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

2021-01-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

see PR 24341.

--

___
Python tracker 

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



[issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

2021-01-26 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
pull_requests: +23160
pull_request: https://github.com/python/cpython/pull/24341

___
Python tracker 

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



[issue40692] Adjust test_concurrent_futures to run more of its tests if multiprocessing.synchronize is missing

2021-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

Is there any update on this issue? If not, I suggest to close it. It doesn't 
seem to consider enough people and nobody seems to want to implement it.

See also: https://github.com/python/buildmaster-config/issues/203

--

___
Python tracker 

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



[issue42988] Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -23159

___
Python tracker 

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



[issue43031] aarch64 RHEL7 LTO + PGO 3.7: "make" hangs when running test_asyncio

2021-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.7 no longer accept bugfixes, only security fixes:
https://devguide.python.org/#status-of-python-branches

Maybe we should just remove this PGO worker (but keep other Python 3.7 workers).

--

___
Python tracker 

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



[issue42988] Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23159
pull_request: https://github.com/python/cpython/pull/24339

___
Python tracker 

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



[issue43031] aarch64 RHEL7 LTO + PGO 3.7: "make" hangs when running test_asyncio

2021-01-26 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

2021-01-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I will create a PR later today, I've already committed the work in a branch of 
my clone of cpython.

--

___
Python tracker 

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



[issue42988] Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -23157

___
Python tracker 

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



[issue42988] Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23157
pull_request: https://github.com/python/cpython/pull/24339

___
Python tracker 

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



[issue43032] Size of pie chart in matplotlib (frame affects it)

2021-01-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

Wrong tracker, I'm afraid. This tracker is for the Python core language. Try 
https://github.com/matplotlib/matplotlib/issues

--
nosy: +mark.dickinson
resolution:  -> third party
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



[issue43032] Size of pie chart in matplotlib (frame affects it)

2021-01-26 Thread Robert


New submission from Robert :

Hi all.

Is it an issue or on purpose that enabling and disabling the frame in plt.pie() 
results in different sized pie charts? In my opinion the code below should 
provide identical sized charts. If it is on purpose, can you give me a 
reference? I am using the conda version of pyhton but colleagues experience the 
same behavior.

import matplotlib.pyplot as plt
f = plt.figure(figsize=(10,5),dpi=300)
ax1 = f.add_axes([0,0,0.5,1])
ax2 = f.add_axes([0.5,0,0.5,1])
ax1.pie([180,180],center=(0.5,0.5),radius=0.5,frame=False)
ax2.pie([180,180],center=(0.5,0.5),radius=0.5,frame=True)
plt.show()

--
messages: 385713
nosy: twisterior
priority: normal
severity: normal
status: open
title: Size of pie chart in matplotlib (frame affects it)
versions: Python 3.7

___
Python tracker 

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



[issue43031] aarch64 RHEL7 LTO + PGO 3.7: "make" hangs when running test_asyncio

2021-01-26 Thread STINNER Victor


New submission from STINNER Victor :

test_asyncio hangs randomly on Python 3.7 on aarch64 RHEL7 LTO + PGO 3.7. The 
symptom is a failed build failing with:

   retry lost connection compile (retry)

Full error:

   remoteFailed: [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost 
in a non-clean fashion.

Example of failed build:

   https://buildbot.python.org/all/#/builders/42/builds/4703

Configure command:

   ./configure --prefix '$(PWD)/target' --with-lto --enable-optimizations

Compile command:

   make -j10 all

End of the make output:

make run_profile_task
make[1]: Entering directory 
`/home/buildbot/buildarea/3.7.cstratak-RHEL7-aarch64.lto-pgo/build'
./python -m test.regrtest --pgo || true
0:00:00 load avg: 1.07 Run tests sequentially
0:00:00 load avg: 1.07 [  1/416] test_grammar
(...)
0:01:40 load avg: 1.07 [ 24/416] test_asynchat
0:01:42 load avg: 1.07 [ 25/416] test_asyncio

remoteFailed: [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost 
in a non-clean fashion.
]


I ran manually "./configure --prefix '$(PWD)/target' --with-lto 
--enable-optimizations && make -j10 all" twice on the worker directly, but 
test_asyncio passed successfully (I tried it twice).

--
components: Tests
messages: 385712
nosy: vstinner
priority: normal
severity: normal
status: open
title: aarch64 RHEL7 LTO + PGO 3.7: "make" hangs when running test_asyncio
versions: Python 3.7

___
Python tracker 

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



[issue43030] signed/unsigned mismatch in Py_UNICODE_ISSPACE macro

2021-01-26 Thread Matthias Klose


Matthias Klose  added the comment:

# 26 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4
typedef int wchar_t;
# 32 "/usr/include/stdlib.h" 2 3 4

[...]

# 1 "/usr/include/python3.9/cpython/unicodeobject.h" 1
# 14 "/usr/include/python3.9/cpython/unicodeobject.h"
 typedef wchar_t Py_UNICODE;
# 53 "/usr/include/python3.9/cpython/unicodeobject.h"

yes, x86_64-linux-gnu.

--

___
Python tracker 

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



[issue42988] Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-01-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 24337 uses different approach. It keeps compatibility, but checks that the 
argument is a file path of the source of one of modules (using the same 
algorithm as /search).

--

___
Python tracker 

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



[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

[Serhiy]

> Just making the parser [...] recognizing "i" as well as "j" as complex number 
> suffix.

Okay, thanks. I doubt that that will be enough to silence the repeated 
requests: people are still going to complain that the value that was entered as 
`1i` is being displayed as `1j`. I don't see a sane path towards changing that.

--

___
Python tracker 

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



[issue42988] Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-01-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +23156
pull_request: https://github.com/python/cpython/pull/24337

___
Python tracker 

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



[issue43030] signed/unsigned mismatch in Py_UNICODE_ISSPACE macro

2021-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

> ‘Py_UNICODE’ {aka ‘int’}

Python defines Py_UNICODE as wchar_t: typedef wchar_t Py_UNICODE;

Is wchar_t signed (int type) on Debian? Which is your architecture?

> [forwarded from https://bugs.debian.org/961396]

It says amd64.

--
nosy: +methane, vstinner

___
Python tracker 

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



[issue43030] signed/unsigned mismatch in Py_UNICODE_ISSPACE macro

2021-01-26 Thread Matthias Klose

New submission from Matthias Klose :

[forwarded from https://bugs.debian.org/961396]

$ cat > foo.c
#include 

int main(int argc, char *argv[])
{
Py_UNICODE x = 0;

return Py_UNICODE_ISSPACE(x);
}

$ gcc -Wsign-compare -Werror $(pkg-config --cflags python3) foo.c
In file included from /usr/include/python3.9/unicodeobject.h:1026,
 from /usr/include/python3.9/Python.h:97,
 from foo.c:1:
foo.c: In function ‘main’:
/usr/include/python3.9/cpython/unicodeobject.h:25:11: error: comparison of 
integer expressions of different signedness: ‘Py_UNICODE’ {aka ‘int’} and 
‘unsigned int’ [-Werror=sign-compare]
   25 | ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : 
_PyUnicode_IsWhitespace(ch))
  |   ^
foo.c:7:16: note: in expansion of macro ‘Py_UNICODE_ISSPACE’
7 | return Py_UNICODE_ISSPACE(x);
  |^~
cc1: all warnings being treated as errors

--
components: Extension Modules
messages: 385707
nosy: doko
priority: normal
severity: normal
status: open
title: signed/unsigned mismatch in Py_UNICODE_ISSPACE macro
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



[issue42606] Support POSIX atomicity guarantee of O_APPEND on Windows

2021-01-26 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

> I think truncation via TRUNCATE_EXISTING (O_TRUNC, with O_WRONLY or O_RDWR) 
> or overwriting with CREATE_ALWAYS (O_CREAT | O_TRUNC) is at least tolerable 
> because the caller doesn't care about the existing data. 

Yes, I had a thought that creating or truncating a file when asked is in some 
sense "less wrong" than deleting an existing file on open() failure, but I'm 
still not comfortable with it. It would be nice, for example, if an open() with 
O_CREAT | O_EXCL failed, then the file would indeed not be created in all cases.

>> Truncation can simply be deferred until we have the fd and then performed 
>> manually.

> If the file itself has to be overwritten (i.e. the default, anonymous data 
> stream), as opposed to a named data stream, it would have to delete all named 
> data streams and extended attributes in the file. Normally that's all 
> implemented atomically in the filesystem. 

> In contrast, TRUNCATE_EXISTING (O_TRUNC) is simple to emulate, since 
> CreateFileW implents it non-atomically with a subsequent 
> NtSetInformationFile: FileAllocationInformation system call. 

Oh. So CREATE_ALWAYS for an existing file has a very different semantics than 
TRUNCATE_EXISTING, which means we can't easily use OPEN_ALWAYS with a deferred 
manual truncation, I see.

>> But I still don't know how to deal with O_TEMPORARY, unless there is a 
>> way to unset FILE_DELETE_ON_CLOSE on a handle.

> For now, that's possible with NTFS and the Windows API in all supported 
> versions of Windows by using a second kernel File with DELETE access, which 
> is opened before the last handle to the first kernel File is closed. After 
> you close the first open, use the second one to call SetFileInformation: 
> FileDispositionInfo to undelete the file.

So the idea is to delete the file for a brief period, but then undelete it. As 
I understand it, any attempt to open the file while it's in the deleted state 
(but still has a directory entry) will fail. This is probably not critical 
since it could happen only on an unlikely failure of _open_oshandle(), but is 
still less than perfect.

> Windows 10 supports additional flags with FileDispositionInfoEx (21), or 
> NTAPI FileDispositionInformationEx [1]. This provides a better way to disable 
> or modify the delete-on-close state per kernel File object, if the filesystem 
> supports it.

This is nice and would reduce our non-atomicity to just the following: if 
_wopen() would have failed even before CreateFile() (e.g. due to EMFILE), our 
reimplementation could still create a handle with FILE_DELETE_ON_CLOSE, so if 
our process is terminated before we unset it, we'll still lose the file. But it 
seems like the best we can get in any situation when we need to wrap a handle 
with an fd.

===

Regarding using WriteFile()-with-OVERLAPPED approach in FileIO, I've looked at 
edge cases of error remapping in MSVCRT write() again. If the underlying 
WriteFile() fails, it only remaps ERROR_ACCESS_DENIED to EBADF, presumably to 
deal with write() on a O_RDONLY fd. But if WriteFile() writes zero bytes and 
does not fail, it gets more interesting:

* If the file type is FILE_TYPE_CHAR and the first byte to write was 26 
(Ctrl-Z), it's treated as success. I don't think I understand: it *seems* like 
it's handling something like writing to the *input* of a console, but I'm not 
sure it's even possible in this manner.

* Anything else is a failure with ENOSPC. This is mysterious too.

I've checked how java.io.FileOutputStream deals with WriteFile() succeeding 
with zero size (just to compare with another language runtime) and haven't 
found any special handling[1]. Moreover, it seems like 
FileOutputStream.write(bytes[]) will enter an infinite loop if WriteFile() 
always returns 0 for a non-empty byte array[2]. So it's unclear to me what 
MSVCRT is up to here and whether FileIO should do the same.

[1] 
https://github.com/openjdk/jdk/blob/b4ace3e9799dab5970d84094a0fd1b2d64c7f923/src/java.base/windows/native/libjava/io_util_md.c#L522
[2] 
https://github.com/openjdk/jdk/blob/b4ace3e9799dab5970d84094a0fd1b2d64c7f923/src/java.base/share/native/libjava/io_util.c#L195

--

___
Python tracker 

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



[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Just making the parser (and the complex constructor) recognizing "i" as well as 
"j" as complex number suffix. Others already proposed more complex changes like 
adding options for formatting complex numbers, but I did not though about it. 
It is just a coincidence that I though about this idea in the same day as the 
OP opened the issue.

--

___
Python tracker 

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



[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

Serhiy: what *specific* proposal were you considering? If your proposal 
includes changing the complex str/repr to use "i" instead of "j", how do you 
propose to address the backwards compatibility problem?

--

___
Python tracker 

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



[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2021-01-26 Thread Irit Katriel


Change by Irit Katriel :


--
status: open -> closed

___
Python tracker 

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



[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2021-01-26 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset dea5bf9d15999bfcc58095b157c0678d45b00bdd by Irit Katriel in 
branch 'master':
bpo-33387: update documentation for exception handling opcode changes (GH-24334)
https://github.com/python/cpython/commit/dea5bf9d15999bfcc58095b157c0678d45b00bdd


--

___
Python tracker 

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



[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Only yesterday I thought about proposing this idea. I used to think using "i" 
or "j" was a type of local feature, like using a comma or a period as a decimal 
separator, or different writing for less-or-equal, but it looks like even in 
the English-speaking world mathematics use "i", and "j" is only used by 
electric engineers.

Possible argument against the "i" suffix is that its capital form "I" can be 
confused with the "l" suffix for longs (but it is no longer applicable in 
Python 3) and digit "1". Although there is more similarity between "l" and "1" 
them between them both and "I", and there are other pairs of potentially 
confusing characters: "O" (for octals) and "0", "B" (for binaries) and "8".

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue12734] Request for property support in Python re lib

2021-01-26 Thread John Mark Vandenberg


Change by John Mark Vandenberg :


--
nosy: +jayvdb

___
Python tracker 

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



[issue43029] unittest: Add assertUniqeIn

2021-01-26 Thread Denis Roussel


Change by Denis Roussel :


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

___
Python tracker 

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



[issue38250] enum.Flag should be more set-like

2021-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

test_enum fails when Python is installed:

PPC64LE Fedora Rawhide Clang Installed 3.x:
https://buildbot.python.org/all/#builders/312/builds/597

0:01:37 load avg: 8.99 [232/426/1] test_enum failed -- running: test_tokenize 
(1 min 37 sec), test_unparse (31.7 sec), test_concurrent_futures (37.5 sec)
Failed to call load_tests:
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/unittest/loader.py",
 line 130, in loadTestsFromModule
return load_tests(self, tests, pattern)
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/test/test_enum.py",
 line 20, in load_tests
tests.addTests(doctest.DocFileSuite(
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/doctest.py",
 line 2511, in DocFileSuite
suite.addTest(DocFileTest(path, **kw))
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/doctest.py",
 line 2433, in DocFileTest
doc, path = _load_testfile(path, package, module_relative,
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/doctest.py",
 line 231, in _load_testfile
file_contents = loader.get_data(filename)
  File "", line 1023, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 
'/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/test/../../Doc/library/enum.rst'

test test_enum crashed -- Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/test/libregrtest/runtest.py",
 line 272, in _runtest_inner
refleak = _runtest_inner2(ns, test_name)
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/test/libregrtest/runtest.py",
 line 236, in _runtest_inner2
test_runner()
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-ppc64le.clang-installed/build/target/lib/python3.10/test/libregrtest/runtest.py",
 line 210, in _test_module
raise Exception("errors while loading tests")
Exception: errors while loading tests


Tests are loaded by Lib/test/test_enum.py with:

def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(enum))
tests.addTests(doctest.DocFileSuite(
'../../Doc/library/enum.rst',
optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE,
))
return tests

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue43029] unittest: Add assertUniqeIn

2021-01-26 Thread Denis Roussel


New submission from Denis Roussel :

Allows to test uniqueness of members of a list

--
components: Tests
messages: 385700
nosy: rousseldenis
priority: normal
severity: normal
status: open
title: unittest: Add assertUniqeIn

___
Python tracker 

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



[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-26 Thread Tadek Kijkowski


Tadek Kijkowski  added the comment:

>> In the docs fruits example, though, I think the input and output are 
>> inconsistent: you have a brown banana reported as yellow?

Yeah, I noticed that and fixed already :)


I agree with your ideas. My goal was just to provide bare minimum that would 
allow users to implement this functionality on their own, but turning it into 
something useful out of the box sounds like a good idea.

There could be new predefined action, e.g. 'extend_with_capture' (or just 
'extend_capture') which could be used like this:

  parser.add_argument('fruits', nargs='*', action='extend_capture', 
capture_once=['color'])

Where 'capture' would be one of: a list of parameters to capture (could be a 
string instead of a list if it's just one parameter) or '*' to capture all 
optional parameters and 'capture_once' would be similar list of parameters to 
capture and reset to default.

>> Does the namespace still contain the default value for an optional after it 
>> has been used?  It looks like it might

I think it does - not the namespace, but ArgumentParser, which is also 
available in Action.__call__, has 'get_defaults'.

>> I'm not sure how that plays with optionals that use append or append_const 
>> storage methods, nor do I fully understand the comment in "def 
>> _copy_items(items):"

I don't see any danger here, the action will just have to make sure to capture 
copy of the array, rather than reference to it. The same applies to 'extend'.

--

___
Python tracker 

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



[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output

2021-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

> The AMD64 Arch Linux Asan 3.x buildbot worker started to fail at build 262:
> https://buildbot.python.org/all/#/builders/582/builds/262

It no longer fails, so I close the issue:
https://buildbot.python.org/all/#/builders/582/builds/278

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



[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output

2021-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

Pablo added ASAN_OPTIONS=handle_segv=0 env var to his buildbot worker:
https://github.com/python/buildmaster-config/commit/3ae3e1b21a20a06628a225579174e2aa46830583

--

___
Python tracker 

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



[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

> cmath.nanj

That should be cmath.nani, of course. Sorry.

--

___
Python tracker 

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



[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

See also #10562.

Conceivably, we could add support for `i` on parsing (along with adding 
`cmath.infi` and `cmath.nanj`). We can probably also find a way to extend the 
format specification to allow use of `i` in place of `j` on output. The harder 
problem would be changing the repr and str of complex without breaking existing 
code. I doubt that the OP would be satisfied with the following:

>>> 3 + 4i
(3+4j)

--
nosy: +mark.dickinson

___
Python tracker 

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