Skip to content

SG-38306 Python2 Removal - Part 2 - Easy ones #399

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 9 commits into
base: ticket/SG-38306-python2-imports-order
Choose a base branch
from

Conversation

@julien-lang julien-lang requested a review from Copilot July 17, 2025 13:58
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 PR continues the removal of Python 2 compatibility code by dropping __future__ imports, cleaning up super() calls, and replacing six utilities and custom ensure_* calls with native Python 3 constructs.

  • Removed Python 2 shims (__future__, six, ensure_*) across tests and core shotgun.py
  • Simplified super() usage everywhere
  • Replaced binary/text conversions with native bytes/str and updated payload encoding logic

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_proxy.py Simplified super() calls
tests/test_mockgun.py Simplified super() calls
tests/test_client.py Replaced ensure_* in b64encode and test payloads
tests/test_api_long.py Removed __future__ import, swapped six.iteritems
tests/test_api.py Removed __future__, replaced six.text_type/binary; simplified paths and type checks
tests/base.py Simplified super() calls in base test classes
shotgun_api3/shotgun.py Removed six iteration, replaced ensure_*, reworked encoding/decoding, updated HTTP form encoding
docs/reference.rst Dropped outdated note about Python 2 text handling
Comments suppressed due to low confidence (1)

shotgun_api3/shotgun.py:4765

  • New branches handle bytes keys and values in form encoding; consider adding unit tests for encode() that pass bytes and non-str types to ensure correct behavior.
        for key, value in params:

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@julien-lang julien-lang marked this pull request as ready for review July 17, 2025 14:01
@julien-lang julien-lang requested a review from a team July 17, 2025 14:09
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.

LGTM

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.

3 participants