[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-20 Thread Brian Romanowski


Brian Romanowski  added the comment:

I took a look at Parser/tokenizer.c.  From what I can tell, the tokenizer does 
fake a newline character when the input buffer does not end with actual newline 
characters and that the returned NEWLINE token has an effective length of 1 
because of this faked newline character.  That is, tok->cur - tok->start == 1 
when the NEWLINE token is returned.

If this part of the C tokenizer is meant to be modeled exactly by the Python 
tokenize module, then the current code is correct.  If there is some wiggle 
room because tok->start and tok->cur are converted into line numbers and column 
offsets, then maybe it's acceptable to change them?  If not, then the current 
documentation is misleading because the newline_token_2.end[1] element from my 
original example is not "...  column where the token ends in the source".  
There is no such column.

I'm not sure whether the C tokenizer exposes anything like 
newline_token_2.string, directly.  If so, does it hold the faked newline 
character or does it hold the empty string like the current tokenize module 
does?

I'm also not sure whether the C tokenizer exposes anything like 
newline_token_2.line.  If it does, I'd be surprised if the faked newline would 
cause this to somehow become the empty string instead of the actual line 
content.  So I'm guessing that current tokenize module's behavior here is still 
a real bug?  If not, then this is another case that might benefit from some 
edge-case documentation.

--

___
Python tracker 

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



[issue42980] argparse: GNU-style help formatter

2021-01-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This sounds reasonable to me and the patch is non-invasive.  Paul, what do you 
think?

--

___
Python tracker 

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



[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-01-20 Thread hai shi


hai shi  added the comment:

> New C API functions must not return borrowed references, but strong 
> references.

Thanks petr, victor for your suggestion. It's more friendly to users.

> Which one should be returned by PyType_GetName()? Is there a warranty that 
> it's always short or always qualified?

Returning short or qualified name depends on how to define the tp_name in 
PyType_Spec or type object. IMHO, PyType_GetName() return the original defined 
type name is fine to users.

--

___
Python tracker 

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



[issue42980] argparse: GNU-style help formatter

2021-01-20 Thread hai shi


Change by hai shi :


--
nosy: +paul.j3, rhettinger

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-01-20 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
nosy: +orsenthil

___
Python tracker 

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



[issue42987] HTTP header injection in urllib on windows

2021-01-20 Thread bfpiaoran


New submission from bfpiaoran :

Recently,(on windows) I discovered a security issue during a security review 
due to urllib.I checked the document and found that it has been fixed at 
https://bugs.python.org/issue22928.but My python version is 3.7.2 over the fix 
bug version .Then tried to find the reason
The code is probably as follows under the django framework

```
from urllib.request import urlopen



remote_urls = request.POST.getlist("source[]", [])
for remote_url in remote_urls:
remote_image = urlopen(remote_url)

```
source[]=http://127.0.0.1:6379/%0d%0aset%20ce%20test%0d%0a/1.jpg

Changing the address will make urlopen connect to the local machine 6379 and 
set the key value

python3 



Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.utils.six.moves.urllib.request import urlopen
>>> remote_image = urlopen('http://127.0.0.1:6379/\r\nset ce test\r\n/1.jpg')
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py",
 line 222, in urlopenreturn opener.open(url, data, timeout)
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py",
 line 525, in open   response = self._open(req, data)
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py",
 line 543, in _open  '_open', req)
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py",
 line 503, in _call_chainresult = func(*args)
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py",
 line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py",
 line 1320, in do_open
r = h.getresponse()
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\http\client.py",
 line 1321, in getresponse
response.begin()
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\http\client.py",
 line 296, in begin
version, status, reason = self._read_status()
  File 
"C:\Users\cuijianxiong\AppData\Local\Programs\Python\Python37-32\lib\http\client.py",
 line 278, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: $-1



Django will encode and decode urlopen because of the url specification, and 
accept requests with "\r\n" in the url


It is the responsibility of the developer leveraging Python and its HTTP client 
libraries to ensure that their (web) application acts in accordance to official 
HTTP specifications and that no threats to security will arise from their code.
However, newlines inside headers are arguably a special case of breaking the 
conformity with RFC's in regard to the allowed character set. No illegal 
character used inside a HTTP header is likely to have a compromising side 
effect on back-end clients and servers and the integrity of their 
communication, as a result of the leniency of most web servers. However, a 
newline character (0x0A) embedded in a HTTP header invariably has the semantic 
consequence of denoting the start of an additional header line. To put it 
differently, not sanitizing headers in complete accordance to RFC's could be 
seen as as virtue in that it gives the programmer a maximum amount of freedom, 
without having to trade it for any likely or severe security ramifications, so 
that they may use illegal characters in testing environments and environments 
that are outlined by an expliticly less strict interpretation of the HTTP 
protocol. Newlines are special in that they enable anyone who is able to 
influence the header
  content, to, in effect, perform additional invocations to add_header().


urlopen('http://106.53.251.216:/\r\Auth: test\r\n/1.jpg')


Ncat: Version 7.70 ( https://nmap.org/ncat )
Ncat: Listening on :::
Ncat: Listening on 0.0.0.0:
Ncat: Connection from 111.202.227.139.
Ncat: Connection from 111.202.227.139:14411.
\Auth: test
/1.jpg HTTP/1.1
Accept-Encoding: identity
Host: 106.53.251.216:
User-Agent: Python-urllib/3.7
Connection: close



I think https://bugs.python.org/issue22928 is not very thorough and does not 
fully detect line breaks

--
messages: 385389
nosy: bfpiaoran, lemburg, orsenthil
priority: normal
severity: normal
status: open
title: HTTP header injection in urllib on windows
type: security
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



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

2021-01-20 Thread Tadek Kijkowski


Tadek Kijkowski  added the comment:

>> I tried to checkout python sources, but even with -depth 1 it took too long 
>> for my patience and I gave up after 'du -sh .git' showed 2G.

Ignore that. I must have been doing something worng.

--

___
Python tracker 

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



[issue42843] What min_sphinx for Python 3.10

2021-01-20 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +23103
pull_request: https://github.com/python/cpython/pull/24282

___
Python tracker 

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



[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-20 Thread Brian Romanowski


Brian Romanowski  added the comment:

Shoot, just realized that consistency isn't the important thing here, the most 
important thing is that the tokenizer module exactly matches the output of the 
Python tokenizer.  It's possible that my changes violate that constraint, I'll 
take a look at that.

--

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



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

2021-01-20 Thread Tadek Kijkowski


Tadek Kijkowski  added the comment:

>> Your example is incomplete.  That is _CustomAction?  What namespace does 
>> your patch produce.

>> In your example I'd suggest making '--tracks' a nargs=2 and 'append' option. 
>>  'choices' would have to be replaced with a either a custom 'type', a custom 
>> Action, or post-parsing testing.

My use case and example were oversimplified. The real life use case would be a 
program that processes multiple sources, with various processing parameters 
which may change between sources and writes result to destination:

example.py:

#! /usr/bin/python3

import argparse

class _AddSourceAction(argparse.Action):
def __init__(self, option_strings, dest, nargs=None, const=None,
 default=None, type=None, choices=None, required=False,
 help=None, metavar=None):
super(_AddSourceAction, self).__init__(
option_strings=option_strings, dest=dest, nargs=nargs,
const=const, default=default, type=type,
choices=choices, required=required, help=help,
metavar=metavar)

def __call__(self, parser, namespace, values, option_string=None):
for source in values:
namespace.sources.append({'name': source,
'frobnicate': namespace.frobnicate,
'massage_level': namespace.massage_level})

def process_files(dest, sources):
for source in sources:
frob = source["frobnicate"]
print("processing %s, %sfrobnication, massage level %d " %
  (source["name"],
  "default " if frob is None else "no " if frob == False else "",
  source["massage_level"]))
print("saving output to %s" % dest)

parser = argparse.ArgumentParser()
if hasattr(parser, "greedy_star"):
setattr(parser, "greedy_star", True)
parser.add_argument('destination')
parser.add_argument('--frobnicate', action='store_true', dest='frobnicate')
parser.add_argument('--no-frobnicate', action='store_false', dest='frobnicate')
parser.add_argument('--massage-level', type=int, default=5)
parser.add_argument('sources', metavar="source", nargs='*', 
action=_AddSourceAction)
parser.set_defaults(sources=[])
parser.set_defaults(frobnicate=None)
args = parser.parse_args()

process_files(args.destination, args.sources)

Without patch:

$ ./example.py output.txt --massage-level 4 input1.txt input2.txt 
--massage-level 5 input3.txt --frobnicate input4.txt input5.txt
example.py: error: unrecognized arguments: input1.txt input2.txt input3.txt 
input4.txt input5.txt

With patch:

$ PYTHONPATH=patch ./example.py output.txt --massage-level 4 input1.txt 
input2.txt --massage-level 5 input3.txt --frobnicate input4.txt input5.txt
processing input1.txt, default frobnication, massage level 4
processing input2.txt, default frobnication, massage level 4
processing input3.txt, default frobnication, massage level 5
processing input4.txt, frobnication, massage level 5
processing input5.txt, frobnication, massage level 5
saving output to output.txt

Note that I avoided passing greedy_star to constructor, to avoid error with 
unpatched argparse. Maybe that should be recommended way to enable this 
feature? N.b. I don't quite like this name 'greedy_star' seems to informal for 
me, but I didn't come up with anything better.

In this example frobnicate and massage_level apply to all following sources, 
but _AddSourceAction could be modified to reset their values, so they would 
only apply to first following source.

>> It's been a while since I worked on the intermixed patch, but as I recall 
>> the OP was happy with the fix.  Also I don't recall any talk about 'matching 
>> "optionals" with "positionals" with they relate to. Was that part of the 
>> discussion?
>> On Stackoverflow I have seen questions about pairing arguments, and answered 
>> some.  I don't recall the best answers.  The tough version is when some of 
>> the grouped inputs may be missing 

The use case above seems quite basic and common to me. I'm surprises that I 
actually didn't find any question on stackoverflow about this exact use case.

>> One question I frequently ask posters who want to parse complex inputs is: 
>> 'how are going to explain this to your users?'  'What kind of usage and help 
>> do you want see?'

I would (and I will, because I'm really working on a project which will do 
something like this) put all options which apply to source files into separate 
option group and add help string to this option group which explains that those 
options may be specified between source files and that they apply to all (or 
just first) following source files.

>> Your patch is incomplete, without documentation or tests.

Yeah, I can work on that if there is any chance that this will go anywhere. 
This is an effort from my side however, because I have quite slow mobile link 
at this moment. I tried to checkout python sources, but even with -depth 1 it 
took too long for my patience and I gave up after 'du 

[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks, everyone for your valuable comments and for explaining your concerns!

I will close the PR as it seems that there is no clear consensus that will be a 
win after balancing the problems.

--

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

-0 for this PR.  It would cause more problems than it solves, and traditionally 
we leave this sort of problem for linters and type checkers.  Also, this kind 
of error surfaces readily with even minimal testing.  So, I don't think this PR 
is worth it.

That said, don't stop looking for places where the parser can provide more 
useful error reporting.  Some parsing errors are truly inscrutable.

--
nosy: +rhettinger

___
Python tracker 

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



[issue42392] remove the deprecated 'loop' parameter asyncio API

2021-01-20 Thread miss-islington


miss-islington  added the comment:


New changeset dcea78ff53d02733ac5983255610b651aa1c0034 by Ken Jin in branch 
'master':
bpo-42392: Mention loop removal in whatsnew for 3.10 (GH-24256)
https://github.com/python/cpython/commit/dcea78ff53d02733ac5983255610b651aa1c0034


--
nosy: +miss-islington

___
Python tracker 

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



[issue42986] pegen parser: Crash on SyntaxError with f-string on Windows

2021-01-20 Thread neonene


neonene  added the comment:

For me, I confirmed no crash with PR 24279.
Thanks for the fix in no time.

--

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Of course, being said all this, if the general consensus is that is not worth 
the trouble, I am happy to retract the PR :)

--

___
Python tracker 

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



[issue42968] multiprocessing handle leak on Windows when child process is killed during startup/unpickling

2021-01-20 Thread Eryk Sun


Eryk Sun  added the comment:

I'm not fond of the way reduction.DupHandle() expects the receiving process to 
steal the duplicated handle. I'd prefer using the resource_sharer module, like 
reduction.DupFd() does in POSIX. Except spawning is a special case, for which 
reduction.DupHandle() can take advantage of the duplicate_for_child() method of 
the popen_spawn_win32.Popen instance.

With the resource sharer, the handle still needs to be duplicated in the 
sending process. But an important difference is the resource_sharer.stop() 
method, which at least allows closing any handles that no longer need to be 
shared.

---

Proposed Changes (untested)

resource_sharer.py:

class DupHandle(object):
'''Wrapper for a handle that can be used at any time.'''
def __init__(self, handle):
dh = reduction.duplicate(handle)
def send(conn, pid):
reduction.send_handle(conn, dh, pid)
def close():
_winapi.CloseHandle(dh)
self._id = _resource_sharer.register(send, close)

def detach(self):
'''Get the handle. This should only be called once.'''
with _resource_sharer.get_connection(self._id) as conn:
return reduction.recv_handle(conn)


reduction.py:

def send_handle(conn, handle, destination_pid):
'''Send a handle over a local connection.'''
proc = _winapi.OpenProcess(_winapi.PROCESS_DUP_HANDLE, False,
destination_pid)
try:
dh = duplicate(handle, proc)
conn.send(dh)
finally:
_winapi.CloseHandle(proc)

def recv_handle(conn):
'''Receive a handle over a local connection.'''
return conn.recv()

class _DupHandle:
def __init__(self, handle):
self.handle = handle
def detach(self):
return self.handle

def DupHandle(handle):
'''Return a wrapper for a handle.'''
popen_obj = context.get_spawning_popen()
if popen_obj is not None:
return _DupHandle(popen_obj.duplicate_for_child(handle))
from . import resource_sharer
return resource_sharer.DupHandle(handle)


connection.py:

def reduce_pipe_connection(conn):
dh = reduction.DupHandle(conn.fileno())
return rebuild_pipe_connection, (dh, conn.readable, conn.writable)

def rebuild_pipe_connection(dh, readable, writable):
return PipeConnection(dh.detach(), readable, writable)

reduction.register(PipeConnection, reduce_pipe_connection)

--
components: +Library (Lib)
nosy: +eryksun
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



[issue42986] pegen parser: Crash on SyntaxError with f-string on Windows

2021-01-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue42986] pegen parser: Crash on SyntaxError with f-string on Windows

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Seems that this problem was introduced by 
e5fe509054183bed9aef42c92da8407d339e8af8

--

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Guido already listed them. Library functions, static and class methods, 

PR 24272 will work on all those cases.

>  and names like slf and _self (used either in local classes and wrapper 
> functions to avoid conflict with the self parameter of the outer method or as 
> a poor positional-only parameter).

That's fine, the error is a suggestion (as we do in other parts of the stdlib), 
and the places where "self" is not used is normally rare. The old error is 
still there. The cases you mention are valid but I would say there are the 
exception and if someone is writing them they will probably still be able to 
make sense of the error.

> The problem with missing "self" does not look so common and hard to correctly 
> determine as the above examples.

Is true, but I think that the cases were this will raise a false positive is 
very rare and make the benefits of the error message appealing (at least to 
me). 

>  We want to keep the interpreter so simple as possible, and the proposed 
> feature looks to me far the bar of compromise.

This is an excellent point. THe only reason I am giving this a go is because 
this error message is super confusing to newcomers and educators are asking us, 
again and again, to include this hint as pypy is doing currently.

--

___
Python tracker 

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



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2021-01-20 Thread cptpcrd


Change by cptpcrd :


--
pull_requests: +23101
pull_request: https://github.com/python/cpython/pull/24278

___
Python tracker 

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



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2021-01-20 Thread cptpcrd


Change by cptpcrd :


--
pull_requests: +23100
pull_request: https://github.com/python/cpython/pull/24277

___
Python tracker 

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



[issue42986] pegen parser: Crash on SyntaxError with f-string on Windows

2021-01-20 Thread neonene


New submission from neonene :

On Windows, Python master crashes using f-string (which has an invalid char 
with braces) on line 3 and after.
It seems the issue is from commit (e5fe509054183bed9aef42c92da8407d339e8af8).

I tried

1) exec("f'{.}'")
2) exec("\nf'{.}'")
3) exec("\n\nf'{.}'")

