[GH-ISSUE #438] [bug] Module 'locale' has no attribute 'nl_langinfo' #264

Closed
opened 2026-02-25 20:33:12 +03:00 by kerem · 3 comments
Owner

Originally created by @hazu-89 on GitHub (Oct 3, 2021).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/438

System Information

Asciinema version: 2.1.0
Python version: 3.9.7
OS: Android 10 (on Termux 0.117)

Bug Description

Command asciinema exits prematurely with the following traceback:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/asciinema", line 8, in <module>
    sys.exit(main())
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/asciinema/__main__.py", line 29, in main
    if locale.nl_langinfo(locale.CODESET).upper() not in ['US-ASCII', 'UTF-8', 'UTF8']:
AttributeError: module 'locale' has no attribute 'nl_langinfo'

Relevant documentation:

locale.nl_langinfo(option)

Return some locale-specific information as a string. This function is not available on all systems, and the set of possible options might also vary across platforms.
Python 3.8 documentation

Alternative: Use locale.getlocale().

Originally created by @hazu-89 on GitHub (Oct 3, 2021). Original GitHub issue: https://github.com/asciinema/asciinema/issues/438 ## System Information Asciinema version: 2.1.0 Python version: 3.9.7 OS: Android 10 (on Termux 0.117) ## Bug Description Command `asciinema` exits prematurely with the following traceback: ``` Traceback (most recent call last): File "/data/data/com.termux/files/usr/bin/asciinema", line 8, in <module> sys.exit(main()) File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/asciinema/__main__.py", line 29, in main if locale.nl_langinfo(locale.CODESET).upper() not in ['US-ASCII', 'UTF-8', 'UTF8']: AttributeError: module 'locale' has no attribute 'nl_langinfo' ``` Relevant documentation: > locale.nl_langinfo(option) > > Return some locale-specific information as a string. This function is not available on all systems, and the set of possible options might also vary across platforms. [Python 3.8 documentation](https://docs.python.org/3.8/library/locale.html#locale.nl_langinfo) Alternative: Use [locale.getlocale()](https://docs.python.org/3.8/library/locale.html#locale.getlocale).
kerem closed this issue 2026-02-25 20:33:12 +03:00
Author
Owner

@ku1ik commented on GitHub (Oct 4, 2021):

I guess we could catch the above exception and fallback to locale.getlocale.

<!-- gh-comment-id:933300509 --> @ku1ik commented on GitHub (Oct 4, 2021): I guess we could catch the above exception and fallback to `locale.getlocale`.
Author
Owner

@JordonRR commented on GitHub (Oct 11, 2022):

sherlock-program${--sites SITE_name}

<!-- gh-comment-id:1275082384 --> @JordonRR commented on GitHub (Oct 11, 2022): sherlock-program${--sites SITE_name}
Author
Owner

@kolayne commented on GitHub (Oct 27, 2022):

This seems fixed by #503, isn't it?

<!-- gh-comment-id:1293172591 --> @kolayne commented on GitHub (Oct 27, 2022): This seems fixed by #503, isn't it?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#264
No description provided.