gforcada / haproxy_log_analysis

HAProxy log analyzer
https://pypi.org/project/haproxy_log_analysis
GNU General Public License v3.0
89 stars 35 forks source link

Syntax error #42

Closed shadowbgd closed 4 years ago

shadowbgd commented 4 years ago

haproxy_log_analysis Traceback (most recent call last): File "/usr/local/bin/haproxy_log_analysis", line 7, in from haproxy.main import console_script File "/usr/local/lib/python3.5/dist-packages/haproxy/main.py", line 142 f'command "{cmd}" is not available. ' ^ SyntaxError: invalid syntax

shadowbgd commented 4 years ago

python3 setup.py install

running install Checking .pth file support in /usr/local/lib/python3.5/dist-packages/ /usr/bin/python3 -E -c pass TEST PASSED: /usr/local/lib/python3.5/dist-packages/ appears to support .pth files running bdist_egg running egg_info writing dependency_links to haproxy_log_analysis.egg-info/dependency_links.txt writing top-level names to haproxy_log_analysis.egg-info/top_level.txt writing requirements to haproxy_log_analysis.egg-info/requires.txt writing haproxy_log_analysis.egg-info/PKG-INFO writing entry points to haproxy_log_analysis.egg-info/entry_points.txt reading manifest file 'haproxy_log_analysis.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching 'pyvenv.cfg' warning: no previously-included files found matching 'pyproject.toml' warning: no previously-included files found matching 'requirements-dev.in' writing manifest file 'haproxy_log_analysis.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/haproxy creating build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/test_argparse.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/conftest.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/test_filters.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/test_log_file.py -> build/bdist.linux-x86_64/egg/haproxy/tests creating build/bdist.linux-x86_64/egg/haproxy/tests/files copying build/lib/haproxy/tests/files/2_ok_1_invalid.log -> build/bdist.linux-x86_64/egg/haproxy/tests/files copying build/lib/haproxy/tests/files/small.log -> build/bdist.linux-x86_64/egg/haproxy/tests/files copying build/lib/haproxy/tests/test_regex.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/test_log_line.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/init.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/test_main.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/test_commands.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/tests/test_utils.py -> build/bdist.linux-x86_64/egg/haproxy/tests copying build/lib/haproxy/main.py -> build/bdist.linux-x86_64/egg/haproxy copying build/lib/haproxy/line.py -> build/bdist.linux-x86_64/egg/haproxy copying build/lib/haproxy/filters.py -> build/bdist.linux-x86_64/egg/haproxy copying build/lib/haproxy/utils.py -> build/bdist.linux-x86_64/egg/haproxy copying build/lib/haproxy/init.py -> build/bdist.linux-x86_64/egg/haproxy copying build/lib/haproxy/commands.py -> build/bdist.linux-x86_64/egg/haproxy copying build/lib/haproxy/logfile.py -> build/bdist.linux-x86_64/egg/haproxy byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/test_argparse.py to test_argparse.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/tests/test_argparse.py", line 156 assert f'{filename} does not exist' in str(exception_info) ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/conftest.py to conftest.cpython-35.pyc byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/test_filters.py to test_filters.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/tests/test_filters.py", line 19 headers = f' {{{to_check}}}' ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/test_log_file.py to test_log_file.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/tests/test_log_file.py", line 48 file_obj.write(f'{line}\n') ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/test_regex.py to test_regex.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/tests/test_regex.py", line 138 headers = f' {{{request_header}}} {{{response_header}}}' ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/test_log_line.py to test_log_line.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/tests/test_log_line.py", line 67 line = line_factory(http_request=f'{method} {path} {protocol}') ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/init.py to init.cpython-35.pyc byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/test_main.py to test_main.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/tests/test_main.py", line 34 data = parse_arguments(parser.parse_args([f'--{switch}',])) ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/test_commands.py to test_commands.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/tests/test_commands.py", line 14 assert f'{{"{name}": {expected}}}' in output_text ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/tests/test_utils.py to test_utils.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/tests/test_utils.py", line 50 assert cmd_data['description'].startswith(f'{cmd_key}: ') ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/main.py to main.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/main.py", line 142 f'command "{cmd}" is not available. ' ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/line.py to line.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/line.py", line 236 print(f'Could not process HTTP request {self.raw_http_request}') ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/filters.py to filters.cpython-35.pyc byte-compiling build/bdist.linux-x86_64/egg/haproxy/utils.py to utils.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/utils.py", line 28 raw_date_input = f'{data[0]}/{data[1]}/{data[2]}' ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/init.py to init.cpython-35.pyc byte-compiling build/bdist.linux-x86_64/egg/haproxy/commands.py to commands.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/commands.py", line 19 finalstring += f'{character.lower()}' ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/haproxy/logfile.py to logfile.cpython-35.pyc File "build/bdist.linux-x86_64/egg/haproxy/logfile.py", line 45 print(f'\nIt took {end - start}') ^ SyntaxError: invalid syntax