commands and results are

1) expected
>>> exec("f'{.}'")
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1
(.)
 ^
SyntaxError: f-string: invalid syntax

2) unexpected (caret indicates nothing)
>>> exec("\nf'{.}'")
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2

^
SyntaxError: f-string: invalid syntax

3) python crashes
>>> exec("\n\nf'{.}'")

--
components: Interpreter Core
messages: 385377
nosy: lys.nikolaou, neonene, pablogsal
priority: normal
severity: normal
status: open
title: pegen parser: Crash on SyntaxError with f-string on Windows
type: crash
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



[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-20 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Tried applying bpo-42972 to sqlite and functools, but the error persists.

--

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Could you list some cases where this will give the wrong advice?

Guido already listed them. Library functions, static and class methods, and 
names like slf and _self (used either in local classes and wrapper functions to 
avoid conflict with the self parameter of the outer method or as a poor 
positional-only parameter).

> We have other errors where we are not completely sure and we formulate the 
> suggestion as a question. Some examples are the new error for incomplete 
> imports and some missing coma errors.

There were reasons for adding that suggestions. An error with partial recursive 
import is pretty common, but the error message did not have any clue about the 
prevalent cause of error.

The problem with missing comma in a sequence is that since the code is always 
multiline, the traceback never contains enough information about the problem. 
And we are sure that the only case when the suggestion is wrong is when you 
intentionally wrote incorrect code.

The problem with missing "self" does not look so common and hard to correctly 
determine as the above examples. We want to keep the interpreter so simple as 
possible, and the proposed feature looks to me far the bar of compromise.

--

___
Python tracker 

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



[issue40176] unterminated string literal tokenization error messages could be better

2021-01-20 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue40176] unterminated string literal tokenization error messages could be better

