elrodo1 / pywebdav

Automatically exported from code.google.com/p/pywebdav
0 stars 0 forks source link

copy/paste in mac os x finder creates empty file #66

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In mac os x finder, right-click and "copy" a non-empty file
2. Paste the file into a folder on a webdav mount
3. Resulting file will be 0 bytes, although finder may continue to show data 
until caches are flushed

What is the expected output? What do you see instead?

I am expecting the full file content to be successfully "pasted" into the 
webdav folder.  Instead, the file is empty.

What version of the product are you using? On what operating system?

pywebdav 0.9.8 with python 2.7.2 on mac os x mountain lion

Please provide any additional information below.

Finder may continue to show data in the file, but if the folder is unmounted 
and then re-mounted, the file will be empty.  Similarly, the file will be empty 
in the backend folder used by the server process.

Debugging shows that mac os x will send a PUT with a chunked content.  The 
chunked check in do_PUT() requires that protocol_version be HTTP/1.1, but at 
runtime protocol_version is HTTP/1.0.  So, os x is sending chunked content but 
pywebdav tries to receive it as unchunked.

As a workaround, I added:

  protocol_version = 'HTTP/1.1'

In the DAVRequestHandler class definition, immediately below the setting of 
encode_threshold.  File pastes in mac os x finder work now, but debugging shows 
that with this change, os x is sending the PUT content as unchunked/unencoded.  
Not sure why this is, but it does result in successful file pastes.

Original issue reported on code.google.com by boyls...@burromesa.net on 29 Jan 2013 at 5:31