mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Added Q. about HTTP/1.1.
This commit is contained in:
parent
f2e499b1d7
commit
4a908be231
1 changed files with 11 additions and 0 deletions
11
Misc/FAQ
11
Misc/FAQ
|
@ -180,6 +180,7 @@ Here's an overview of the questions per chapter:
|
|||
automatically saved to and restored from disk.)
|
||||
4.40. Q. I try to use __spam and I get an error about _SomeClassName__spam.
|
||||
4.41. Q. How do I delete a file? And other file questions.
|
||||
4.42. Q. How to modify urllib or httplib to support HTTP/1.1?
|
||||
|
||||
5. Extending Python
|
||||
5.1. Q. Can I create my own functions in C?
|
||||
|
@ -1690,6 +1691,16 @@ f.truncate(offset); offset defaults to the current seek position.
|
|||
There's also os.ftruncate(fd, offset) for files opened with os.open()
|
||||
-- for advanced Unix hacks only.
|
||||
|
||||
4.42. Q. How to modify urllib or httplib to support HTTP/1.1?
|
||||
|
||||
A. Apply the following patch to httplib.py:
|
||||
|
||||
41c41
|
||||
< replypat = regsub.gsub('\\.', '\\\\.', HTTP_VERSION) + \
|
||||
---
|
||||
> replypat = regsub.gsub('\\.', '\\\\.', 'HTTP/1.[0-9]+') + \
|
||||
|
||||
|
||||
|
||||
5. Extending Python
|
||||
===================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue