Skip to content

SG-38306 Python2 Removal - Part 4 - Mimetypes module #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: ticket/SG-38306-python2-removal-cleanup-imports
Choose a base branch
from

Conversation

@julien-lang julien-lang force-pushed the ticket/SG-38306-python2-removal-mimetypes branch from 33e5200 to c4d1e30 Compare July 17, 2025 14:36
@julien-lang julien-lang marked this pull request as ready for review July 17, 2025 14:52
@julien-lang julien-lang requested a review from Copilot July 17, 2025 14:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request removes the deprecated Python 2.7 copy of the mimetypes module as part of the Python 2 removal effort. The codebase now exclusively uses Python's default mimetypes module since there are no longer any known issues with it after the transition away from Python 2.

Key changes:

  • Removes the bundled Python 2.7 mimetypes module that was used to work around Windows-specific bugs in Python 2.7.0-2.7.9
  • Simplifies the mimetypes import logic to directly import the standard library module
  • Removes associated test code that was validating the conditional import behavior

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
shotgun_api3/lib/mimetypes.py Complete removal of the bundled Python 2.7 mimetypes module (598 lines deleted)
shotgun_api3/shotgun.py Simplifies mimetypes import by removing conditional logic and directly importing standard library module
tests/test_unit.py Removes test class and import for the deprecated mimetypes fix functionality
shotgun_api3/lib/README.md Removes documentation section explaining the bundled mimetypes module and associated Python 2.7 Windows bugs

@julien-lang julien-lang requested a review from a team July 17, 2025 14:54
Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Choose a reason for hiding this comment

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

🚢

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.

2 participants