Skip to content

Conversation

@ttqureshi
Copy link
Member

- drop support for python 3.8
@ttqureshi
Copy link
Member Author

django.core.files.storage.handler.InvalidStorageError: Could not find backend 'require.storage.OptimizedStaticFilesStorage': No module named 'distutils'

Encountering this error because distutils has been removed in python 3.12.
Therefore making this change:
from distutils.spawn import find_executable
to
from shutil import which

(Reference)

@ttqureshi ttqureshi requested a review from farhan April 29, 2025 08:46
# Start of the command to run the compiler in Java.
return [
"java",
"--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this need to be added? Can you add a comment?

Copy link
Member Author

@ttqureshi ttqureshi May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@feanil
before making this change, I was getting the following error:

class org.mozilla.javascript.MemberBox cannot access class sun.nio.ch.FileChannelImpl 
(in module java.base) because module java.base does not export sun.nio.ch to unnamed module

The --add-exports flag allows Rhino to access Java’s internal sun.nio.ch package, which is restricted by default in Java 9+ due to the module system. Without it, Rhino fails when trying to perform file operations.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, please add this as a comment in the file above this line so we can have it as reference if anyone asks the same question in the future.

@ttqureshi ttqureshi requested a review from feanil May 22, 2025 08:13
Copy link

@feanil feanil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small changes and then hopefully this is good to merge and release.

# Start of the command to run the compiler in Java.
return [
"java",
"--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, please add this as a comment in the file above this line so we can have it as reference if anyone asks the same question in the future.

@feanil feanil merged commit 5d93092 into openedx:master Jun 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop Python 3.8 & Add Support for Python 3.12

3 participants