Closed blasterspike closed 4 years ago
Probably setting the timout in Session.get to a large value ir even None doed the trick.
Do you mean this session.get? https://github.com/tomgross/pycloud/blob/1b0d9de6521904dcdc3ca3295f544008065e9e4e/src/pcloud/api.py#L58
or this session.post? https://github.com/tomgross/pycloud/blob/1b0d9de6521904dcdc3ca3295f544008065e9e4e/src/pcloud/api.py#L109
Anyway, I have tried to add timeout=None
to both and I get the same problem, meaning that I don't see the urllib3.connectionpool to /file_write.
Should be fixed with https://github.com/tomgross/pycloud/commit/ccea6a79e9e9b6a15a8282fbdf2f2c66b613b392
@blasterspike Please comment or reopen, if you disagree.
I want to copy a file that is ~12M to pCloud. To do it, I'm using the following code that is using pyfilesystem2
This is what I'm getting back
From what I undestand from the above, what I'm getting back is basically
header: X-Error: 1007
, which is1007 Invalid or closed file descriptor.
https://docs.pcloud.com/methods/fileops/file_write.htmlThe problem I think is that pycloud doesn't wait for the HTTP call to /file_write https://github.com/tomgross/pycloud/blob/6d7429ff91e021183e2a5131d09ef5735e0f1085/src/pcloud/pcloudfs.py#L51 but instead it tries to close the file descriptor immediately with /file_close
This instead is what I get if I try to upload a text file that contains only "HelloWorld", where I can clearly see the urllib3.connectionpool to /file_write:
and as you can see the file is uploaded successfully. Have I understood correctly the problem? If so, would you be able to give me any hint on how I can make file_close to wait on the file_write?
System info: python:3.7 Docker container with Python 3.7.2 appdirs==1.4.3 certifi==2019.3.9 chardet==3.0.4 fs==2.4.4 idna==2.8 pcloud==1.0a6 pytz==2018.9 PyYAML==5.1 requests==2.21.0 six==1.12.0 urllib3==1.24.1
Thanks
Massimo