creating build/bdist.linux-x86_64/egg/EGG-INFO copying haproxy_log_analysis.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying haproxy_log_analysis.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying haproxy_log_analysis.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying haproxy_log_analysis.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying haproxy_log_analysis.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO copying haproxy_log_analysis.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying haproxy_log_analysis.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO creating dist creating 'dist/haproxy_log_analysis-4.1.1.dev0-py3.5.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing haproxy_log_analysis-4.1.1.dev0-py3.5.egg creating /usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg Extracting haproxy_log_analysis-4.1.1.dev0-py3.5.egg to /usr/local/lib/python3.5/dist-packages File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/main.py", line 142 f'command "{cmd}" is not available. ' ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/line.py", line 236 print(f'Could not process HTTP request {self.raw_http_request}') ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/utils.py", line 28 raw_date_input = f'{data[0]}/{data[1]}/{data[2]}' ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/commands.py", line 19 finalstring += f'{character.lower()}' ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/logfile.py", line 45 print(f'\nIt took {end - start}') ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/tests/test_argparse.py", line 156 assert f'{filename} does not exist' in str(exception_info) ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/tests/test_filters.py", line 19 headers = f' {{{to_check}}}' ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/tests/test_log_file.py", line 48 file_obj.write(f'{line}\n') ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/tests/test_regex.py", line 138 headers = f' {{{request_header}}} {{{response_header}}}' ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/tests/test_log_line.py", line 67 line = line_factory(http_request=f'{method} {path} {protocol}') ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/tests/test_main.py", line 34 data = parse_arguments(parser.parse_args([f'--{switch}',])) ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/tests/test_commands.py", line 14 assert f'{{"{name}": {expected}}}' in output_text ^ SyntaxError: invalid syntax

File "/usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg/haproxy/tests/test_utils.py", line 50 assert cmd_data['description'].startswith(f'{cmd_key}: ') ^ SyntaxError: invalid syntax

Adding haproxy-log-analysis 4.1.1.dev0 to easy-install.pth file Installing haproxy_log_analysis script to /usr/local/bin

Installed /usr/local/lib/python3.5/dist-packages/haproxy_log_analysis-4.1.1.dev0-py3.5.egg Processing dependencies for haproxy-log-analysis==4.1.1.dev0 Searching for setuptools==20.7.0 Best match: setuptools 20.7.0 Adding setuptools 20.7.0 to easy-install.pth file Installing easy_install script to /usr/local/bin

Using /usr/lib/python3/dist-packages Finished processing dependencies for haproxy-log-analysis==4.1.1.dev0

gforcada commented 4 years ago

Hi @shadowbgd thanks for taking the time to report an issue you had while trying to use haproxy_log_analysis!

Looks like you are using python 3.5 while the minimal required version is python 3.6, as f-strings, the cause for the syntax error was added on that python version.

I will close the issue, if you happen to get into other errors while using a python 3.6+ version, please report them!

Have a nice day! :wave: