Skip to content

Exception in PyInstaller packaged app #16

@z4none

Description

@z4none

I am using logtail in a PyInstaller packaged project on Windows, my exe is saved on drive D:
I create the LogtailHandler with raise_exceptions=True, when I call logger.info I got these exception:

pathname='main.py' has_main_module=True pathname='main.py' __main__.__file__='C:\\Users\\zi\\AppData\\Local\\Temp\\_MEI61722\\main.py'
Traceback (most recent call last):
  File "main.py", line 647, in <module>
  File "main.py", line 641, in main
  File "main.py", line 161, in __init__
  File "logging\__init__.py", line 1446, in info
  File "logging\__init__.py", line 1589, in _log
  File "logging\__init__.py", line 1599, in handle
  File "logging\__init__.py", line 1661, in callHandlers
  File "logging\__init__.py", line 952, in handle
  File "logtail\handler.py", line 73, in emit
  File "logtail\handler.py", line 63, in emit
  File "logtail\frame.py", line 25, in create_frame
  File "logtail\frame.py", line 70, in _relative_to_main_module_if_possible
  File "logtail\frame.py", line 73, in _relative_to_main_module
  File "ntpath.py", line 703, in relpath
ValueError: path is on mount 'D:', start on mount 'C:'
[33228] Failed to execute script 'main' due to unhandled exception!

It appears that the exe was launched from another drive than the one py file was unpacked from, so that logtail cant get the relative path.

versions
windows: 10
python: 3.9
logtail-python: 0.2.6
pyinstaller: 5.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions