diff --git a/HISTORY.rst b/HISTORY.rst index 8d2bcaaa0..e4c5faa9c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,12 @@ Shotgun Python API Changelog Here you can see the full list of changes between each Python API release. +v3.0.37 +===================== + +- Proper support added for unicode and utf-8 string paths given to upload methods, and a sane error is raised when an unusable string encoding is used. +- Adds support for querying preferences from Shotgun via the new preferences_read method. + v3.0.36 ===================== diff --git a/tests/test_api.py b/tests/test_api.py index b84f35dcb..a4f566e5c 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -252,6 +252,23 @@ def test_upload_download(self): # Make sure that non-utf-8 encoded paths raise when they can't be # converted to utf-8. + # + # We need to touch the file we're going to test with first. We can't + # bundle a file with this filename in the repo due to some pip install + # problems on Windows. Note that the path below is utf-8 encoding of + # what we'll eventually encode as shift-jis. + file_path_s = os.path.join(this_dir, "./\xe3\x81\x94.shift-jis") + file_path_u = file_path_s.decode("utf-8") + if sys.platform.startswith("win"): + fh = open(file_path_u, "w") + else: + fh = open(file_path_s, "w") + + try: + fh.write("This is just a test file with some random data in it.") + finally: + fh.close() + u_path = os.path.abspath( os.path.expanduser( glob.glob(os.path.join(unicode(this_dir), u'*.shift-jis'))[0] @@ -278,6 +295,7 @@ def test_upload_download(self): # cleanup os.remove(file_path) + os.remove(u_path) def test_upload_thumbnail_in_create(self): """Upload a thumbnail via the create method""" diff --git "a/tests/\343\201\224.shift-jis" "b/tests/\343\201\224.shift-jis" deleted file mode 100644 index 7a8aaf967..000000000 Binary files "a/tests/\343\201\224.shift-jis" and /dev/null differ