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.

Issue with __str__ of providers without locale

See original GitHub issue

So, now if we try this:

from elizabeth import Numbers

n = Numbers()
print(n))

We will get this:

Traceback (most recent call last):
  File "/home/lk/Development/open_source/elizabeth/app.py", line 5, in <module>
    print(Numbers())
  File "/home/lk/Development/open_source/elizabeth/elizabeth/core/providers.py", line 79, in __str__
    locale_info(self.locale)
  File "/home/lk/Development/open_source/elizabeth/elizabeth/utils.py", line 30, in locale_info
    locale = locale.lower()
AttributeError: 'NoneType' object has no attribute 'lower'

Because not all providers need locale.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
lk-geimfaricommented, Jul 18, 2017

@Valerievich Magic. I do not remember fixing this.

1reaction
lk-geimfaricommented, Jul 18, 2017

@Valerievich Anyway, it’s cool.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Locales with Java's toLowerCase() and toUpperCase()
In Java, String.toLowerCase() method converts characters to lowercase according to the default locale. This causes problems if your ...
Read more >
locale — Internationalization services — Python 3.11.1 ...
locale may be a string, or an iterable of two strings (language code and encoding). If it's an iterable, it's converted to a...
Read more >
A Beginner's Guide to Python's locale Module | Phrase
Explore the fundamental concept behind Python's locale module and learn how to use it for string, number, and date formatting.
Read more >
STR02-J. Specify an appropriate locale when comparing ...
I think the key to this rule is that the locale needs to be set to something so that locale-dependent methods are constrained...
Read more >
String operations should not rely on the default system locale
Failure to specify a locale when calling the methods toLowerCase() , toUpperCase() or format() on String objects means the system default encoding will...
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