You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing OfflineCompressTestCaseWithLazyStringAlikeUrls test failures under Python 3.11. Bisecting the Python 3.11 branch showed that the python/cpython@76cd81d commit introduced the issue.
I tried commenting out the @functools.lru_cache(typed=True) line from the urlsplit function in the Python 3.11 branch, and that seemed to fix the test. Does there need to be a clear_cache() call, or some other way to deal with the urlsplit cache in Python 3.11?
The text was updated successfully, but these errors were encountered:
So, this problem is because of our support for lazy STATIC_URL / COMPRESS_URL introduced in #876. Indeed a couple clear_cache() calls in tests fixes the problem, but I'm not sure it's a good idea... it will likely fail in real life with such lazy settings - they are passed by something (haven't bothered to look what yet) to urlsplit while still being lazy, so it caches the call with the lazy function... We can maybe find a workaround, but I'm not even sure this works correctly with Django alone today with Python 3.11.
I still think this is dangerous, things can easily break depending on implementation of the lazy wrapper, but given that the fix is trivial we can keep this in compressor for now.
I'm seeing
OfflineCompressTestCaseWithLazyStringAlikeUrls
test failures under Python 3.11. Bisecting the Python 3.11 branch showed that the python/cpython@76cd81d commit introduced the issue.I tried commenting out the
@functools.lru_cache(typed=True)
line from theurlsplit
function in the Python 3.11 branch, and that seemed to fix the test. Does there need to be aclear_cache()
call, or some other way to deal with theurlsplit
cache in Python 3.11?The text was updated successfully, but these errors were encountered: