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

fix `OSError: [WinError 87]The parameter is incorrect. : '.' when using PyInstaller #1294

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

IncubatorShokuhou
Copy link
Contributor

@IncubatorShokuhou IncubatorShokuhou commented Sep 15, 2023

When attempting to package a Python script using commands like pyinstaller.exe -D --collect-all=fiona main.py, PyInstaller includes the gdal.dll file in the main directory. This causes an issue where the '.' character representing the current directory as a parameter is passed to os.add_dll_directory on line 38 of the __init__.py file, resulting in an OSError: [WinError 87].

To resolve this issue, I made a modification to 'p' by adding os.path.abspath() to obtain the absolute path of 'p'. This adjustment should not introduce any other errors.

fix `OSError: [WinError 87]The parameter is incorrect. : '.' `when p=“."
@IncubatorShokuhou IncubatorShokuhou changed the title fix OSError: [WinError 87]The parameter is incorrect. : '.' when p=“." whe using pyinstaller fix OSError: [WinError 87]The parameter is incorrect. : '.' when p='.' whe using PyInstaller Sep 15, 2023
@IncubatorShokuhou IncubatorShokuhou changed the title fix OSError: [WinError 87]The parameter is incorrect. : '.' when p='.' whe using PyInstaller fix OSError: [WinError 87]The parameter is incorrect. : '.' when using PyInstaller Sep 15, 2023
@IncubatorShokuhou IncubatorShokuhou changed the title fix OSError: [WinError 87]The parameter is incorrect. : '.' when using PyInstaller fix `OSError: [WinError 87]The parameter is incorrect. : '.' when using PyInstaller Sep 15, 2023
Copy link
Member

@sgillies sgillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IncubatorShokuhou thank you! I would not be surprised if this solved other unreported issues.

@sgillies sgillies added the bug label Oct 1, 2023
@sgillies sgillies added this to the 1.9.5 milestone Oct 1, 2023
@sgillies sgillies merged commit ca25c5a into Toblerity:master Oct 1, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants