Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 512380 - app-admin/ngxtop fix python 3 support
Summary: app-admin/ngxtop fix python 3 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Justin Lecher (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-04 12:45 UTC by Manuel Rüger (RETIRED)
Modified: 2014-11-20 10:02 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Rüger (RETIRED) gentoo-dev 2014-06-04 12:45:30 UTC
starting ngxtop:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.3/ngxtop", line 9, in <module>
    load_entry_point('ngxtop==0.0.2', 'console_scripts', 'ngxtop')()
  File "/usr/lib64/python3.3/site-packages/pkg_resources.py", line 353, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib64/python3.3/site-packages/pkg_resources.py", line 2321, in load_entry_point
    return ep.load()
  File "/usr/lib64/python3.3/site-packages/pkg_resources.py", line 2048, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib64/python3.3/site-packages/ngxtop/ngxtop.py", line 77, in <module>
    from config_parser import detect_log_config, detect_config_path, extract_variables, build_pattern
ImportError: No module named 'config_parser'


Looks like a dependency is missing?
Comment 1 Manuel Rüger (RETIRED) gentoo-dev 2014-06-04 12:47:44 UTC
Looks like this is a python 3.3 issue, it works with python 2.7
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2014-06-04 12:52:25 UTC
It seems there are problem with py3
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2014-06-04 13:08:41 UTC
+*ngxtop-0.0.2-r1 (04 Jun 2014)
+
+  04 Jun 2014; Justin Lecher <jlec@gentoo.org> -ngxtop-0.0.2.ebuild,
+  +ngxtop-0.0.2-r1.ebuild, +files/ngxtop-0.0.2-py3.patch:
+  Fix compatibility with >= py3.3, #512380
+
Comment 4 Manuel Rüger (RETIRED) gentoo-dev 2014-06-04 19:39:38 UTC
Looks like the fix was not complete:


Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.3/ngxtop", line 9, in <module>
    load_entry_point('ngxtop==0.0.2', 'console_scripts', 'ngxtop')()
  File "/usr/lib64/python3.3/site-packages/ngxtop/ngxtop.py", line 385, in main
    process(args)
  File "/usr/lib64/python3.3/site-packages/ngxtop/ngxtop.py", line 352, in process
    access_log, log_format = detect_log_config(arguments)
  File "/usr/lib64/python3.3/site-packages/ngxtop/config_parser.py", line 118, in detect_log_config
    log_path = choose_one(access_logs.keys(), 'Select access log file to process: ')
  File "/usr/lib64/python3.3/site-packages/ngxtop/utils.py", line 9, in choose_one
    selected = raw_input(prompt)
NameError: global name 'raw_input' is not defined
Comment 5 Justin Lecher (RETIRED) gentoo-dev 2014-06-05 06:36:39 UTC
Alright, I will drop py3 support for now and look into fixes.
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2014-06-07 20:36:48 UTC
+  07 Jun 2014; Justin Lecher <jlec@gentoo.org> ngxtop-0.0.2-r1.ebuild,
+  files/ngxtop-0.0.2-py3.patch:
+  Add py3 compatibility, #512380
+
Comment 7 Marcin Mirosław 2014-11-20 10:02:28 UTC
It looks it doesn't work:
# python -V
Python 3.3.5

# ngxtop info
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.3/ngxtop", line 9, in <module>
    load_entry_point('ngxtop==0.0.2', 'console_scripts', 'ngxtop')()
  File "/usr/lib64/python3.3/site-packages/pkg_resources.py", line 353, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib64/python3.3/site-packages/pkg_resources.py", line 2321, in load_entry_point
    return ep.load()
  File "/usr/lib64/python3.3/site-packages/pkg_resources.py", line 2048, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib64/python3.3/site-packages/ngxtop/ngxtop.py", line 77, in <module>
    from config_parser import detect_log_config, detect_config_path, extract_variables, build_pattern
ImportError: No module named 'config_parser'

# eselect python set python2.7

# ngxtop info
nginx configuration file:
  /etc/nginx/nginx.conf
access log file:
  /data/log/http/nginx-access.log
access log format:
  $server_name $host $hostname $remote_addr - $remote_user [$time_local] "$request" $status $bytes_sent "$http_referer" "$http_user_agent" ($gzip_ratio) - -
available variables:
  bytes_sent, gzip_ratio, host, hostname, http_referer, http_user_agent, remote_addr, remote_user, request, server_name, status, time_local