zopefoundation/ZODB

PyInstaller fails to find ZODB's config.xml and exe will no run when using a provided config from URL

CtheCondor opened this issue · 2 comments

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

What I did:

PyInstaller on testserver.py
Pyinstaller --onefile --clean testserver.py
with hidden_import=['_cffi_backend'] # added to the Spec file after the first run attempt showed the error

from ZEO import ClientStorage
import ZODB.config
db=ZODB.config.databaseFromURL(xPath)
conn=db.open()
print(conn.root['test'])

Using Poetry with
zeo="^5.3"
pyinstaller = "^5.2"
ZODB="^5.7.0"
cffi="^1.15.1"

What I expect to happen:

print the list in the root 'test' 'leaf'

What actually happened:

"winError 3 the system cannot find the path specified 'C\Users\owner\AppData\Local\Temp\2_MEI200522\ZODB\config.xml"

What version of Python and Zope/Addons I am using:

ZSEe above

Windows 10

Note cannot attach output directly as it is being run on a closed network computer.

I also tried using storage=ClientStorage.ClientStorage(addr)
then db=DB(storage)
and the exe using that method works... but I need the address/port to be read from as script as it rotates between two LAN computers based on which is plugged in.

Thank you for your assistance I have modified my approach with PyInstaller and it resolved my issue.