[GH-ISSUE #203] maintenance script crashes with AttributeError #181

Closed
opened 2026-02-26 09:36:22 +03:00 by kerem · 1 comment
Owner

Originally created by @ThomasWaldmann on GitHub (Apr 28, 2015).
Original GitHub issue: https://github.com/nsupdate-info/nsupdate.info/issues/203

the maintenance script checking for abusers crashes with:

...
setting abuse flag for host xxxx.nsupdate.info (created by xxxxx, client faults: 4435)
Traceback (most recent call last):
  File "/srv/nsupdate.info/env/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/srv/nsupdate.info/repo/nsupdate/management/commands/faults.py", line 147, in handle
    ABUSE_MSG
  File "/srv/nsupdate.info/repo/nsupdate/utils/mail.py", line 23, in translate_for_user
    translation.activate(lang)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 145, in activate
    return _trans.activate(language)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 225, in activate
    _active.value = translation(language)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 210, in translation
    current_translation = _fetch(language, fallback=default_translation)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 155, in _fetch
    loc = to_locale(lang)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 79, in to_locale
    p = language.find('-')
AttributeError: 'NoneType' object has no attribute 'find'
Originally created by @ThomasWaldmann on GitHub (Apr 28, 2015). Original GitHub issue: https://github.com/nsupdate-info/nsupdate.info/issues/203 the maintenance script checking for abusers crashes with: ``` ... setting abuse flag for host xxxx.nsupdate.info (created by xxxxx, client faults: 4435) Traceback (most recent call last): File "/srv/nsupdate.info/env/bin/django-admin.py", line 5, in <module> management.execute_from_command_line() File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **options.__dict__) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute output = self.handle(*args, **options) File "/srv/nsupdate.info/repo/nsupdate/management/commands/faults.py", line 147, in handle ABUSE_MSG File "/srv/nsupdate.info/repo/nsupdate/utils/mail.py", line 23, in translate_for_user translation.activate(lang) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 145, in activate return _trans.activate(language) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 225, in activate _active.value = translation(language) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 210, in translation current_translation = _fetch(language, fallback=default_translation) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 155, in _fetch loc = to_locale(lang) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 79, in to_locale p = language.find('-') AttributeError: 'NoneType' object has no attribute 'find' ```
kerem closed this issue 2026-02-26 09:36:22 +03:00
Author
Owner

@ThomasWaldmann commented on GitHub (Jun 4, 2015):

duplicate of #206

<!-- gh-comment-id:108791820 --> @ThomasWaldmann commented on GitHub (Jun 4, 2015): duplicate of #206
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/nsupdate.info-nsupdate-info#181
No description provided.