2021-01-20 Thread miss-islington


miss-islington  added the comment:


New changeset a698d52c3975c80b45b139b2f08402ec514dce75 by Batuhan Taskaya in 
branch 'master':
bpo-40176: Improve error messages for unclosed string literals (GH-19346)
https://github.com/python/cpython/commit/a698d52c3975c80b45b139b2f08402ec514dce75


--
nosy: +miss-islington

___
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-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +pablogsal

___
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-20 Thread STINNER Victor


New submission from STINNER Victor :

The AMD64 Arch Linux Asan 3.x buildbot worker started to fail at build 262:
https://buildbot.python.org/all/#/builders/582/builds/262
---
...
0:39:09 load avg: 1.15 running: test_multiprocessing_forkserver (30.0 sec)
0:39:39 load avg: 1.64 running: test_multiprocessing_forkserver (1 min)
0:39:53 load avg: 1.50 [419/420] test_multiprocessing_forkserver passed (1 min 
12 sec)
0:39:53 load avg: 1.50 [420/420] test_dynamicclassattribute passed

command timed out: 1200 seconds without output running (...)
process killed by signal 9
program finished with exit code -1
elapsedTime=3595.378040
---

--
components: Tests
messages: 385373
nosy: vstinner
priority: normal
severity: normal
status: open
title: AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without 
output
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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Do you also exclude class and static methods?

