CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 17 Jul 2025 12:45:38 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20071208115227
location: https://web.archive.org/web/20071208115227/https://wiki.python.org/moin/StreamReaderWriter
server-timing: captures_list;dur=0.701334, exclusion.robots;dur=0.024591, exclusion.robots.policy;dur=0.011787, esindex;dur=0.014203, cdx.remote;dur=15.128503, LoadShardBlock;dur=439.870372, PetaboxLoader3.datanode;dur=194.421157, PetaboxLoader3.resolve;dur=196.124140
x-app-server: wwwb-app221
x-ts: 302
x-tr: 506
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: SERVER=wwwb-app221; 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 12:45:38 GMT
content-type: text/html;charset=utf-8
x-archive-orig-date: Sat, 08 Dec 2007 11:52:26 GMT
x-archive-orig-server: Apache/2.0.54 (Debian GNU/Linux) mod_fastcgi/2.4.2
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sat, 08 Dec 2007 11:52:27 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 08 Dec 2007 11:52:27 GMT", ; rel="memento"; datetime="Sat, 08 Dec 2007 11:52:27 GMT", ; rel="next memento"; datetime="Sat, 13 Aug 2011 02:06:07 GMT", ; rel="last memento"; datetime="Fri, 19 Jul 2024 05:24:55 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: 52_1_20071208104348_crawl102-c/52_1_20071208115139_crawl107.arc.gz
server-timing: captures_list;dur=0.478104, exclusion.robots;dur=0.019260, exclusion.robots.policy;dur=0.009077, esindex;dur=0.011411, cdx.remote;dur=16.139315, LoadShardBlock;dur=274.875935, PetaboxLoader3.datanode;dur=91.857417, PetaboxLoader3.resolve;dur=400.819270, load_resource;dur=347.731777
x-app-server: wwwb-app221
x-ts: 200
x-tr: 687
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
StreamReaderWriter - PythonInfo Wiki
StreamReaderWriter
The Python2.5's codecs.StreamReaderWriter combines StreamReader and StreamWriter. The wrapper will read narrow str strings from the underlying stream and decode them to unicode strings. On writing unicode data to the wrapper, it will encode them to narrow str strings.
The user of the wrapper should specify character sets by supplying class definitions for the respective stream reader and writer.
Pseudocode:
1 class StreamReaderWriter:
2 def __init__(self, stream, class_sr, class_sw):
3 self.r = class_sr(stream)
4 self.w = class_sw(stream)
5
6 def read(self):
7 return self.r.read()
8
9 def write(self, data):
10 return self.w.write(data)
The codecs module defines a function codecs.open(name, encoding) that returns an instance of StreamReaderWriter configured with the supplied encoding.
See also: StreamReader, StreamWriter, StreamRecoder.
EditText (last edited 2007-07-13 04:07:50 by IlguizLatypov)
DeleteCache (cached 2007-09-01 22:08:48)- Login
- Navigation
- Actions
- Your recent pages