Skip to content

SG-38306 Remove Python 2 compatibility #372

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

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

[flake8]
max-line-length = 120
exclude = shotgun_api3/lib/httplib2/*,shotgun_api3/lib/six.py,tests/httplib2test.py,tests/mock.py
exclude = shotgun_api3/lib/httplib2/*,shotgun_api3/lib/six.py,tests/httplib2test.py
4 changes: 1 addition & 3 deletions docs/advanced/iron_python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ v3.0.20 can be used with IronPython with a little bit of added work:

- If you encounter any SSL errors like
``unknown field: SERIALNUMBER=0123456789`` or ``:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed``.
For now you can workaround this problem by disabling ssl certificate validation which we've
encountered some intermittent issues with. Set ``NO_SSL_VALIDATION = True`` for either case.
See :const:`shotgun_api3.shotgun.NO_SSL_VALIDATION`
Inject you own CA cert <<TODO>>

- If you encounter ``LookupError: unknown encoding: idna``, you can force utf-8 by changing
iri2uri.py ~ln 71 from ``authority = authority.encode('idna')`` to
Expand Down
13 changes: 0 additions & 13 deletions shotgun_api3/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ Some third-party modules are bundled with `python-api` inside lib.

The version of `httplib2` bundled should be updated manually, however its version is included in the unused `shotgun_api3/lib/requirements.txt` to allow Github's automated CVE notifications to work.

### mimetypes

The `mimetypes` module is broken on Windows only for Python 2.7.0 to 2.7.9 inclusively.
We bundle the version from 2.7.10

See bugs:

* [9291](http://bugs.python.org/issue9291) (Fixed in 2.7.7)
* [21652](http://bugs.python.org/issue21652) (Fixed in 2.7.8)
* [22028](http://bugs.python.org/issue22028) (Fixed in 2.7.10)

The version of `mimetypes` bundled should be updated manually if necessary, however it is unlikely this will be needed, as it is only used for Python versions 2.7.0 - 2.7.9, and newer Python versions simply use the native `mimetypes` module.

### six

Six is a Python 2/3 compatibility library. In python-api, it's used to make simultaneous support for Python on 2 and 3 easier to maintain and more readable, but allowing the use of common helper functions, unified interfaces for modules that changed, and variables to ease type comparisons. For more on six, see the [documentation](https://six.readthedocs.io/).
Expand Down
Loading
Loading