Skip to content

SG-38306 Python2 Removal - Part 8 - Remove deprecated ensure_ascii parameter from SG object #405

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

Conversation

julien-lang
Copy link
Contributor

@julien-lang julien-lang commented Jul 16, 2025

@julien-lang julien-lang force-pushed the ticket/SG-38306-python2-ensure-ascii branch from 2f109c4 to f6275cd Compare July 17, 2025 17:37
@julien-lang julien-lang requested a review from Copilot July 17, 2025 19:19
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 removes the legacy ensure_ascii parameter from the Shotgun client and its mock, cleans up related JSON decoding code, and updates tests to reflect the new default JSON encoding behavior.

  • Drop ensure_ascii argument and methods in Shotgun and Mockgun
  • Remove old tests and helper for Python 2 ensure_ascii behavior; add a new test verifying non-ASCII payload encoding
  • Update client and API code to always use json.dumps(..., ensure_ascii=False)

Reviewed Changes

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

File Description
tests/test_client.py Remove passing ensure_ascii to Shotgun in tests
tests/test_api.py Remove old ensure_ascii tests and add new JSON dump test
shotgun_api3/shotgun.py Remove ensure_ascii parameter, related methods, and logic
shotgun_api3/lib/mockgun/mockgun.py Remove ensure_ascii parameter from mock client constructor
Comments suppressed due to low confidence (2)

tests/test_client.py:649

  • [nitpick] The ensure_ascii parameter is no longer used inside this helper; consider removing it from the signature to avoid unused parameters.
    def _assert_decode_resonse(self, ensure_ascii, data):

tests/test_api.py:831

  • [nitpick] The docstring is inaccurate and has a grammar typo (SG'payload). Please reword to clearly state that the JSON payload is dumped with ensure_ascii=False to allow non-ASCII characters.
        """Make sure SG'payload is using ensure_ascii for json dumps"""

@julien-lang julien-lang marked this pull request as ready for review July 17, 2025 19:20
@julien-lang julien-lang requested a review from a team July 17, 2025 19:21
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