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


Groups > comp.lang.python > #110037

Contradictory error messages in Python 3.4 - standard library issue!

From Harrison Chudleigh <harrison.chudleigh1@education.nsw.gov.au>
Newsgroups comp.lang.python
Subject Contradictory error messages in Python 3.4 - standard library issue!
Date 2016-06-17 08:25 +1000
Message-ID <mailman.96.1466116456.2288.python-list@python.org> (permalink)
References <CACMigy3DREGfAe=3SDacYkaPX90=wqp1N5T93DCzHpwqD54Y=g@mail.gmail.com>

Show all headers | View raw


While working on a program, I ran into an error with the usage of the
module tokenize. The following message was displayed.
 File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tokenize.py",
line 467, in tokenize
    encoding, consumed = detect_encoding(readline)
  File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tokenize.py",
line 409, in detect_encoding
    if first.startswith(BOM_UTF8):
TypeError: startswith first arg must be str or a tuple of str, not bytes
Undaunted, I changed the error on line 409. The line then read:

if first.startswith(BOM_UTF8):
*******************************************************************************
This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender.

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


Thread

Contradictory error messages in Python 3.4 - standard library issue! Harrison Chudleigh <harrison.chudleigh1@education.nsw.gov.au> - 2016-06-17 08:25 +1000
  Re: Contradictory error messages in Python 3.4 - standard library issue! Steven D'Aprano <steve@pearwood.info> - 2016-06-17 11:58 +1000

csiph-web