Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25995

Python 2.6 StreamReader.readline()

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-xxxfer.readnews.com!news-out.readnews.com!transit3.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From cpppwner@gmail.com
Newsgroups comp.lang.python
Subject Python 2.6 StreamReader.readline()
Date Tue, 24 Jul 2012 08:01:28 -0700 (PDT)
Organization http://groups.google.com
Lines 17
Message-ID <65c7dc3b-3dce-45f2-981b-9c8171418f09@googlegroups.com> (permalink)
NNTP-Posting-Host 193.186.16.207
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1343142088 5087 127.0.0.1 (24 Jul 2012 15:01:28 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Tue, 24 Jul 2012 15:01:28 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=193.186.16.207; posting-account=mxb02woAAAASkNTn1ny6io_TYo8GaLNO
User-Agent G2/1.0
Xref csiph.com comp.lang.python:25995

Show key headers only | View raw


Hi,

I have a simple question, I'm using something like the following lines in python 2.6.2

    reader = codecs.getreader(encoding)
    lines  =  []
    with open(filename, 'rb') as f:
        lines  = reader(f, 'strict').readlines(keepends=False)

where encoding == 'utf-16-be'
Everything works fine, except that lines[0] is equal to codecs.BOM_UTF16_BE
Is this behaviour correct, that the BOM is still present?

Thanks in advance for your help.

Best,
Stefan

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Python 2.6 StreamReader.readline() cpppwner@gmail.com - 2012-07-24 08:01 -0700
  Re: Python 2.6 StreamReader.readline() Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-07-25 08:09 +0200
    Re: Python 2.6 StreamReader.readline() Walter Dörwald <walter@livinglogic.de> - 2012-07-25 11:02 +0200
      Re: Python 2.6 StreamReader.readline() wxjmfauth@gmail.com - 2012-07-25 03:26 -0700
      Re: Python 2.6 StreamReader.readline() wxjmfauth@gmail.com - 2012-07-25 03:26 -0700

csiph-web