CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 17 Jul 2025 09:28:12 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20091023053606
location: https://web.archive.org/web/20091023053606/https://wiki.python.org/moin/StreamReader
server-timing: captures_list;dur=0.580126, exclusion.robots;dur=0.022328, exclusion.robots.policy;dur=0.010379, esindex;dur=0.010310, cdx.remote;dur=22.715980, LoadShardBlock;dur=242.181888, PetaboxLoader3.datanode;dur=92.834542, PetaboxLoader3.resolve;dur=88.280480
x-app-server: wwwb-app215
x-ts: 302
x-tr: 289
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: SERVER=wwwb-app215; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Thu, 17 Jul 2025 09:28:12 GMT
content-type: text/html; charset=utf-8
x-archive-orig-date: Fri, 23 Oct 2009 05:36:06 GMT
x-archive-orig-server: Apache/2.2.9 (Debian) mod_fastcgi/2.4.6 mod_python/3.3.1 Python/2.5.2 mod_wsgi/2.5
x-archive-orig-vary: Cookie,User-Agent,Accept-Language
x-archive-orig-content-length: 12905
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 23 Oct 2009 05:36:06 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 08 Dec 2007 10:26:57 GMT", ; rel="prev memento"; datetime="Sat, 08 Dec 2007 10:26:57 GMT", ; rel="memento"; datetime="Fri, 23 Oct 2009 05:36:06 GMT", ; rel="next memento"; datetime="Thu, 17 Dec 2009 21:23:10 GMT", ; rel="last memento"; datetime="Tue, 15 Apr 2025 14:32:13 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_12_20091022131248_crawl102-c/51_12_20091023053528_crawl103.arc.gz
server-timing: captures_list;dur=0.574863, exclusion.robots;dur=0.025077, exclusion.robots.policy;dur=0.011181, esindex;dur=0.013245, cdx.remote;dur=50.298752, LoadShardBlock;dur=97.471917, PetaboxLoader3.datanode;dur=93.895903, load_resource;dur=178.740475, PetaboxLoader3.resolve;dur=135.677103
x-app-server: wwwb-app215
x-ts: 200
x-tr: 384
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
StreamReader - PythonInfo Wiki
As of Python2.5, StreamReader wraps (contains) a stream. It defines read and other respective methods to read the data from the stream and "decode" them. The class exposes all other methods of the stream instance.
Pseudocode of the codecs.StreamReader definition:
1 class StreamReader(Codec):
2 def __init__(self, stream):
3 ....
4
5 def read(self):
6 return self.decode(stream.read())
The decode method normally converts values of type str to unicode.
Codec modules will attach the decode method to the class definition derived from StreamReader during the initialization. An excerpt from encodings.utf_8.StreamReader:
1 class StreamReader(codecs.StreamReader):
2 decode = codecs.utf_8_decode
See also: StreamWriter, StreamReaderWriter, StreamRecoder.
EditText (last edited 2008-11-15 14:00:34 by localhost)