Skip to content

Conversation

@AadarshM07
Copy link
Contributor

Summary

This PR removes Python 2.7 compatibility code across the codebase, replacing deprecated io.open() calls with the built-in open() function, removing __future__ imports, dropping Python 2-only shims (such as nonzero and urllib2 fallbacks), and simplifying file I/O helpers.

References

Closes #13883

Reviewer guidance

Location of Changes:

  1. build_tools/i18n/fonts.py
  2. build_tools/i18n/utils.py
  3. docker/entrypoint.py
  4. kolibri/core/analytics/test/test_utils.py
  5. kolibri/core/auth/constants/facility_presets.py
  6. kolibri/core/content/management/commands/generate_schema.py
  7. kolibri/core/content/test/test_channel_import.py
  8. kolibri/core/content/utils/paths.py
  9. kolibri/core/content/utils/stopwords.py
  10. kolibri/core/deviceadmin/utils.py
  11. kolibri/core/logger/management/commands/generateuserdata.py
  12. kolibri/core/sqlite/utils.py
  13. kolibri/core/utils/nothing.py
  14. kolibri/core/webpack/hooks.py
  15. kolibri/plugins/qti_viewer/kolibri_plugin.py
  16. kolibri/utils/i18n.py
  17. kolibri/utils/pskolibri/common.py

@github-actions github-actions bot added DEV: renderers HTML5 apps, videos, exercises, etc. DEV: backend Python, databases, networking, filesystem... SIZE: small labels Dec 1, 2025
@AadarshM07 AadarshM07 changed the title Issue#13883 Remove Python 2.7: Simple syntax and import cleanups Dec 1, 2025
Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

Change look correct to me! All python tests seem to pass, therefore no regressions
Thanks @AadarshM07

@AadarshM07
Copy link
Contributor Author

Thanks for reviewing it!
I think that wraps up the Python 2.7 migration work. I am definitely happy to help with anything that comes up in the future, whether it’s something more challenging or anything else that can help the project.

@learning-equality-bot
Copy link

Season’s greetings! 👋

We’d like to thank everyone for another year of fruitful collaborations, engaging discussions, and for the continued support of our work. Learning Equality will be on holidays from December 22 to January 5. We look forward to much more in the new year and wish you a very happy holiday season!

Are you preparing for Google Summer of Code? See our GSoC guidelines.

@rtibbles rtibbles merged commit 5931c90 into learningequality:develop Dec 5, 2025
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DEV: backend Python, databases, networking, filesystem... DEV: renderers HTML5 apps, videos, exercises, etc. SIZE: small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove Python 2.7 legacy: Simple syntax and import cleanups

3 participants