pyqtdeploy: Error in sysconfig.get_path('purelib')

Patrick Stinson patrickkidd at gmail.com
Tue Nov 8 16:50:35 GMT 2022


Glad to hear you reported it. I was out of touch with the list for a couple
of years there.

I can't catch it since it's bugsnag that is making the call. So I created
this somewhat dirty workaround:

import sysconfig

# Python-3.8+ patch sysconfig._init_non_posix() to support
_imp.extension_suffixes() == [] for pyqtdeploy
def _init_non_posix_pyqtdeploy(vars):
"""Initialize the module as appropriate for NT"""
# set basic install directories
import _imp
vars['LIBDEST'] = sysconfig.get_path('stdlib')
vars['BINLIBDEST'] = sysconfig.get_path('platstdlib')
vars['INCLUDEPY'] = sysconfig.get_path('include')
vars['EXT_SUFFIX'] = None # Here is the fix - don't call _imp.
extension_suffixes()
vars['EXE'] = '.exe'
vars['VERSION'] = sysconfig._PY_VERSION_SHORT_NO_DOT
vars['BINDIR'] = os.path.dirname(sysconfig._safe_realpath(sys.executable))
vars['TZPATH'] = ''
if sys.version_info[1] > 7:
sysconfig._init_non_posix = _init_non_posix_pyqtdeploy

On Mon, Nov 7, 2022 at 3:54 AM Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On 03/11/2022 20:16, Patrick Stinson wrote:
> > Looks like that line is added to Lib/sysconfig.py in Python-3.8.
> >
> > _imp.extension_suffixes() returns [] for pyqtdeploy,
> > so sysconfig._init_non_posix() will always fail.
>
> It's a straightforward Python bug which I have reported. It only affects
> Windows with dynamic loading disabled. Can you work around it by
> catching and ignoring the exception?
>
> Phil
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20221108/16640b13/attachment.htm>


More information about the PyQt mailing list