question

Upvotes
Accepted
21 0 1 2

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.

eikon-data-api#technology#productdatastream-apidatastream
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
82.3k 277 53 77

@User1

Thank you for reaching out to us.

According to the answers in this discussion, the problem has been resolved.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.