Yup, there is a test in the PR for that IIRC

>I still worry that this might confuse users when a library for some reason 
>uses a different name than 'self'.

That's a good point but I think it should be fine because the old error is 
still there and the new part is formulated as a question (did you forgot ...?). 
We have other errors where we are not completely sure and we formulate the 
suggestion as a question. Some examples are the new error for incomplete 
imports and some missing coma errors.

--

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

> I use the same heuristic as Pypy: the callable is a bound method, the first 
> name in the definition is not named "self" and it was called with n+1 
> positional arguments.

Okay, that makes sense, you could have said so in the bug or PR description. :-)

Do you also exclude class and static methods?

I still worry that this might confuse users when a library for some reason uses 
a different name than 'self'.

--

___
Python tracker 

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



[issue42984] Python 3.7 and qt Libraries

2021-01-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

I recommend asking on a user forum, perhaps https://discuss.python.org/c/users/

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



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

2021-01-20 Thread paul j3


paul j3  added the comment:

Your patch is incomplete, without documentation or tests.

Your example is incomplete.  That is _CustomAction?  What namespace does your 
patch produce.

It's been a while since I worked on the intermixed patch, but as I recall the 
OP was happy with the fix.  Also I don't recall any talk about 'matching 
"optionals" with "positionals" with they relate to. Was that part of the 
discussion?

On Stackoverflow I have seen questions about pairing arguments, and answered 
some.  I don't recall the best answers.  The tough version is when some of the 
grouped inputs may be missing 

In your example I'd suggest making '--tracks' a nargs=2 and 'append' option.  
'choices' would have to be replaced with a either a custom 'type', a custom 
Action, or post-parsing testing.

I haven't had time yet to test your patch.

One question I frequently ask posters who want to parse complex inputs is: 'how 
are going to explain this to your users?'  'What kind of usage and help do you 
want see?'

--

___
Python tracker 

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



[issue42983] sys.argv incorrectly parses command lines with args in environment variables.

2021-01-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

That looks like you need to learn more about the shell. It is not a Python bug.

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



[issue42984] Python 3.7 and qt Libraries

2021-01-20 Thread Rob Simsiman


New submission from Rob Simsiman :

Hello,

I am trying to run an application on CentOS-8 that is unable to find qt4 
libraries, namely libQtCore.so.4. My PC has qt5 libraries, namely 
libQt5Core.so.5. How can I configure my Python 3.7 to look for the qt5 
libraries instead of the qt4 libraries. Or, do I simply need to grab a newer 
version of Python?

Thank you,

Rob Simsiman

--
components: ctypes
messages: 385367
nosy: rsimsiman
priority: normal
severity: normal
status: open
title: Python 3.7 and qt Libraries
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-01-20 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2021-01-20 Thread Illia Volochii


Change by Illia Volochii :


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

___
Python tracker 

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



[issue42983] sys.argv incorrectly parses command lines with args in environment variables.

2021-01-20 Thread Jason Williams


Change by Jason Williams :


Added file: https://bugs.python.org/file49754/private_key.pem

___
Python tracker 

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



[issue42980] argparse: GNU-style help formatter

2021-01-20 Thread Will Noble


Change by Will Noble :


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

___
Python tracker 

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



[issue42983] sys.argv incorrectly parses command lines with args in environment variables.

2021-01-20 Thread Jason Williams


Change by Jason Williams :


--
components: +Library (Lib)
type:  -> behavior

___
Python tracker 

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



[issue42983] sys.argv incorrectly parses command lines with args in environment variables.

2021-01-20 Thread Jason Williams


New submission from Jason Williams :

Passing arguments to a Python script using an environment variable like:

export en_auth="--arg1 test --arg2 \"$(https://bugs.python.org/file49753/test.py

___
Python tracker 

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



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2021-01-20 Thread Illia Volochii


New submission from Illia Volochii :

Documentation [1] suggests using at least 100,000 iterations of SHA-256 as of 
2013.

