You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, after upgrading to Python 3.12.3, Transifex Python SDK 3.5.0 the same code that worked with SDK 2.1.0 produces the following error:
...
File "C:\transifex\api_v3_wrapper.py", line 127, in __upload_resource_content
transifex_api.ResourceStringsAsyncUpload.upload(resource, content)
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\transifex\api\__init__.py", line 48, in upload
upload = cls.create_with_form(data=data, files={"content": content})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\transifex\api\jsonapi\resources.py", line 539, in create_with_form
response_body = cls.API.request("post", cls.get_collection_url(), **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\transifex\api\jsonapi\apis.py", line 184, in request
response = requests.request(
^^^^^^^^^^^^^^^^^
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\requests\sessions.py", line 575, in request
prep = self.prepare_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\requests\sessions.py", line 484, in prepare_request
p.prepare(
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\requests\models.py", line 370, in prepare
self.prepare_body(data, files, json)
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\requests\models.py", line 555, in prepare_body
(body, content_type) = self._encode_files(files, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\requests\models.py", line 201, in _encode_files
body, content_type = encode_multipart_formdata(new_fields)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\<reducted>\AppData\Roaming\Python\Python312\site-packages\urllib3\filepost.py", line 81, in encode_multipart_formdata
body.write(data)
TypeError: a bytes-like object is required, not 'Resource'
With Python 3.10, Transifex Python SDK 2.1.0 this works as expected:
However, after upgrading to Python 3.12.3, Transifex Python SDK 3.5.0 the same code that worked with SDK 2.1.0 produces the following error:
Packages:
The text was updated successfully, but these errors were encountered: