Issue with __str__ of providers without locale
See original GitHub issueSo, 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:
- Created 6 years ago
- Comments:9 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Valerievich Magic. I do not remember fixing this.
@Valerievich Anyway, it’s cool.