[issue44070] Regression with relative paths in sys.path in python 3.8.10

James Saryerwinnie report at bugs.python.org
Fri May 7 18:06:34 EDT 2021


James Saryerwinnie <js at jamesls.com> added the comment:

> What's the actual scenario that this broke?

I only noticed this because a project that I work on (https://github.com/aws/chalice/) started failing CI for seemingly unrelated changes.  A specific test run is here: https://github.com/jamesls/chalice/runs/2529906754.  This didn't actually break the framework itself, just the tests for the framework.  Chalice imports your application to figure out what resources to deploy to AWS, so the functional tests need to setup/teardown misc. applications and re-import them fresh for each test.

Turns out the GitHub action I was using switched their Python 3.8 from 3.8.9 to 3.8.10 so I started looking into why this failed.  My takeaway from this is to stop using relative imports in sys.path (I don't recall us having a specific reason to do this other than it worked).  I figured I'd file an issue as I'm not actually sure if this consequence was intentional (I only saw bpo-43105 mentioned in the changelog), and was surprised this behavior changed in a patch release.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44070>
_______________________________________


More information about the Python-bugs-list mailing list