question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pllimcommented, 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.

0reactions
mhvkcommented, Feb 11, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

utf 8 - why do I get a locale error even though it is set?
When I run bitbake , I'm getting the following: $ bitbake core-image-base Please use a locale setting which supports utf-8. Python can't change ......
Read more >
How to set UTF8 in a lstlisting? (Error received) - TeX
I was getting the same error message as this on the first line, whatever I put at the start of the file. The...
Read more >
Neovim trips on UTF-8 characters · Issue #1858 - GitHub
I installed the latest master of Neovim. However, I have some UTF-8 characters in my .vimrc, and also when I open a file...
Read more >
Character set, Encoding, Locale, Font and More... - jdhao
In Oracle Solaris 11 the default locale codeset is UTF-8, an ASCII compatible 8-bit encoding form of Unicode. The fully defined locale name...
Read more >
How can I fix the UTF-8 error when bulk uploading users?
Question When I tried to bulk upload users, I received the following error message: For some reason, the data to import was not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found