Closed BelKed closed 1 year ago
Thanks for the updated PR. Is there any reason for dropping the г
format completely, whereas only Windows is affected (maybe related to https://bugs.python.org/issue8304)? We already have exceptions for Windows date formats inside our code and should probably use a similar approach here: https://github.com/tomasbedrich/pycaching/blob/2a6067bb6340eb23a41fd6f8d7789645fc155e4f/pycaching/util.py#L99
Just for the record, the offending exceptions is the following one:
> formatted_date = datetime.datetime.strftime(date, pattern)
E UnicodeEncodeError: 'locale' codec can't encode character '\u0433' in position 9: encoding error
Just the Windows build was failing… I’ll take a look at it in the evening and hopefully add a commit with fix for Windows :)
As I promised, I fixed it...
Feel free to let me know about any issues with this solution :)
Thanks, seems legit to me. Nevertheless, I would probably prefer to avoid this overhead for Linux and macOS. Could you make the offending section conditional, please? Meaning:
if platform.system() == "Windows":
# Use solution with encoding and decoding.
else:
# Use old solution.
It seems that the date format no longer depends on the language settings. In
Settings > Preferences
, you can find aDate Format
section, where you can set a variety of date formats:This PR adds support for all of them. Related to stale #155.