Project

Profile

Help

Issue #7110

closed

pulpcore-client - packaging does not state that python 2.7 is not supported

Added by wibbit over 4 years ago. Updated about 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 79
Quarter:

Description

When attempting to upload an artefact using pulpcore-client, I'm greeted with a Unicode error.

Trace is below, I've also included the value of msg, in case that's of assistance.

UnicodeDecodeError Traceback (most recent call last) [48/4497] in () ----> 1 server.upload_artifact('/tmp/bats-python38-pycryptodomex-3.9.7-1.el7.x86_64.rpm')

/opt/systems/python/site_syseng/prog/pulpctl/poc.py in upload_artifact(self, file_path) 122 upload = self.uploads.update(upload_href=upload.pulp_href, 123 file=file_chunk.name, --> 124 content_range=content_range) 125 offset += chunk_size 126 sha256hasher.update(chunk)

/opt/bats/lib/python2.7/site-packages/pulpcore/client/pulpcore/api/uploads_api.pyc in update(self, upload_href, content_range, file, **kwargs) 639 """ 640 kwargs['_return_http_data_only'] = True --> 641 return self.update_with_http_info(upload_href, content_range, file, **kwargs) # noqa: E501 642 643 def update_with_http_info(self, upload_href, content_range, file, **kwargs): # noqa: E501

/opt/bats/lib/python2.7/site-packages/pulpcore/client/pulpcore/api/uploads_api.pyc in update_with_http_info(self, upload_href, content_range, file, **kwargs) 748 _preload_content=local_var_params.get('_preload_content', True), 749 _request_timeout=local_var_params.get('_request_timeout'), --> 750 collection_formats=collection_formats)

/opt/bats/lib/python2.7/site-packages/pulpcore/client/pulpcore/api_client.pyc in call_api(self, resource_path, method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, async_req, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host) 351 response_type, auth_settings, 352 _return_http_data_only, collection_formats, --> 353 _preload_content, _request_timeout, _host) 354 355 return self.pool.apply_async(self.__call_api, (resource_path,

/opt/bats/lib/python2.7/site-packages/pulpcore/client/pulpcore/api_client.pyc in __call_api(self, resource_path, method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host) 182 post_params=post_params, body=body, 183 _preload_content=_preload_content, --> 184 _request_timeout=_request_timeout) 185 186 self.last_response = response_data

/opt/bats/lib/python2.7/site-packages/pulpcore/client/pulpcore/api_client.pyc in request(self, method, url, query_params, headers, post_params, body, _preload_content, _request_timeout) 403 _preload_content=_preload_content, 404 _request_timeout=_request_timeout, --> 405 body=body) 406 elif method == "PATCH": 407 return self.rest_client.PATCH(url,

/opt/bats/lib/python2.7/site-packages/pulpcore/client/pulpcore/rest.pyc in PUT(self, url, headers, query_params, post_params, body, _preload_content, _request_timeout) 284 _preload_content=_preload_content, 285 _request_timeout=_request_timeout, --> 286 body=body) 287 288 def PATCH(self, url, headers=None, query_params=None, post_params=None,

/opt/bats/lib/python2.7/site-packages/pulpcore/client/pulpcore/rest.pyc in request(self, method, url, query_params, headers, body, post_params, _preload_content, _request_timeout) 186 preload_content=_preload_content, 187 timeout=timeout, --> 188 headers=headers) 189 # Pass a string parameter directly in the body to support 190 # other content types than Json when body argument is

/opt/bats/lib/python2.7/site-packages/urllib3/request.pyc in request(self, method, url, fields, headers, **urlopen_kw) 68 return self.request_encode_body(method, url, fields=fields, 69 headers=headers, ---> 70 **urlopen_kw) 71 72 def request_encode_url(self, method, url, fields=None, headers=None,

/opt/bats/lib/python2.7/site-packages/urllib3/request.pyc in request_encode_body(self, method, url, fields, headers, encode_multipart, multipart_boundary, **urlopen_kw) 146 extra_kw.update(urlopen_kw) 147 --> 148 return self.urlopen(method, url, **extra_kw)

/opt/bats/lib/python2.7/site-packages/urllib3/poolmanager.pyc in urlopen(self, method, url, redirect, **kw) 319 response = conn.urlopen(method, url, **kw) 320 else: --> 321 response = conn.urlopen(method, u.request_uri, **kw) 322 323 redirect_location = redirect and response.get_redirect_location()

/opt/bats/lib/python2.7/site-packages/urllib3/connectionpool.pyc in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 599 timeout=timeout_obj, 600 body=body, headers=headers, --> 601 chunked=chunked) 602 603 # If we're going to release the connection in finally:, then

/opt/bats/lib/python2.7/site-packages/urllib3/connectionpool.pyc in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) 355 conn.request_chunked(method, url, **httplib_request_kw) 356 else: --> 357 conn.request(method, url, **httplib_request_kw) 358 359 # Reset the timeout for the recv() on the socket

/opt/bats/lib/python2.7/httplib.pyc in request(self, method, url, body, headers) 999 def request(self, method, url, body=None, headers={}): 1000 """Send a complete request to the server.""" -> 1001 self._send_request(method, url, body, headers) 1002 1003 def _set_content_length(self, body):

/opt/bats/lib/python2.7/httplib.pyc in _send_request(self, method, url, body, headers) 1033 for hdr, value in headers.iteritems(): 1034 self.putheader(hdr, value) -> 1035 self.endheaders(body) 1036 1037 def getresponse(self, buffering=False):

/opt/bats/lib/python2.7/httplib.pyc in endheaders(self, message_body) 995 else: 996 raise CannotSendHeader() --> 997 self._send_output(message_body) 998 999 def request(self, method, url, body=None, headers={}):

/opt/bats/lib/python2.7/httplib.pyc in _send_output(self, message_body) 846 # between delayed ack and the Nagle algorithm. 847 if isinstance(message_body, str): --> 848 msg += message_body 849 message_body = None 850 self.send(msg)

UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 145: ordinal not in range(128)

In [5]: %debug

/opt/bats/lib/python2.7/httplib.py(848)_send_output() 846 # between delayed ack and the Nagle algorithm. 847 if isinstance(message_body, str): --> 848 msg += message_body 849 message_body = None 850 self.send(msg)

ipdb> msg u'PUT /pulp/api/v3/uploads/bef1a8ff-3573-43e0-8762-50175ddf6b5e/ HTTP/1.1\r\nHost: pulp-master.test\r\nAccept-Encoding: identity\r\nContent-Length: 16569\r\nContent-Range: bytes 0-19999/11656128\r\nContent-Type: multipart/form-data; boundary=4ef4823629244adfb6b80e485fb05df5\r\nAuthorization: Basic YWRtaW46cGFzc3dvcm Q=\r\nAccept: application/json\r\nUser-Agent: OpenAPI-Generator/3.4.1/python\r\n\r\n'

Also available in: Atom PDF