Bazarr: update_notifier() error on startup

Created on 18 Jun 2019  路  12Comments  路  Source: morpheus65535/bazarr

Could you help me with following startup error: (with latest dev version)

(main:220) - Bazarr is being restarted...
Bazarr starting...
Traceback (most recent call last):
  File "bazarr/main.py", line 75, in <module>
    update_notifier()
  File "/Users/USER/bazarr/bazarr/bazarr/notifier.py", line 13, in update_notifier
    a = apprise.Apprise()
  File "/Users/USER/bazarr/bazarr/bazarr/../libs/apprise/Apprise.py", line 78, in __init__
    self.locale = AppriseLocale()
  File "/Users/USER/bazarr/bazarr/bazarr/../libs/apprise/AppriseLocale.py", line 111, in __init__
    self.lang = AppriseLocale.detect_language(language)
  File "/Users/USER/bazarr/bazarr/bazarr/../libs/apprise/AppriseLocale.py", line 208, in detect_language
    lang = locale.getdefaultlocale()[0]
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
    return _parse_localename(localename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

All 12 comments

@caronc This locale looks well known to me... ;-)

Any idea?

Understand that this has something to do with notifications; although I did not configure any notification; is there a work-around to skip this code because of the fact I don't have any notifications setup ?

This part of code only update the available notifications providers when Apprise is updated.

No way of disabling this but caronc is the dev behind apprise so we should have his thought about this really soon.

@morpheus65535 This is a new one for me :astonished: . That _locale_ enhancement has been a learning curve for me, that's for sure.

@stefandevo, I will at the end of the day just add a _dirty fix_ to catch and ignore the ValueError being thrown and move on. But i'd really like to properly understand the problem and fix it properly with your help (if you're okay with this). The error you're getting (UTF-8) is an _encoding_ and not a _locale_; this is the part that is really bizarre. Locale's tend to look like _en-US_, or _fr-CA_. Would you kindly share your environment settings with me so I can also attempt to fix this properly (_vs the dirty fix reference above_)? :slightly_smiling_face:

Basically:

  1. Run the following to get your environment variables (source):
# Display environment variables in Microsoft Windows
set
  1. Perhaps also just share a bit more info about your OS? I presume you're using Windows 10? What language did it install in? Anything else I should probably know?

Any help would be fantastic! :slightly_smiling_face:

Sure, like to help!
Well I am running on MacOS High Sierra, 10.13.6 (17G4015) :-)
In my environment variables I see a line:

LC_CTYPE=UTF-8

Prop where it gets the locale.
(no other vars that could refer to locale setting).

FYI. I added in terminal:

export LC_ALL=en_US

That fixed the issue.
But maybe you can assume "en_US" if you get UTF-8 only?

Thank you both! @caronc once you've patched apprise, I'll merge it to Bazarr dev branch.

Thank you very much for such a speedy response! The calls i'm making under the hood belong to python (specifically their _locale_ module). I find it really odd that _it_ would even parse the _LC_CTYPE_ variable at all and then throw an exception against itself... - very strange.... :confused:

But maybe you can assume "en_US" if you get UTF-8 only?

In a kinda/sorta way this will happen anyway. If i can't detect the locale, I definitely won't just impose one. But without one means it just falls back to using the labels I already defined _as is_ (which are English anyway), so you'll win in this case :wink: . It certainly should never crash as you're experiencing; so for that i'm sorry. Thank you for reporting the bug though!

I'm at work right now, but tonight i'll push a fix upstream (and some unit tests so this never happens again).

@stefandevo I was able to reproduce your exact environment and get the same exception. I did some further research and am still not sure how yours got set to UTF-8. After doing some more research; the actual correct entry should have been LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 (src1, src2). Either way, it should still not crash on you; so that part is definitely on me! All should be good now :slightly_smiling_face: ! Thank you so much for your speedy response and help!

@morpheus65535: Systems like yours are front-runners and get you more complaints/tickets then i ever will. I truly appreciate you tagging my name and letting me address my own issue when they surface! :+1:

Edit: as pointed out below, I had a typo 馃檪

Thanks @caronc for your support.
Just for your info I only had the LC_CTYPE parameter in my environment, not the LC_ALL.

@caronc I should be the one thanking you for your support and for providing apprise to us! :-)

Next release of Apprise will be merged to Bazarr dev. As of now, I understand that @stefandevo have a fix for his system and it's not an issue anymore.

Was this page helpful?
0 / 5 - 0 ratings