использование create_file_from_stream для записи inte rnet извлеченного файла в azure сбой хранилища файлов - python3 - PullRequest
0 голосов
/ 23 января 2020

Я пытаюсь извлечь csv из inte rnet и записать его прямо в azure хранилище файлов. Поскольку я буду делать это в приложении-функции, я не хочу хранить файл локально. Я получаю следующую ошибку из следующего кода:

import urllib.request

from azure.storage.file import FileService

file_service = FileService(account_name='nnnnnn', account_key='jgn;wjgng;wen;n')
file_service.create_directory('store1', 'newdata')

URL = "https://fsadata.github.io/resources-used-business-committee-report/data/resources-used-business-committee-report.csv"
resp = urllib.request.urlopen(URL)
bytesCount = resp.headers['content-length']
file_service.create_file_from_stream('store1', 'newdata', 'newdatafile.scv', resp, bytesCount, content_settings=None, metadata=None, validate_content=False, progress_callback=None, max_connections=2, timeout=None)

Ошибка:

Exception has occurred: TypeError
'<' not supported between instances of 'str' and 'int'
...