Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: invalid literal for int() with base 10: '' #7172

Closed
xoriole opened this issue Nov 16, 2022 · 3 comments · Fixed by #7173
Closed

ValueError: invalid literal for int() with base 10: '' #7172

xoriole opened this issue Nov 16, 2022 · 3 comments · Fixed by #7173
Assignees
Milestone

Comments

@xoriole
Copy link
Contributor

xoriole commented Nov 16, 2022

Found while running GUI tests on Ubuntu

[PID:598893] 2022-11-16 10:15:26,707 - ERROR <debug_endpoint:283> DebugEndpoint.get_log(): invalid literal for int() with base 10: ''
Traceback (most recent call last):
  File "/home/<user>/tribler/src/tribler/core/components/restapi/rest/debug_endpoint.py", line 281, in get_log
    max_lines = int(request.query['max_lines'])
ValueError: invalid literal for int() with base 10: ''
@drew2a
Copy link
Collaborator

drew2a commented Nov 16, 2022

Could be a duplicate of #7067

@drew2a
Copy link
Collaborator

drew2a commented Nov 16, 2022

This error shows the absence of the 'max_lines' value in the request.query dictionary:

        # If the log file exists and return last requested 'max_lines' of log
        try:
            max_lines = int(request.query['max_lines'])
        except ValueError as e:
            self.logger.exception(e)
            max_lines = 100

So, from my POV it is not a bug. Anyway, we can rewrite this block and check the value manually to prevent printing the exception output into the logs.

@xoriole
Copy link
Contributor Author

xoriole commented Nov 16, 2022

Yes, I agree it is not a bug but something nice to have fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants