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

CherryPy packaged with PyInstaller module not found not logged #2001

Open
2 tasks
rsb-developer opened this issue Oct 14, 2023 · 1 comment
Open
2 tasks

Comments

@rsb-developer
Copy link

I'm submitting a ...

  • [XX ] bug report
  • feature request
  • question about the decisions made in the repository

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Executing a CherryPy application built with PyInstaller terminates in the call to cherrypy.engine.start(). There is no error message displayed nor is any information written to the error.log or access.log files. The application runs normally when executed via command line.

If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem. If you can, show us your code.
When using PyInstaller (version 5.13.x and 6.x) to build an application with CherryPy I tracked down the error "cheroot.ssl.builtin" module is not included in the executable. This is not a big deal and easily fixed within the PyInstall build options to manually include the module.

The bug is that there is no error output (screen or log) that this module is missing. In the wspbus.py file in the start function, there is a try block that captures the exception, but that exception is not being written/output anywhere.

  self.log('Shutting down due to error in start listener:',
                 level=40, traceback=True)

I not able to determine why this is not being written to the error/access log file.

In the start function, if an exception occurs it calls self.exit() and the exit function will call os._exit(EX_SOFTWARE) when the state is STARTING, which will never trigger the raise e_info. There is some comments in the exit function on why it is done this way, but maybe needs to be revisited.

What is the expected behavior?
All exceptions would be written to the screen and error log file or raise the error for the application can deal with it.

What is the motivation / use case for changing the behavior?
To make it easy to determine why CherryPy fails due to an exception which is caught by a try block. Had the missing module been written to the log file, it would have not taken a day to figure it it was just a simple missing module.

Please tell us about your environment:

  • Cheroot version: 10.0.0
  • CherryPy version: 18.8.0
  • Python version: 3.9 and 3.11
  • OS: Windows 10 and Linux
  • Browser: n/a

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, e.g. stackoverflow, gitter, etc.)

@webknjaz
Copy link
Member

Do you have a complete reproducer?

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

No branches or pull requests

2 participants