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

dateparser >=0.7.5 is not compatible with Python 2.7 #188

Open
thomasleveil opened this issue Aug 21, 2020 · 1 comment
Open

dateparser >=0.7.5 is not compatible with Python 2.7 #188

thomasleveil opened this issue Aug 21, 2020 · 1 comment

Comments

@thomasleveil
Copy link
Contributor

Describe the bug

  • maya is declared as compatible with Python 2.7
  • maya depends on dateparser >= 0.7.0
  • since this commit, dateparser is not compatible with Python 2.7 (despites its classifiers). At this time, this commit is present in dateparser 0.7.5 and 0.7.6
@noviluni
Copy link

noviluni commented Aug 26, 2020

Hi @thomasleveil

Is not "incompatibility" but something not documented: "now the Locale.translate() method only accepts Unicode strings".

To fix it, you can pin an old version of dateparser (0.7.4), but as we fixed some bugs I recommend to update this portion of code by adding .decode('utf-8').

to be:

    base = en.translate(naturaldate.decode('utf-8'), settings=dateparser.conf.settings)

instead of:

    base = en.translate(naturaldate, settings=dateparser.conf.settings)

I tried this and it seems to work. However, I didn't test it properly, so let me know if there are any issues.

Apologize for the inconvenience!

(BTW, the next dateparser version won't be supporting Python <3.5.)

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

No branches or pull requests

2 participants