This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Incorrect message: "Invalid decimal literal" (python 3.10)
Type: Stage:
Components: Versions: Python 3.11, Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: aroberge, pablogsal, serhiy.storchaka
Priority: normal Keywords:

Created on 2021-07-30 14:52 by aroberge, last changed 2022-04-11 14:59 by admin.

Messages (4)
msg398556 - (view) Author: Andre Roberge (aroberge) * Date: 2021-07-30 14:52
Consider the following:

>>> a = (1‚ 2)  # not a comma, but unicode character.

Using Python 3.9 (and earlier), we get the following correct information

>>> a = (1‚ 2)
  File "<stdin>", line 1
    a = (1‚ 2)
          ^
SyntaxError: invalid character '‚' (U+201A)

Using Python 3.10, we get the following incorrect information instead:

>>> a = (1‚ 2)
  File "<stdin>", line 1
    a = (1‚ 2)
         ^
SyntaxError: invalid decimal literal
msg398595 - (view) Author: Andre Roberge (aroberge) * Date: 2021-07-30 18:11
Here's another related case.

Python 3.9:

>>> a = 1½
  File "<stdin>", line 1
    a = 1½
         ^
SyntaxError: invalid character '½' (U+00BD)

Python 3.10
>>> a = 1½
  File "<stdin>", line 1
    a = 1½
        ^
SyntaxError: invalid decimal literal
msg398597 - (view) Author: Andre Roberge (aroberge) * Date: 2021-07-30 18:18
Third case. Showing only the output for Python 3.10

>>> a = 3 ⁄ 7   # entered with a space around ⁄
  File "<stdin>", line 1
    a = 3 ⁄ 7
          ^
SyntaxError: invalid character '⁄' (U+2044)
>>> a = 3⁄7    # no added space
  File "<stdin>", line 1
    a = 3⁄7
        ^
SyntaxError: invalid decimal literal

= =
In the terminal, the integers 3 and 7 look the same with or without spaces around the ⁄ character, known as FRACTION SLASH.
msg409212 - (view) Author: Andre Roberge (aroberge) * Date: 2021-12-26 17:01
The last of these three cases (with FRACTION SLASH) is fixed 3.10.1.

The other two are still present in 3.10.1 and in 3.11.0a3
History
Date User Action Args
2022-04-11 14:59:48adminsetgithub: 88943
2021-12-26 17:01:19arobergesetmessages: + msg409212
versions: + Python 3.11
2021-07-30 18:18:41arobergesetmessages: + msg398597
2021-07-30 18:11:04arobergesetmessages: + msg398595
2021-07-30 15:41:26pablogsalsetnosy: + serhiy.storchaka
2021-07-30 14:52:34arobergecreate