This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Anthony Sottile, barry, brett.cannon, doko, eric.snow, jaraco, ncoghlan, serhiy.storchaka
Date 2019-06-07.04:56:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559883416.59.0.317764287446.issue37162@roundup.psfhosted.org>
In-reply-to
Content
@staticmethod
    def _switch_path(path):
        from contextlib import suppress
        import zipfile
        from pathlib import Path
        with suppress(Exception):
            return zipfile.Path(path)
        return Path(path)

Oh, I did not know about zipfile.Path!

I do not think this is a correct solution. It does not work with general loaders. I think that it would be more correct to override some methods in zipimport.
History
Date User Action Args
2019-06-07 04:56:56serhiy.storchakasetrecipients: + serhiy.storchaka, barry, brett.cannon, doko, jaraco, ncoghlan, eric.snow, Anthony Sottile
2019-06-07 04:56:56serhiy.storchakasetmessageid: <1559883416.59.0.317764287446.issue37162@roundup.psfhosted.org>
2019-06-07 04:56:56serhiy.storchakalinkissue37162 messages
2019-06-07 04:56:56serhiy.storchakacreate