• Не отправляет request.post 'multipart/form-data ' фотографию vk_api?

    @WhiteCat0 Автор вопроса
    Переустанавливал я vk_api и requests
  • Не отправляет request.post 'multipart/form-data ' фотографию vk_api?

    @WhiteCat0 Автор вопроса
    использовал другую, теперь такая дичь

    C:\Users\Данил\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/Данил/PycharmProjects/pythonProject/main.py
    Traceback (most recent call last):
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
        httplib_response = self._make_request(
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request
        six.raise_from(e, None)
      File "<string>", line 3, in raise_from
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
        httplib_response = conn.getresponse()
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1347, in getresponse
        response.begin()
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 307, in begin
        version, status, reason = self._read_status()
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 268, in _read_status
        line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\socket.py", line 669, in readinto
        return self._sock.recv_into(b)
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1241, in recv_into
        return self.read(nbytes, buffer)
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1099, in read
        return self._sslobj.read(len, buffer)
    ConnectionAbortedError: [WinError 10053] Программа на вашем хост-компьютере разорвала установленное подключение
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\requests\adapters.py", line 439, in send
        resp = conn.urlopen(
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\connectionpool.py", line 726, in urlopen
        retries = retries.increment(
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\util\retry.py", line 403, in increment
        raise six.reraise(type(error), error, _stacktrace)
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\packages\six.py", line 734, in reraise
        raise value.with_traceback(tb)
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
        httplib_response = self._make_request(
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request
        six.raise_from(e, None)
      File "<string>", line 3, in raise_from
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
        httplib_response = conn.getresponse()
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1347, in getresponse
        response.begin()
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 307, in begin
        version, status, reason = self._read_status()
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 268, in _read_status
        line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\socket.py", line 669, in readinto
        return self._sock.recv_into(b)
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1241, in recv_into
        return self.read(nbytes, buffer)
      File "C:\Users\Данил\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1099, in read
        return self._sslobj.read(len, buffer)
    urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionAbortedError(10053, 'Программа на вашем хост-компьютере разорвала установленное подключение', None, 10053, None))
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:/Users/Данил/PycharmProjects/pythonProject/main.py", line 10, in <module>
        upload = requests.post(server['upload_url'], files={'photo': open(f"photo1.png", 'rb')}).json()
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\requests\api.py", line 119, in post
        return request('post', url, data=data, json=json, **kwargs)
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\requests\api.py", line 61, in request
        return session.request(method=method, url=url, **kwargs)
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\requests\sessions.py", line 530, in request
        resp = self.send(prep, **send_kwargs)
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\requests\sessions.py", line 643, in send
        r = adapter.send(request, **kwargs)
      File "C:\Users\Данил\PycharmProjects\pythonProject\venv\lib\site-packages\requests\adapters.py", line 498, in send
        raise ConnectionError(err, request=request)
    requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionAbortedError(10053, 'Программа на вашем хост-компьютере разорвала установленное подключение', None, 10053, None))
    
    Process finished with exit code 1