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.

Author weightwatchers-carlanderson
Recipients weightwatchers-carlanderson
Date 2021-03-16.18:09:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615918144.03.0.939769511159.issue43520@roundup.psfhosted.org>
In-reply-to
Content
Fraction works with a regular slash:

>>> from fractions import Fraction
>>> Fraction("1/2")
Fraction(1, 2)

but there are other similar slashes such as (0x2044) in which it throws an error:

>>> Fraction("0⁄2")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/lib/python3.7/fractions.py", line 138, in __new__
    numerator)
ValueError: Invalid literal for Fraction: '0⁄2'


This seems to come from the (?:/(?P<denom>\d+))? section of the regex _RATIONAL_FORMAT in fractions.py
History
Date User Action Args
2021-03-16 18:09:04weightwatchers-carlandersonsetrecipients: + weightwatchers-carlanderson
2021-03-16 18:09:04weightwatchers-carlandersonsetmessageid: <1615918144.03.0.939769511159.issue43520@roundup.psfhosted.org>
2021-03-16 18:09:04weightwatchers-carlandersonlinkissue43520 messages
2021-03-16 18:09:03weightwatchers-carlandersoncreate