On 24/09/2013 14:01, J. Bagg wrote: > I'm using: > > outputfile = codecs.open (fn, 'w+', 'utf-8', errors='strict')
Well for the life of me I can't make that produce a BOM on 2.7 or 3.4. In other words: <code> import codecs with codecs.open("temp.txt", "w+", "utf-8", errors="strict") as f: f.write("abc") with open("temp.txt", "rb") as f: assert f.read()[:3] == b"abc" </code> works without any assertion failures on 2.7 and 3.4, both running on Win7 and on 2.7 and 3.3 running on Linux. Have I misunderstood your situation? TJG -- https://mail.python.org/mailman/listinfo/python-list