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

test_precision errors if LANG is set to de_DE.UTF-8 #11321

Closed
olebole opened this issue Feb 11, 2021 · 7 comments
Closed

test_precision errors if LANG is set to de_DE.UTF-8 #11321

olebole opened this issue Feb 11, 2021 · 7 comments

Comments

@olebole
Copy link
Member

olebole commented Feb 11, 2021

Description

With my native locale, test_precision.py produces an error that does not appear when LANG=C. This seems to be a problem in astropy itself (not in the test).

Expected behavior

The tests should run independently of a certain locale.

Actual behavior

___________ ERROR collecting time/tests/test_precision.py ________________________
/usr/lib/python3/dist-packages/astropy/time/tests/test_precision.py:92: in <module>
    leap_second_table = iers.LeapSeconds.from_iers_leap_seconds()
/usr/lib/python3/dist-packages/astropy/utils/iers/iers.py:1061: in from_iers_leap_seconds
    return cls._read_leap_seconds(
/usr/lib/python3/dist-packages/astropy/utils/iers/iers.py:1034: in _read_leap_seconds
    expires = Time.strptime(match.groups()[0], '%d %B %Y',
/usr/lib/python3/dist-packages/astropy/time/core.py:1643: in strptime
    tt, fraction = _strptime._strptime(to_string(time), format_string)
/usr/lib/python3/dist-packages/astropy/extern/_strptime.py:350: in _strptime
    raise ValueError("time data %r does not match format %r" %
E   ValueError: time data '28 June 2021' does not match format '%d %B %Y'

Steps to Reproduce

Install python3-astropy from current Debian testing and run

LANG=de_DE.UTF-8 python3 -m pytest --pyargs astropy

System Details

  • Linux-5.10.0-2-amd64-x86_64-with-glibc2.31
  • Python 3.9.1+ (default, Feb 5 2021, 13:46:56) [GCC 10.2.1 20210110]
  • Numpy 1.19.4
  • astropy 4.2
  • Scipy 1.6.0
  • Matplotlib 3.3.4
@saimn
Copy link
Contributor

saimn commented Feb 11, 2021

I think this was fixed by #11062, can you check with master ?

@olebole
Copy link
Member Author

olebole commented Feb 11, 2021

I can't check this for the moment, since when building the package, I always run in the pyerfa problem (#11305). However, I am wondering why this is not in 4.2? IMO it should be backported.

@pllim
Copy link
Member

pllim commented Feb 11, 2021

why this is not in 4.2?

What isn't? If you mean #11062, it will be when the next 4.0.x and 4.2.x are released.

@olebole
Copy link
Member Author

olebole commented Feb 11, 2021

@pllim

If you mean #11062, it will be when the next 4.0.x and 4.2.x are released.

Ah, I didn't know that. How does one find that out?

@pllim
Copy link
Member

pllim commented Feb 11, 2021

@olebole , its milestone is set for 4.0.5, which isn't out yet. Although given the current maintainer availability, there is unlikely to be any release before 4.3. Usually a major release is also accompanied by bug fix releases of older branches.

@mhvk
Copy link
Contributor

mhvk commented Feb 11, 2021

Indeed, I think this particular problem is fixed - the other will hopefully be fixed this weekend (and would also need backporting...).

@mhvk
Copy link
Contributor

mhvk commented Feb 11, 2021

I'll close this now - please do re-open if you find the problem also on master!

@mhvk mhvk closed this as completed Feb 11, 2021
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

4 participants