DSWS Python API not working

The following code has worked without issue for a long time but as of yesterday quit working:


import DatastreamDSWS as DSWS

ds = DSWS.Datastream(username = "XXXXX", password = "XXXXX")


I'm using Jupyter Notebook and have not made any changes to Python or associated packages. The Eikon API and all other packages are working normally.

I now get the following error when running the two lines of code above.

2023-10-29 19:23:21,443 P[27904] [MainThread 27840] Failed to parse headers (url=https://product.datastream.com:443/DSWSClient/V1/DSService.svc/rest/GetToken): [MissingHeaderBodySeparatorDefect()], unparsed data: 'X-Ds-Server : DSWP11\r\nDate: Sun, 29 Oct 2023 23:23:20 GMT\r\nContent-Length: 376\r\nX-DS-VIP: DS_Web_Prod_EXT-443\r\nStrict-Transport-Security: max-age=86400; includeSubDomains\r\nX-DS-TimeTaken: 20 ms\r\nX-DS-URID: 1698621800705658565683018\r\n\r\n'
Traceback (most recent call last):
File "C:\Users\xxxx\miniconda3\envs\refinitiv\Lib\site-packages\urllib3\connectionpool.py", line 486, in _make_request
assert_header_parsing(httplib_response.msg)
File "C:\Users\xxxx\miniconda3\envs\refinitiv\Lib\site-packages\urllib3\util\response.py", line 91, in assert_header_parsing
raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
urllib3.exceptions.HeaderParsingError: [MissingHeaderBodySeparatorDefect()], unparsed data: 'X-Ds-Server : DSWP11\r\nDate: Sun, 29 Oct 2023 23:23:20 GMT\r\nContent-Length: 376\r\nX-DS-VIP: DS_Web_Prod_EXT-443\r\nStrict-Transport-Security: max-age=86400; includeSubDomains\r\nX-DS-TimeTaken: 20 ms\r\nX-DS-URID: 1698621800705658565683018\r\n\r\n'
HTTPSConnectionPool(host='product.datastream.com', port=443): Read timed out.
_get_json_Response : Exception Occured:
HTTPSConnectionPool(host='product.datastream.com', port=443): Read timed out.

I'd appreciate assistance in being able to access Datastream as usual using the DSWS Python API.

Best Answer

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.