Open iwconfig opened 7 years ago
Having the same exact error and problem. When using finding and a yaml file for config_file. I’ve even tried using double quotes for everything and using str(‘keywords’). the error always says i have “NoneType”.
api = Connection(domain=dom, config_file=config_name, siteid="EBAY-US", https=True)
request = {'keywords': 'lord of the rings',}
responce = api.execute( "findItemsAdvanced", request)
The error:
Traceback (most recent call last):
File "Pyto.app/site-packages/requests/utils.py", line 941, in check_header_validity
if not pat.match(value):
TypeError: expected string or bytes-like object
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Documents/Ebay_project/ebay_test.py", line 41, in <module>
responce = api.execute( "findItemsAdvanced", request)
File "Documents/site-packages/ebaysdk/connection.py", line 122, in execute
self.build_request(verb, data, verb_attrs, files)
File "Documents/site-packages/ebaysdk/connection.py", line 162, in build_request
self.request = request.prepare()
File "Pyto.app/site-packages/requests/models.py", line 257, in prepare
p.prepare(
File "Pyto.app/site-packages/requests/models.py", line 314, in prepare
self.prepare_headers(headers)
File "Pyto.app/site-packages/requests/models.py", line 448, in prepare_headers
check_header_validity(header)
File "Pyto.app/site-packages/requests/utils.py", line 944, in check_header_validity
raise InvalidHeader("Value for header {%s: %s} must be of type str or "
requests.exceptions.InvalidHeader: Value for header {X-EBAY-SOA-SECURITY-APPNAME: None} must be of type str or bytes, not <class 'NoneType'>
I encountered this problem when trying to use the Finding API in the eBay Sandbox (code defaults to the eBay Production server). You can update a few things and you should be ok.
Update ebay.yaml under the Finding API section:
Also override the domain used in the Finding API to point to the Sandbox domain:
api = Connection(debug=True, domain='svcs.sandbox.ebay.com')
Modify the ebaysdk/finding/__init__.py
class contructor to grab your 'appid' from your ebay.yaml file. In the latest release, line 86 should be modified to:
self.config.set('appid', self.config.get('appid', None))
Am I missing something? I really can't see what's wrong here. Why is my header value
<class 'NoneType'>
? Is this similar to #162 ?Error:
Versions: