SG-38306 Python2 Removal - Part 7 - various#404
Merged
eduardoChaucaGallegos merged 35 commits intomasterfrom Sep 10, 2025
Merged
SG-38306 Python2 Removal - Part 7 - various#404eduardoChaucaGallegos merged 35 commits intomasterfrom
eduardoChaucaGallegos merged 35 commits intomasterfrom
Conversation
This was referenced Jul 16, 2025
Merged
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
346dc35 to
6124681
Compare
8ac9c8d to
5d8b18d
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR continues the Python 2 removal effort by cleaning up legacy Python 2/3 compatibility code, updating error handling, and modernizing imports.
- Removed
six.PY2/six.PY3branches and outdated workarounds - Replaced
sgsix.file_typeswithio.IOBaseandShotgunSSLErrorwithssl.SSLError - Simplified tests and CI configuration to target Python 3 only
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_client.py | Removed Python 2/3 guard around json.dumps; always call without encoding |
| tests/test_api.py | Dropped ShotgunSSLError import, switched exception handling to ssl.SSLError |
| tests/base.py | Removed Python 2-specific json.dumps(..., encoding="utf-8") branch |
| shotgun_api3/shotgun.py | Updated imports (removed sgsix), added XML parsing in error handler, replaced sgsix.file_types with io.IOBase |
| azure-pipelines-templates/run-tests.yml | Updated comments to reflect Python 3 versions only |
| README.md | Cleaned up documentation by removing outdated Python 2/3 notes |
Comments suppressed due to low confidence (2)
shotgun_api3/shotgun.py:2926
- [nitpick] The new XML parsing branch in
download_attachmenterror handling isn’t covered by existing tests. Consider adding a unit test that simulates an S3 XML error response to verify that the<Message>extraction works as intended.
root = xml.etree.ElementTree.fromstring("".join(body))
tests/test_api.py:2259
- The code now references
ssl.SSLErrorbutsslis not imported in this file. Please addimport sslat the top oftests/test_api.py.
mock_request.side_effect = ssl.SSLError(
carlos-villavicencio-adsk
previously approved these changes
Jul 17, 2025
Contributor
carlos-villavicencio-adsk
left a comment
There was a problem hiding this comment.
LGTM. Just a couple of nitpicky suggestions.
eduardoChaucaGallegos
previously approved these changes
Jul 18, 2025
Base automatically changed from
ticket/SG-38306-python2-removal-httplib2
to
master
September 10, 2025 17:54
The base branch was changed.
eduardoChaucaGallegos
approved these changes
Sep 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR orders