kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Clean up outdated Python 2.7 comments and unicode string literals

Open rtibbles opened this issue 9 months ago • 5 comments

🙂 Looking for an issue? Welcome! This issue is open for contribution. If this is the first time you’re requesting an issue, please:

  • Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that don’t follow the guidelines won’t be answered.
  • Confirm that you’ve read the guidelines in your comment.

Overview

Several files contain outdated comments referencing Python 2.7 compatibility and unnecessary u"" unicode string prefixes. These are misleading to contributors and should be cleaned up.

Complexity: Low Target branch: release-v0.19.x

Context

Outdated comments (4 occurrences across 4 files):

  • kolibri/utils/kolibri_whitenoise.py (line 100) — Says whitenoise can't be upgraded "due to Python 2.7 compatibility issues" (actually pinned for Python 3.6 support)
  • kolibri/utils/tests/test_options.py (line 40) — "Use this to clear the list for Py2 compatibility"
  • kolibri/plugins/utils/__init__.py (lines 189-192) — Comments about Python 2 vs 3 ImportError differences
  • kolibri/plugins/hooks.py (line 187) — Docstring says "Vendored from six add_metaclass"

Unicode string literals (6 occurrences in 1 file):

  • docs/conf.py — Uses u"..." prefix on 6 strings (lines 74, 78, 84, 88, 119, 120), unnecessary since Python 3 strings are unicode by default.

The Change

Update or remove outdated comments that reference Python 2.7, and remove unnecessary u"" string prefixes in docs/conf.py.

For comments, either remove them entirely or update them to reflect the actual reason (e.g., the whitenoise comment should reference Python 3.6 support, not Python 2.7).

Acceptance Criteria

  • [ ] No comments referencing Python 2.7 compatibility remain in the listed files
  • [ ] No u"" string prefixes remain in docs/conf.py
  • [ ] No other changes to affected files
  • [ ] All existing tests pass

🤖 This issue was written with AI assistance, under supervision, review and final edits by [@rtibbles] 🤖

rtibbles avatar Feb 16 '26 23:02 rtibbles

@rtibbles would be happy to help in this , kindly assign this issue .

curiouscoder-cmd avatar Feb 17 '26 02:02 curiouscoder-cmd

Yes, I have assigned you.

rtibbles avatar Feb 17 '26 02:02 rtibbles

Yes, I have assigned you.

Thankyou! I have started working on it and will keep the thread updated on my progress.

curiouscoder-cmd avatar Feb 17 '26 02:02 curiouscoder-cmd

@rtibbles I have created a PR you can review it [https://github.com/learningequality/kolibri/pull/14227]

curiouscoder-cmd avatar Feb 22 '26 05:02 curiouscoder-cmd

Fixed in #14227 - thank you @curiouscoder-cmd!

rtibbles avatar Feb 23 '26 19:02 rtibbles