Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 577502 - app-admin/denyhosts-3.0 fails to start with error message "NameError: global name 'TupleType' is not defined"
Summary: app-admin/denyhosts-3.0 fails to start with error message "NameError: global ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Christoph Junghans (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 571536
  Show dependency tree
 
Reported: 2016-03-15 20:06 UTC by CFuga
Modified: 2016-03-16 20:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixed a type check which was causing syntax/undefined errors in DenyHosts/report.py when switching between Python2 and Python3. (b5611dfa0510ec8fbaa2db4b6834d0bd7ecf0909.patch,1.47 KB, patch)
2016-03-15 20:06 UTC, CFuga
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description CFuga 2016-03-15 20:06:19 UTC
Created attachment 428318 [details, diff]
Fixed a type check which was causing syntax/undefined errors  in DenyHosts/report.py when switching between Python2 and Python3.

When I upgraded to the current stable version for denyhosts, the service doesn't start. This is the error that appears in my logs:

Mar 15 10:06:17 panza denyhosts.py[4757]: File "/usr/lib/python-exec/python2.7/d
enyhosts.py", line 229, in <module>
Mar 15 10:06:17 panza denyhosts.py[4757]: first_time, noemail, daemon, foregroun
d)
Mar 15 10:06:17 panza denyhosts.py[4757]: File "/usr/lib64/python2.7/site-packag
es/DenyHosts/deny_hosts.py", line 77, in __init__
Mar 15 10:06:17 panza denyhosts.py[4757]: offset = self.process_log(logfile, las
t_offset)
Mar 15 10:06:17 panza denyhosts.py[4757]: File "/usr/lib64/python2.7/site-packages/DenyHosts/deny_hosts.py", line 488, in process_log
Mar 15 10:06:17 panza denyhosts.py[4757]: self.__report.add_section(msg, new_denied_hosts)
Mar 15 10:06:17 panza denyhosts.py[4757]: File "/usr/lib64/python2.7/site-packages/DenyHosts/report.py", line 41, in add_section
Mar 15 10:06:17 panza denyhosts.py[4757]: if type(i) in (TupleType, ListType):
Mar 15 10:06:17 panza denyhosts.py[4757]: NameError: global name 'TupleType' is not defined

It's a known bug for upstream, and it's fixed with the attached patch.
Comment 1 Christoph Junghans (RETIRED) gentoo-dev 2016-03-16 03:19:28 UTC
Source: https://github.com/denyhosts/denyhosts/pull/47/commits/b5611dfa0510ec8fbaa2db4b6834d0bd7ecf0909

And when does this issue with switching python occur? Isn't denyhost in gentoo PYTHON_TARGETS="python2_7" only?
Comment 2 CFuga 2016-03-16 18:15:16 UTC
(In reply to Christoph Junghans from comment #1)
> Source:
> https://github.com/denyhosts/denyhosts/pull/47/commits/
> b5611dfa0510ec8fbaa2db4b6834d0bd7ecf0909
> 
> And when does this issue with switching python occur? Isn't denyhost in
> gentoo PYTHON_TARGETS="python2_7" only?

The switching refers to the developer's work to make denyhosts >= 3.0 run under Python 2 and 3.

This bug only appears when denyhosts uses Python 2.7, and searches malicious IP addresses in the log file for the first time. like the current Gentoo default. The same code, without the patch, runs fine under Python 3.x.
Comment 3 Christoph Junghans (RETIRED) gentoo-dev 2016-03-16 20:34:42 UTC
commit cb232afaeddeec0d704a99e1c9ceb8d712d24ff2
Author: Christoph Junghans <ottxor@gentoo.org>
Date:   Wed Mar 16 14:33:25 2016 -0600

    app-admin/denyhosts: fix bug #577502

    Package-Manager: portage-2.2.26