Message149073
| Author |
giampaolo.rodola |
| Recipients |
benjamin.peterson, giampaolo.rodola, orsenthil |
| Date |
2011年12月09日.04:52:30 |
| SpamBayes Score |
0.0070814784 |
| Marked as misclassified |
No |
| Message-id |
<1323406351.42.0.655415580211.issue13559@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
This is not possible for two reasons:
- on most POSIX systems, sendfile() works with mmap-like ("regular") files only, while HTTPConnection.send() accepts any file-like object as long as it provides a read() method
- after read()ing a chunk of data from the file and before send()ing it over the socket, the data can be subject to an intermediate conversion (datablock.encode("iso-8859-1")):
http://hg.python.org/cpython/file/87c6be1e393a/Lib/http/client.py#l839
...whereas sendfile() can only be used to send a binary file "as-is"
I think we can use sendfile() in ftplib.py though .
I'll open a ticket for that. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年12月09日 04:52:31 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, orsenthil, benjamin.peterson |
| 2011年12月09日 04:52:31 | giampaolo.rodola | set | messageid: <1323406351.42.0.655415580211.issue13559@psf.upfronthosting.co.za> |
| 2011年12月09日 04:52:30 | giampaolo.rodola | link | issue13559 messages |
| 2011年12月09日 04:52:30 | giampaolo.rodola | create |
|