|
29 | 29 | import uuid
|
30 | 30 | import warnings
|
31 | 31 |
|
32 |
| -from shotgun_api3.lib import six |
33 | 32 | from shotgun_api3.lib.httplib2 import Http
|
34 | 33 |
|
35 | 34 | # To mock the correct exception when testion on Python 2 and 3, use the
|
@@ -272,44 +271,6 @@ def test_upload_download(self):
|
272 | 271 | "sg_uploaded_movie",
|
273 | 272 | tag_list="monkeys, everywhere, send, help",
|
274 | 273 | )
|
275 |
| - if six.PY2: |
276 |
| - # In Python2, make sure that non-utf-8 encoded paths raise when they |
277 |
| - # can't be converted to utf-8. For Python3, we'll skip these tests |
278 |
| - # since string encoding is handled differently. |
279 |
| - |
280 |
| - # We need to touch the file we're going to test with first. We can't |
281 |
| - # bundle a file with this filename in the repo due to some pip install |
282 |
| - # problems on Windows. Note that the path below is utf-8 encoding of |
283 |
| - # what we'll eventually encode as shift-jis. |
284 |
| - file_path_s = os.path.join(this_dir, "./\xe3\x81\x94.shift-jis") |
285 |
| - file_path_u = file_path_s.decode("utf-8") |
286 |
| - |
287 |
| - with open( |
288 |
| - file_path_u if sys.platform.startswith("win") else file_path_s, "w" |
289 |
| - ) as fh: |
290 |
| - fh.write("This is just a test file with some random data in it.") |
291 |
| - |
292 |
| - self.assertRaises( |
293 |
| - shotgun_api3.ShotgunError, |
294 |
| - self.sg.upload, |
295 |
| - "Version", |
296 |
| - self.version["id"], |
297 |
| - file_path_u.encode("shift-jis"), |
298 |
| - "sg_uploaded_movie", |
299 |
| - tag_list="monkeys, everywhere, send, help", |
300 |
| - ) |
301 |
| - |
302 |
| - # But it should work in all cases if a unicode string is used. |
303 |
| - self.sg.upload( |
304 |
| - "Version", |
305 |
| - self.version["id"], |
306 |
| - file_path_u, |
307 |
| - "sg_uploaded_movie", |
308 |
| - tag_list="monkeys, everywhere, send, help", |
309 |
| - ) |
310 |
| - |
311 |
| - # cleanup |
312 |
| - os.remove(file_path_u) |
313 | 274 |
|
314 | 275 | # cleanup
|
315 | 276 | os.remove(file_path)
|
|
0 commit comments