django-assets icon indicating copy to clipboard operation
django-assets copied to clipboard

Fix issue with Python 3.11

Open heyman opened this issue 3 years ago • 10 comments

This fixes a crash on Python 3.11. Global flags in regexes must now be put at the beginning.

This is the error message for the exception that this PR fixes: re.error: global flags not at the start of the expression at position 12

Resolves #98

heyman avatar Nov 10 '22 22:11 heyman

Looks good, tested against Ubuntu Lunar + Python 3.11.

dbungert avatar Nov 17 '22 00:11 dbungert

Applies the same fix as an accepted pull request for python-glob2 (miracle2k/python-glob2#22), and I too think this looks good.

jayaddison avatar Jan 24 '23 17:01 jayaddison

Maybe someone with commit access could press the merge button?

heyman avatar Jan 25 '23 10:01 heyman

@heyman could you update the description to add the text Resolves #98? (so that it can close that issue if-and-when merged)

jayaddison avatar Jan 25 '23 12:01 jayaddison

@heyman could you update the description to add the text Resolves #98? (so that it can close that issue if-and-when merged)

Hmm, I can't reproduce the issue in #98. How can I reproduce it? (just want to verify that my PR actually fixes the issue)

heyman avatar Jan 25 '23 14:01 heyman

Yep, good thinking. The following should replicate the problem:

fnmatch_filter(names=["__init__.py"], pat="*.py")

(on Python3.10, this emits a DeprecationWarning -- in Python 3.11, it fails -- your fix should address both, I think)

jayaddison avatar Jan 25 '23 15:01 jayaddison

Ok, done!

Hopefully someone with commit access can press the merge button for this tiny fix that makes it possible to use the package on Python 3.11.

heyman avatar Jan 27 '23 12:01 heyman

cc @miracle2k

jayaddison avatar Jan 27 '23 12:01 jayaddison

@heyman since this project is not maintained anymore, should we fork it under an organization and apply requires patches?

vad avatar May 16 '23 08:05 vad

@vad I'm currently using my fork. I don't have time to make it any more "official" than that, but if someone would setup a proper fork (and perhaps even create a new PyPI package) I'd applaud it :).

heyman avatar May 16 '23 14:05 heyman