Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse_date() "ParseError: No numbers were found in input" Python 3.6 and newer #1032

Open
photodude opened this issue Oct 4, 2023 · 2 comments

Comments

@photodude
Copy link

photodude commented Oct 4, 2023

Overview Description

A traceback happens due to a parsing error in babel parse_date() if the input is string. This is inconsistent with older versions of python 3.5 and older work as expected

Steps to Reproduce

I'm not sure how to describe the replication of this issue, but please see the following appveyor build
https://ci.appveyor.com/project/j4321/tkcalendar/builds/48195627

Actual Results

Traceback (most recent call last):
  File "C:\projects\tkcalendar\tests\test_calendar.py", line 228, in test_calendar_textvariable 
  year=2015, month=1, day=3, textvariable=var)
  File "C:\projects\tkcalendar\tkcalendar\calendar_.py", line 268, in __init__
    self._sel_date = parse_date(self._textvariable.get(), locale)
  File "C:\PYTHON36\lib\site-packages\babel\dates.py", line 1201, in parse_date
    raise ParseError("No numbers were found in input")
babel.dates.ParseError: No numbers were found in input

Expected Results

date parsed from string input

Reproducibility

Additional Information

CI testing in Appveyor Visual Studio 2022 image
py3.6 => Babel 2.11.0
py3.7 => Babel 2.13.0
py3.8 => Babel 2.13.0
py3.9 => Babel 2.13.0
py3.10 => Babel 2.13.0
py3.11 => Babel 2.13.0

@akx
Copy link
Member

akx commented Oct 29, 2023

Can you share what the input (self._textvariable.get()) there had been, and what locale was?

FWIW, I think this is more a change between babel-2.9.1 and babel-2.11.0 than related to Python versions :)

@photodude
Copy link
Author

hi @akx as far as I can tell the input is from nose unit tests in tkcalendar\tests\test_calendar.py", line 228, in test_calendar_textvariable year=2015, month=1, day=3, textvariable=var)
https://github.com/j4321/tkcalendar/blob/master/tests/test_calendar.py#L227

Sorry, I struggle running tests like this on local and working through debugging so I'm a bit blind to some things in python which I'm used to doing in C++.

I agree that it's something that changed between babel-2.9.1 and babel-2.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants