question

Upvotes
Accepted
29 1 4 12

Connect to mrn archive host via Python

Hi team, I'm trying to use below codes to connect to our archive.news.refinitiv.com host but encountered the error below.

pysftp.Connection(host='archive.news.refinitiv.com', username='GE-xxxxxxx', password='xxxxxx')

ERROR: No hostkey for host archive.news.refinitiv.com found.

May I know what's the reason for that and how should I correct the code to connect? It seems I don't have such thing called "hostkey". Thanks team.

python#productnewsmrn
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
79.2k 251 52 74

@Julian.Bai

Thank you for reaching out to us.

I found this answer on StackOverflow.

import pysftp
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None

pysftp.Connection(host='archive.news.refinitiv.com', username='GE-xxxxxxx', password='xxxxxx',cnopts=cnopts)

Instead of setting the hostkeys to None, you can use another solution mentioned on that discussion.

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.

That works perfectly. Thanks Jira!

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.