CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 31 Jul 2025 22:31:31 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20071208102707
location: https://web.archive.org/web/20071208102707/https://wiki.python.org/moin/StreamWriter
server-timing: captures_list;dur=0.529161, exclusion.robots;dur=0.016792, exclusion.robots.policy;dur=0.007527, esindex;dur=0.010293, cdx.remote;dur=5.925195, LoadShardBlock;dur=104.676204, PetaboxLoader3.datanode;dur=41.100107
x-app-server: wwwb-app203
x-ts: 302
x-tr: 136
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app203; 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 22:31:32 GMT
content-type: text/html;charset=utf-8
x-archive-orig-date: Sat, 08 Dec 2007 10:27:06 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:07 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 08 Dec 2007 10:27:07 GMT", ; rel="memento"; datetime="Sat, 08 Dec 2007 10:27:07 GMT", ; rel="next memento"; datetime="Sat, 13 Aug 2011 15:07:50 GMT", ; rel="last memento"; datetime="Mon, 21 Apr 2025 07:48:39 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=6.413978, exclusion.robots;dur=0.018291, exclusion.robots.policy;dur=0.008970, esindex;dur=0.010103, cdx.remote;dur=13.607865, LoadShardBlock;dur=244.075151, PetaboxLoader3.datanode;dur=133.655081, PetaboxLoader3.resolve;dur=142.739678, load_resource;dur=150.949553
x-app-server: wwwb-app203
x-ts: 200
x-tr: 462
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
StreamWriter - PythonInfo Wiki
StreamWriter
As of Python2.5, StreamWriter wraps (contains) a stream. It defines write and other respective methods to "encode" the data and pass the result to the stream. It exposes all other methods of the stream instance.
Pseudocode of the codecs.StreamWriter definition:
1 class StreamWriter(Codec):
2 def __init__(self, stream):
3 ....
4
5 def write(self, data):
6 return stream.write(self.encode(data))
The encode method normally converts values of type unicode to strs.
Codec modules will attach the encode method to the class definition derived from StreamWriter during the initialization. An excerpt from encodings.utf_8.StreamWriter:
1 class StreamWriter(codecs.StreamWriter):
2 encode = codecs.utf_8_encode
See also: StreamReader, StreamReaderWriter, StreamRecoder.
EditText (last edited 2007-04-02 22:39:14 by IlguizLatypov)
DeleteCache (cached 2007-09-02 12:25:56)- Login
- Navigation
- Actions
- Your recent pages