Currently, it is 2021, and it is common to use much more iterations.
For example, Django will use 260,000 by default in the next 3.2 LTS release and 
320,000 in 4.0 [2][3].

I suggest suggesting at least 250,000 iterations that is a somewhat round 
number close to the one used by modern libraries.

[1] https://docs.python.org/3/library/hashlib.html#hashlib.pbkdf2_hmac
[2] 
https://github.com/django/django/commit/f2187a227f7a3c80282658e699ae9b04023724e5
[3] 
https://github.com/django/django/commit/a948d9df394aafded78d72b1daa785a0abfeab48

--
assignee: docs@python
components: Documentation
messages: 385365
nosy: docs@python, illia-v
priority: normal
severity: normal
status: open
title: Update suggested number of iterations for pbkdf2_hmac()

___
Python tracker 

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



[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-20 Thread SylvainDe


SylvainDe  added the comment:

For similar reasons as friendly-traceback, I'd be interested in a list of 
stdlib modules to be able to provide additional information in case of 
exceptions.

For instance:

string.ascii_lowercase
> Before: NameError("name 'string' is not defined",)
> After: NameError("name 'string' is not defined. Did you mean to import string 
> first)

from maths import pi
> Before: ImportError('No module named maths',)
> After: ImportError("No module named maths. Did you mean 'math'?",)

choice
> Before: NameError("name 'choice' is not defined",)
> After: NameError("name 'choice' is not defined. Did you mean 'choice' from 
> random (not imported)?",)

from itertools import pi
> Before: ImportError('cannot import name pi',)
> After: ImportError("cannot import name pi. Did you mean 'from math import 
> pi'?",)

The first 2 cases only use the module name but the last 2 cases will actually 
import the modules to get the names in it and I want to do this for modules 
which are safe to import (no side-effect expected).

Source: 
https://github.com/SylvainDe/DidYouMean-Python/blob/master/didyoumean/didyoumean_internal.py#L30
 (but if you are interested in that kind of features, I'd recommend using 
friendly-traceback instead)

--
nosy: +SylvainDe

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Seems that that guess will be wrong in most cases.

Maybe I am missing something. Could you list some cases where this will give 
the wrong advice?

--

___
Python tracker 

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



[issue42864] Improve error messages regarding unclosed parentheses

2021-01-20 Thread miss-islington


miss-islington  added the comment:


New changeset c3f167d7b243f8b8e1b797586e6cef35add013bc by Pablo Galindo in 
branch 'master':
bpo-42864: Simplify the tokenizer exceptions after generic SyntaxError 
(GH-24273)
https://github.com/python/cpython/commit/c3f167d7b243f8b8e1b797586e6cef35add013bc


--
nosy: +miss-islington

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I don't think this makes sense. How do you know there's a missing 'self'? 
> Surely it's just as likely that there is indeed an extra argument. Especially 
> if A.foo is defined by a library (stdib or 3rd party).

I use the same heuristic as Pypy: the callable is a bound method, the first 
name in the definition is not named "self" and it was called with n+1 
positional arguments

--

___
Python tracker 

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



[issue42981] Error messages raised by _hashlib_scrypt_impl() are slightly misleading

2021-01-20 Thread Illia Volochii


Change by Illia Volochii :


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

___
Python tracker 

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



[issue42981] Error messages raised by _hashlib_scrypt_impl() are slightly misleading

2021-01-20 Thread Illia Volochii

New submission from Illia Volochii :

Error messages state that maxmem and dklen must be smaller than INT_MAX, but 
values equal to INT_MAX are allowed too.

Also, another error message states that n must be a power of 2, but it does not 
mention that 1 or 2⁰ is not allowed.

--
components: Extension Modules
messages: 385360
nosy: illia-v
priority: normal
severity: normal
status: open
title: Error messages raised by _hashlib_scrypt_impl() are slightly misleading

___
Python tracker 

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



[issue42864] Improve error messages regarding unclosed parentheses

2021-01-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +23096
pull_request: https://github.com/python/cpython/pull/24273

___
Python tracker 

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



[issue42980] argparse: GNU-style help formatter

2021-01-20 Thread Will Noble


New submission from Will Noble :

argparse allows GNU-style long options (with '=' in between the option and the 
value as opposed to a space): 
https://docs.python.org/3/library/argparse.html#option-value-syntax

Call it pickiness, but I'd like to be able to print the help message in that 
format. Looking at the code, a simple refactor would be much cleaner than 
implementing my own custom help formatter and having to copy-paste a bunch of 
implementation details that are potentially subject to change in future 
releases. I'll submit a patch shortly.

--
components: Library (Lib)
messages: 385359
nosy: will
priority: normal
severity: normal
status: open
title: argparse: GNU-style help formatter
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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Guido. Seems that that guess will be wrong in most cases.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2021-01-20 Thread mattip


mattip  added the comment:

I think this issue can only cause failed tests. 
`sysconfig.get_config_var('EXT_SUFFIX')` is, as far as I can tell, not used 
internally by any cpython build or import code.

--

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

> Assertion failed: (item != NULL) ^ (PyErr_Occurred() != NULL), file  
> Objects/abstract.c, line 163

This is bpo-42979: "_zoneinfo: zoneinfomodule_exec() doesn't check for 
PyDateTime_IMPORT failure".

It's a side effect of the broken _datetime module.

--

___
Python tracker 

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



[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-20 Thread STINNER Victor


New submission from STINNER Victor :

_zoneinfo starts with:

static int
zoneinfomodule_exec(PyObject *m)
{
PyDateTime_IMPORT;

with:

#define PyDateTime_CAPSULE_NAME "datetime.datetime_CAPI"
#define PyDateTime_IMPORT \
PyDateTimeAPI = (PyDateTime_CAPI 
*)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0)

If PyCapsule_Import() fails, zoneinfomodule_exec() returns 0 (success) with an 
exception raised.

It should check if the import succeeded or not. Concrete example on AIX where 
datetime cannot be imported:
https://bugs.python.org/issue42604#msg385347

"./python setup.py build" fails with:

Assertion failed: (item != NULL) ^ (PyErr_Occurred() != NULL), file  
Objects/abstract.c, line 163

--

By the way, the import machinery should raise a SystemError if a module exec 
function raises an exception *and* reports a success: see 
_Py_CheckFunctionResult().

--
components: Extension Modules
messages: 385355
nosy: vstinner
priority: normal
severity: normal
status: open
title: _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT 
failure
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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

I don't think this makes sense. How do you know there's a missing 'self'? 
Surely it's just as likely that there is indeed an extra argument. Especially 
if A.foo is defined by a library (stdib or 3rd party).

--
nosy: +gvanrossum

___
Python tracker 

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



[issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 75e59a97f5d1fddb0c30ed9747b1b8cb84420a62 by Victor Stinner in 
branch 'master':
bpo-42856: Add --with-wheel-pkg-dir=PATH configure option (GH-24210)
https://github.com/python/cpython/commit/75e59a97f5d1fddb0c30ed9747b1b8cb84420a62


--

___
Python tracker 

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread Ken Jin


Ken Jin  added the comment:

FWIW, a surprising amount of things rely on treating ';' as a valid separator 
in the standard test suite.

>From just a cursory look:

test_cgi
test_urlparse

A change in the public API of urlparse will also require a change in cgi.py's 
FieldStorage, FieldStorage.read_multi, parse and parse_multipart to expose that 
parameter since those functions forward arguments directly to 
urllib.parse.parse_qs internally.

If we backport this, it seems that we will *also* need to backport all those 
changes to cgi's public API. Otherwise, just backporting the security fix part 
without allowing the user to switch would break existing code.

Just my 2 cents on the issue. I'm not too familiar with security fixes in 
cpython anyways ;).

--

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Can it be related to the commit a44ce6c9f725d336aea51a946b42769f29fed613 of 
> this issue?

Quite likely. @mattip, can you investigate?

--

___
Python tracker 

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



[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Another example: the unimport project ("linter, formatter for finding and 
removing unused import statements") uses the following function to guess if a 
module object is part of the stdlib:

def is_std(package: str) -> bool:
"""Returns True if package module came with from Python."""

if package in C.BUILTIN_MODULE_NAMES:
return True
spec = get_spec(package)
if spec and isinstance(spec.origin, str):
return any(
(
spec.origin.startswith(C.STDLIB_PATH),
spec.origin in ["built-in", "frozen"],
spec.origin.endswith(".so"),
)
)
else:
return False

https://github.com/hakancelik96/unimport/blob/c9bd5de99bd8a5239d3dee2c3ff633979bb3ead2/unimport/utils.py#L61-L77

--

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

We currently say:

Traceback (most recent call last):
  File "/Users/pgalindo3/github/python/master/lel.py", line 5, in 
A().foo(1,2)
TypeError: foo() takes 2 positional arguments but 3 were given

but we should say:
Traceback (most recent call last):
  File "/Users/pgalindo3/github/python/master/lel.py", line 5, in 
A().foo(1,2)
TypeError: A.foo() takes 2 positional arguments but 3 were given. Did you 
forget 'self' in the method definition?

--
messages: 385349
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Improve error message when "self" is missing from the method definition

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, it seems like Python no long builds on PPC64 AIX 3.x buildbot :-(
https://bugs.python.org/issue42604#msg385347

--

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue.

It seems like Python no long builds on PPC64 AIX 3.x buildbot:
https://buildbot.python.org/all/#/builders/438/builds/753

"setup.py build" crash with an assertion error:

Assertion failed: (item != NULL) ^ (PyErr_Occurred() != NULL), file  
Objects/abstract.c, line 163

The linker also displays tons of warnings. Examples:

ld: 0711-327 WARNING: Entry point not found: PyInit__uuid.cpython-310d
ld: 0711-327 WARNING: Entry point not found: 
PyInit__multiprocessing.cpython-310d
ld: 0711-327 WARNING: Entry point not found: PyInit__tkinter.cpython-310d

Can it be related to the commit a44ce6c9f725d336aea51a946b42769f29fed613 of 
this issue?

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



[issue36769] doc Document that fnmatch.filter supports any kind of iterable not just lists

2021-01-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.7

___
Python tracker 

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
nosy: +kj
nosy_count: 4.0 -> 5.0
pull_requests: +23094
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24271

___
Python tracker 

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

> Python implementation obeys contemporary standards

The contemporary standard is HTML5 and HTML5 asks to only split at "&", no?

--

___
Python tracker 

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



[issue42977] Tkinter Optionmenu Too Narrow on Mac

2021-01-20 Thread DDavid


New submission from DDavid :

Hello,

I am building a program with Tkinter. However, I found the Optionmenu widget 
has inconsistent behaviors on default lengths on a Mac and a Windows PC. 

So I set the width of an optionmenu through menu.configure(width=70). On 
Windows, this correctly sets the menu width to 70 when the program runs. 
However, on a Mac, the menu is still very narrow at the start. It only expands 
to 70 after I select an option. 

I have attached a screenshot to help explain the issue. It does not occur on 
Windows.

--
components: Tkinter
files: TKinter Menu issue.png
messages: 385345
nosy: zjdavid
priority: normal
severity: normal
status: open
title: Tkinter Optionmenu Too Narrow on Mac
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49752/TKinter Menu issue.png

___
Python tracker 

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It looks to me, that this is an issue of proxies, not Python. Python 
implementation obeys contemporary standards, and they are not formally 
cancelled yet. If we add an option in parse_qsl() or change its default 
behavior, it should be considered as a new feature which helps to mitigate 
proxies' issues.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c1c3493fb7a3af8efdc50175e592d29e8cb93886 by Victor Stinner in 
branch 'master':
bpo-42323: Fix math.nextafter() for NaN on AIX (GH-24265)
https://github.com/python/cpython/commit/c1c3493fb7a3af8efdc50175e592d29e8cb93886


--

___
Python tracker 

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

> Sorry for the title mess: It seems that when replying to a ticket, RoundUp 
> uses the subject line as the new header regardless of what it was set to 
> before.

Yeah, it's annoying :-( I like to put a module name in the issue title, to help 
bug triage.

--

___
Python tracker 

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Sorry for the title mess: It seems that when replying to a ticket, RoundUp uses 
the subject line as the new header regardless of what it was set to before.

--

___
Python tracker 

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



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks cptpcrd for your bug report and your great fix! I like your tests ;-)

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread STINNER Victor


Change by STINNER Victor :


--
title: [security] Web cache poisoning - `;` as a query args separator -> 
[security] urllib.parse.parse_qsl(): Web cache poisoning - `;` as a query args 
separator

___
Python tracker 

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



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2021-01-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23093
pull_request: https://github.com/python/cpython/pull/24270

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-01-20 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2021-01-20 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7dc71c425cf6aa6a4070a418dce5d95ca435c79f by cptpcrd in branch 
'master':
bpo-42780: Fix set_inheritable() for O_PATH file descriptors on Linux (GH-24172)
https://github.com/python/cpython/commit/7dc71c425cf6aa6a4070a418dce5d95ca435c79f


--

___
Python tracker 

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



[issue42864] Improve error messages regarding unclosed parentheses

2021-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ae7d3cd980fae6b9a9778c0ccd162b93035ad33e by Pablo Galindo in 
branch 'master':
bpo-42864: Fix compiler warning in the tokenizer with the new paren stack for 
column numbers (GH-24266)
https://github.com/python/cpython/commit/ae7d3cd980fae6b9a9778c0ccd162b93035ad33e


--

___
Python tracker 

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



[issue42864] Improve error messages regarding unclosed parentheses

2021-01-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +23091
pull_request: https://github.com/python/cpython/pull/24266

___
Python tracker 

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



[issue42967] [security] Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread Marc-Andre Lemburg


Change by Marc-Andre Lemburg :


--
title: Web cache poisoning - `;` as a query args separator -> [security] Web 
cache poisoning - `;` as a query args separator

___
Python tracker 

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



Re: [issue42967] Web cache poisoning - `;` as a query args separator

2021-01-20 Thread M.-A. Lemburg
On 20.01.2021 12:07, STINNER Victor wrote:
> Maybe we should even go further in Python 3.10 and only split at "&" by 
> default, but let the caller to opt-in for ";" separator as well.

+1.

Personally, I've never seen URLs encoded with ";" as query parameter
separator in practice on the server side.

The use of ";" was recommended in the HTML4 spec, but only in an
implementation side note:

https://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2

and not in the main reference:

https://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#h-17.13.4.1

Browsers are also pretty relaxed about seeing non-escaped ampersands in
link URLs and do the right thing, so the suggested work-around for
avoiding escaping is not really needed.

-- 
Marc-Andre Lemburg
eGenix.com

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



[issue42197] Disable automatic update of frame locals during tracing

2021-01-20 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

I agree that it can be made better, but I think most of the issues right now 
comes from CPython trying to automatically do something that's not bound to 
work (calling PyFrame_FastToLocals/PyFrame_LocalsToFast under the hood during 
the tracing call).

https://bugs.python.org/issue30744 is a great example of why that can never 
work properly (debuggers need to manage that much more carefully, just doing it 
on all calls is really bound to not work).

So, the current implementation besides being broken also makes things pretty 
slow.

I agree that PEP 558 may fix things here (but it's much more work).

As a disclaimer, pydevd actually uses a different tracer which doesn't do those 
calls and when possible uses the frame eval to modify the bytecode directly to 
minimize the overhead, so, in practice the current support given by CPython for 
debugger is pretty reasonable for doing a fast debugger (but there are a few 
caveats that it must work around -- such as the auto 
PyFrame_FastToLocals/PyFrame_LocalsToFast calls).

--

___
Python tracker 

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



[issue42048] Document Argument Clinic's defining_class converter

2021-01-20 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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



[issue42976] __text_signature__ parser silently drops arguments with certain unsupported default forms

2021-01-20 Thread Antony Lee


New submission from Antony Lee :

Starting from the keyword-arguments example at 
https://docs.python.org/3/extending/extending.html#keyword-parameters-for-extension-functions,
 change the docstring of `parrot` to "parrot(voltage, state, action, 
type=1<<5)\n--\n\n" (yes, the documented default value for type does not 
correspond to the actual implementation, but that's irrelevant here).  
Compiling the extension module and running pydoc on it yields the following 
parsed signature for `parrot`: `parrot(voltage, state, action)` i.e. the `type` 
parameter got silently dropped.  (Note that `1<<5` can legitimately occur, e.g. 
as a bitmask flag, especially given that one currently cannot refer to globals 
in __text_signature__ (https://bugs.python.org/issue37881).)

--
components: Extension Modules
messages: 385335
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: __text_signature__ parser silently drops arguments with certain 
unsupported default forms

___
Python tracker 

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



[issue42048] Document Argument Clinic's defining_class converter

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e982fe496bf756afd2ead8e56eb24b28a93c627a by Erlend Egeberg 
Aasland in branch 'master':
bpo-42048: Clinic Howto: Document AC's defining_class converter (GH-23978)
https://github.com/python/cpython/commit/e982fe496bf756afd2ead8e56eb24b28a93c627a


--

___
Python tracker 

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



[issue26003] Issues with PyEval_InitThreads and PyGILState_Ensure

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

The GIL is now created by _PyEval_InitGIL() which is called by Py_Initialize(): 
at Python startup.

_PyRuntime.main_thread is set by _PyRuntime_Initialize() which is also called 
by Py_Initialize(): at Python startup.

The code to handle signals and pending calls changed a lot since 2016. I close 
the issue.

--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread STINNER Victor


Change by STINNER Victor :


--
title: urllib.parse.parse_qsl(): Web cache poisoning - `;` as a query args 
separator -> [security] urllib.parse.parse_qsl(): Web cache poisoning - `;` as 
a query args separator

___
Python tracker 

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



[issue42967] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread STINNER Victor


Change by STINNER Victor :


--
title: Web cache poisoning - `;` as a query args separator -> 
urllib.parse.parse_qsl(): Web cache poisoning - `;` as a query args separator

___
Python tracker 

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



[issue42967] Web cache poisoning - `;` as a query args separator

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Oops, I missed this issue. I just marked my bpo-42975 issue as a duplicate of 
this one.

My message:

urllib.parse.parse_qsl() uses "&" *and* ";" as separators:

>>> urllib.parse.parse_qsl("a=1=2=3")
[('a', '1'), ('b', '2'), ('c', '3')]
>>> urllib.parse.parse_qsl("a=1=2;c=3")
[('a', '1'), ('b', '2'), ('c', '3')]

But the W3C standards evolved and now suggest against considering semicolon 
(";") as a separator:

https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#url-encoded-form-data

"This form data set encoding is in many ways an aberrant monstrosity, the 
result of many years of implementation accidents and compromises leading to a 
set of requirements necessary for interoperability, but in no way representing 
good design practices. In particular, readers are cautioned to pay close 
attention to the twisted details involving repeated (and in some cases nested) 
conversions between character encodings and byte sequences."

"To decode application/x-www-form-urlencoded payloads (...) Let strings be the 
result of strictly splitting the string payload on U+0026 AMPERSAND characters 
(&)."

Maybe we should even go further in Python 3.10 and only split at "&" by 
default, but let the caller to opt-in for ";" separator as well.

--
nosy: +vstinner

___
Python tracker 

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



[issue42975] urllib.parse.parse_qsl(): add an option to not consider semicolon (; ) as separator

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I mark my issue as a duplicate of bpo-42967.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Web cache poisoning - `;` as a query args separator

___
Python tracker 

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



[issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 61d26394f97306ab4890f1522f26ee6d17461e2b by Erlend Egeberg 
Aasland in branch 'master':
bpo-41798: Allocate unicodedata CAPI on the heap (GH-24128)
https://github.com/python/cpython/commit/61d26394f97306ab4890f1522f26ee6d17461e2b


--

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2021-01-20 Thread Mark Shannon


Mark Shannon  added the comment:

I don't think so.
Tracing is already somewhat fragile, see https://bugs.python.org/issue30744.
Making it more complex is likely to add more bugs.

PEP 558 should help, as f_locals becomes a proxy. 
There are some minor issues with PEP 558 (I'm not convinced that it is 
completely robust), but it should fix this issue.

Ultimately, what we need is a decent debugger API, something along the lines of 
the JVMTI.

--

___
Python tracker 

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



[issue42975] urllib.parse.parse_qsl(): add an option to not consider semicolon (; ) as separator

2021-01-20 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue42967

--
nosy: +xtreak

___
Python tracker 

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



[issue42975] urllib.parse.parse_qsl(): add an option to not consider semicolon (; ) as separator

2021-01-20 Thread STINNER Victor


New submission from STINNER Victor :

urllib.parse.parse_qsl() uses "&" *and* ";" as separators:

>>> urllib.parse.parse_qsl("a=1=2=3")
[('a', '1'), ('b', '2'), ('c', '3')]
>>> urllib.parse.parse_qsl("a=1=2;c=3")
[('a', '1'), ('b', '2'), ('c', '3')]

But the W3C standards evolved and now suggest against considering semicolon 
(";") as a separator:

https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#url-encoded-form-data

"This form data set encoding is in many ways an aberrant monstrosity, the 
result of many years of implementation accidents and compromises leading to a 
set of requirements necessary for interoperability, but in no way representing 
good design practices. In particular, readers are cautioned to pay close 
attention to the twisted details involving repeated (and in some cases nested) 
conversions between character encodings and byte sequences."

"To decode application/x-www-form-urlencoded payloads (...) Let strings be the 
result of strictly splitting the string payload on U+0026 AMPERSAND characters 
(&)."

Maybe we should even go further in Python 3.10 and only split at "&" by 
default, but let the caller to opt-in for ";" separator as well.

--
components: Library (Lib)
messages: 385327
nosy: vstinner
priority: normal
severity: normal
status: open
title: urllib.parse.parse_qsl(): add an option to not consider semicolon (;) as 
separator
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



[issue42680] unicode identifiers not accessible or assignable through globals()

2021-01-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 24265 to fix the issue. math.nextafter(x, y) already had a special 
case for AIX for x==y.

test_nextafter fails on PPC64 AIX 3.x (build 749).

test_nextafter pass on POWER6 AIX 3.x (build 701).

--

___
Python tracker 

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



[issue36769] doc Document that fnmatch.filter supports any kind of iterable not just lists

2021-01-20 Thread miss-islington


miss-islington  added the comment:


New changeset 8f334dbbf04582071d1318e5817e2fe99f1e5169 by Miss Islington (bot) 
in branch '3.8':
bpo-36769: Document that fnmatch.filter supports any kind of iterable (GH-13039)
https://github.com/python/cpython/commit/8f334dbbf04582071d1318e5817e2fe99f1e5169


--

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2021-01-20 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42778] Add follow_symlinks=True parameter to both os.path.samefile() and Path.samefile()

2021-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Why is this feature needed? Currently you can use a combination of samestat() 
with lstat(). And more, you can follow symbolic links only for one of arguments.

samestat(stat(path1), stat(path1))  # same as samefile(path1, path1)
samestat(lstat(path1), stat(path1))
samestat(stat(path1), lstat(path1))
samestat(lstat(path1), lstat(path1))

samefile() covers one (presumably most common) of these cases. The proposed 
option would cover yet one (is it common enough?). And there are two mixed 
cases remained.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



  1   2   >