У меня проблема с моим python скриптом, который загружает файл журнала через Dropbox. скрипт отлично работает на моей p c на другой windows r виртуальной машине p c, но не работает на компании p c. Я получаю следующую ошибку ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] неправильный номер версии (_ssl. c: 1108)
Traceback (most recent call last):
File "C:\Users\cerav\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen
File "C:\Users\cerav\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 376, in _make_request
File "C:\Users\cerav\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 994, in _validate_conn
File "C:\Users\cerav\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connection.py", line 386, in connect
File "C:\Users\cerav\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\util\ssl_.py", line 370, in ssl_wrap_socket
File "c:\users\cerav\appdata\local\programs\python\python38-32\lib\ssl.py", line 500, in wrap_socket
File "c:\users\cerav\appdata\local\programs\python\python38-32\lib\ssl.py", line 1040, in _create
File "c:\users\cerav\appdata\local\programs\python\python38-32\lib\ssl.py", line 1309, in do_handshake
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\cerav\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\adapters.py", line 439, in send
File "C:\Users\cerav\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 719, in urlopen
File "C:\Users\cerav\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\util\retry.py", line 436, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='content.dropboxapi.com', port=443): Max retries exceeded with url: /2/files/upload (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)')))
Во время обработки вышеуказанного исключения произошло другое исключение:
мой python код:
class TransferData:
def __init__(self, access_token):
self.access_token = access_token
def upload_file(self, file_from, file_to):
dbx = dropbox.Dropbox(self.access_token)
with open(file_from, 'rb') as f:
dbx.files_upload(f.read(), file_to,mode=dropbox.files.WriteMode('overwrite'))
def main():
access_token = '1111111111111111111111111111111111111111'
dropbox.Dropbox(access_token, timeout=None)
transferData = TransferData(access_token)
file_from = 'log.xlsx'
file_to = '/Apps/' + r + 'n/ log.xlsx'#add r variable with name of pc
transferData.upload_file(file_from, file_to)
if __name__ == '__main__':
main()