Bug 2080221 - current python-dateparser is incompatible with current python-regex
Summary: current python-dateparser is incompatible with current python-regex
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python-dateparser
Version: 35
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Fabian Affolter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2094005
TreeView+ depends on / blocked
 
Reported: 2022-04-29 09:44 UTC by Pim Zandbergen
Modified: 2022-12-13 17:52 UTC (History)
5 users (show)

Fixed In Version: python-dateparser-0.7.6-7.fc37
Clone Of:
Environment:
Last Closed: 2022-12-13 17:52:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pim Zandbergen 2022-04-29 09:44:27 UTC
Description of problem:
python3-regex was recently updated, and this breaks current python3-dateparser.
python3-dateparser should be upgraded to current upstream version 1.1.1.

Version-Release number of selected component (if applicable):
python3-dateparser-0.7.6-4.fc35.noarch
python3-regex-2022.3.15-1.fc35.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. run these lines of python code:
import dateparser
date_string = 'Fri, 29 Apr 2022 11:30:49 +0200'
parsed_date = dateparser.parse(date_string)
print(parsed_date)

Actual results:
raceback (most recent call last):
  File "./test.py", line 4, in <module>
    parsed_date = dateparser.parse(date_string)
  File "/usr/lib/python3.10/site-packages/dateparser/conf.py", line 85, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/dateparser/__init__.py", line 53, in parse
    data = parser.get_date_data(date_string, date_formats)
  File "/usr/lib/python3.10/site-packages/dateparser/date.py", line 417, in get_date_data
    parsed_date = _DateLocaleParser.parse(
  File "/usr/lib/python3.10/site-packages/dateparser/date.py", line 194, in parse
    return instance._parse()
  File "/usr/lib/python3.10/site-packages/dateparser/date.py", line 198, in _parse
    date_obj = self._parsers[parser_name]()
  File "/usr/lib/python3.10/site-packages/dateparser/date.py", line 212, in _try_freshness_parser
    return freshness_date_parser.get_date_data(self._get_translated_date(), self._settings)
  File "/usr/lib/python3.10/site-packages/dateparser/date.py", line 261, in _get_translated_date
    self._translated_date = self.locale.translate(
  File "/usr/lib/python3.10/site-packages/dateparser/languages/locale.py", line 135, in translate
    relative_translations = self._get_relative_translations(settings=settings)
  File "/usr/lib/python3.10/site-packages/dateparser/languages/locale.py", line 164, in _get_relative_translations
    self._generate_relative_translations(normalize=True))
  File "/usr/lib/python3.10/site-packages/dateparser/languages/locale.py", line 178, in _generate_relative_translations
    pattern = DIGIT_GROUP_PATTERN.sub(r'?P<n>\d+', pattern)
  File "/usr/lib64/python3.10/site-packages/regex/regex.py", line 700, in _compile_replacement_helper
    is_group, items = _compile_replacement(source, pattern, is_unicode)
  File "/usr/lib64/python3.10/site-packages/regex/_regex_core.py", line 1736, in _compile_replacement
    raise error("bad escape \\%s" % ch, source.string, source.pos)
regex._regex_core.error: bad escape \d at position 7

Expected results:
2022-04-29 11:30:49+02:00

Comment 1 Pim Zandbergen 2022-04-29 10:25:07 UTC
Workaround is to downgrade to python3-regex-2021.8.28-1.fc35.x86_64

Comment 2 Pim Zandbergen 2022-05-10 08:50:35 UTC
This may become urgent in Fedora 36, where the workaround to downgrade python-regex, may not be possible.

Comment 3 Thomas Moschny 2022-05-18 08:56:11 UTC
See https://github.com/mrabarnett/mrab-regex/issues/459. This needs to be fixed in dateparser.

Comment 4 Pim Zandbergen 2022-05-18 09:16:07 UTC
It appears to have been fixed in dateparser 1.1.1
https://github.com/scrapinghub/dateparser/issues/1052

Which is why I suggested that this package should be upgraded to the current upstream version.

Comment 5 Thomas Moschny 2022-05-18 09:26:35 UTC
IIUC, the issue is 'fixed' by pinning regex to an older version. This won't help us.

Comment 6 Pim Zandbergen 2022-05-18 10:33:20 UTC
Indeed. I placed a comment in https://github.com/scrapinghub/dateparser/issues/1052 referring to this bug.

For now, in Fedora 36, the workaround is to downgrade python3-regex to python3-regex-2022.3.2-1.fc36

Comment 7 Thomas Moschny 2022-05-18 10:41:42 UTC
I added a comment with a possible fix here:  https://github.com/scrapinghub/dateparser/issues/1045#issuecomment-1129846022

Not sure it is correct or complete.

Comment 9 Fedora Update System 2022-06-20 22:27:53 UTC
FEDORA-2022-cc65cfda8c has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-cc65cfda8c

Comment 10 Fedora Update System 2022-06-20 22:30:58 UTC
FEDORA-2022-cc65cfda8c has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Miro Hrončok 2022-06-20 22:31:37 UTC
Reopening for older releases.

Comment 12 Ben Cotton 2022-11-29 18:50:27 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 13 Ben Cotton 2022-12-13 17:52:22 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.