[issue43508] Miscompilation information for tarfile.open() when given too many arguments

Xinmeng Xia report at bugs.python.org
Mon Mar 15 23:09:30 EDT 2021


New submission from Xinmeng Xia <xiaxm at smail.nju.edu.cn>:

In following example, we only give 10 arguments to 
tarfile.open(). The error message shows "11 arguments were given".    We give it 5 arguments and the error message shows "6 were given". This is not correct.

==========================================================
>>> tarfile.open(*[None]*10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: open() takes from 1 to 5 positional arguments but 11 were given
>>> tarfile.open(1,2,3,4,5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: open() takes from 1 to 5 positional arguments but 6 were given
==========================================================

Expected Output: 
For 10 given arguments. the error message is "open() takes from 1 to 5 positional arguments but 10 were given" 

Python: 3.9.2
System: ubuntu 16.04

----------
components: Library (Lib)
messages: 388803
nosy: xxm
priority: normal
severity: normal
status: open
title: Miscompilation information for tarfile.open() when given too many arguments
type: compile error
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43508>
_______________________________________


More information about the Python-bugs-list mailing list