CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 31 Jul 2025 06:39:42 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20071208102702
location: https://web.archive.org/web/20071208102702/https://wiki.python.org/moin/StreamRecoder
server-timing: captures_list;dur=11.791233, exclusion.robots;dur=0.020659, exclusion.robots.policy;dur=0.010405, esindex;dur=0.011252, cdx.remote;dur=40.015325, LoadShardBlock;dur=523.315687, PetaboxLoader3.resolve;dur=412.984194, PetaboxLoader3.datanode;dur=78.747697
x-app-server: wwwb-app221
x-ts: 302
x-tr: 601
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=2
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, 31 Jul 2025 06:39:44 GMT
content-type: text/html;charset=utf-8
x-archive-orig-date: Sat, 08 Dec 2007 10:27:01 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 10:27:02 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 08 Dec 2007 10:27:02 GMT", ; rel="memento"; datetime="Sat, 08 Dec 2007 10:27:02 GMT", ; rel="next memento"; datetime="Fri, 24 Jun 2022 15:01:25 GMT", ; rel="last memento"; datetime="Tue, 25 Jun 2024 20:55:30 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_20071208084132_crawl105-c/52_1_20071208102225_crawl107.arc.gz
server-timing: captures_list;dur=0.602288, exclusion.robots;dur=0.019075, exclusion.robots.policy;dur=0.009565, esindex;dur=0.012061, cdx.remote;dur=76.582136, LoadShardBlock;dur=103.035890, PetaboxLoader3.datanode;dur=593.408490, load_resource;dur=598.194653, PetaboxLoader3.resolve;dur=84.238162
x-app-server: wwwb-app221
x-ts: 200
x-tr: 825
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
StreamRecoder - PythonInfo Wiki
StreamRecoder
The codecs.StreamRecoder class re-encodes data between 2 character sets. Its constructor expects the information on 2 character sets in different forms. The user should specify the internal character set as a pair of encoder and decoder. She should provide the external character set by supplying class definitions of a codec-specific StreamReader and StreamWriter.
Pseudocode of codecs.StreamRecoder of the Python2.5 version:
1 class StreamRecoder:
2 def __init__(self, stream, e, d, class_sr, class_sw):
3 # internal encoder, decoder^ ^external decoder, encoder
4 self.r = class_sr(stream)
5 self.w = class_sw(stream)
6 ...
7
8 def read(self):
9 return self.e(self.r.read())
10
11 def write(self, data):
12 return self.w.write(self.d(data))
The codecs module defines a function codecs.EncodedFile() that will return an instance of StreamRecoder according to the supplied internal and external character sets.
See also: StreamReader, StreamWriter, StreamReaderWriter.
EditText (last edited 2007-04-02 22:42:31 by IlguizLatypov)
DeleteCache (cached 2007-09-01 22:08:49)- Login
- Navigation
- Actions
- Your recent pages