Use of VersionInfo with PyInstaller 3.5

8 views
Skip to first unread message

Eric Fahlgren

unread,
Jul 10, 2019, 5:08:08 AM7/10/19
to PyInstaller
Our spec files have always created a VersionInfo struct on the fly and passed that as the value for 'version' to the EXE:

>>> from install.pi_utils import create_version_info
>>> version_info = create_version_info(exe_name, prod_name='JobScheduler')
>>>
>>> exe = EXE(
>>>     ...
>>>     version = version_info,
.>>>    ...
>>> )

But in 3.5 that appears to be disallowed by the check in api.py at line 427, which is specifically requiring a path.

  File "install\jobScheduler.spec", line 67, in <module>
    version                 = version_info,
  File "C:\PROGRA~1\Python37\lib\site-packages\PyInstaller\building\api.py", line 427, in __init__
    if not os.path.isabs(self.versrsrc):
  File "C:\PROGRA~1\Python37\lib\ntpath.py", line 69, in isabs
    s = os.fspath(s)
TypeError: expected str, bytes or os.PathLike object, not VSVersionInfo

Here's the source at the crash site:

            if self.versrsrc:
                if not os.path.isabs(self.versrsrc):            *** Crashes here.
                    # relative version-info path is relative to spec file
                    self.versrsrc = os.path.join(
                        CONF['specpath'], self.versrsrc)

Is this a regression, i.e., should I still be able to do this, or do I need to rewrite things to generate a file from the spec and feed that in?
Reply all
Reply to author
Forward
0 new messages