![](https://secure.gravatar.com/avatar/0508a883f97a7d0b6eb47288428b31a5.jpg?s=120&d=mm&r=g)
I've noticed an error that comes up from time to time in python 3.0 buildbots. The error is always similar to this one: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 900, in testBasicIO self.assertEquals(f.write("abc"), 3) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1486, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' The most recent is here: http://www.python.org/dev/buildbot/3.0/AMD64%20W2k8%203.0/builds/843/step-te... but this already happened on various buildbots: http://www.google.fr/search?q=%27NoneType%27+object+has+no+attribute+encode+site:mail.python.org/pipermail/python-checkins&filter=0 "x86 XP-4 3.0", "amd64 gentoo 3.0", "AMD64 W2k8 3.0", "x86 W2k8 3.0", "g4 osx.4 3.0", "OS X x86 3.0" "x86 XP-3 trunk" yes, even on trunk! Every time, a "codecs" global module variable has been reset to None, either in a codec module (encoding/ascii.py, encoding/mac_roman.py) or in test_io.py. Every time, io.py is not far (which may be normal, it must have the larger usage of encodings written in a .py) I know that modules globals are reset to None on interpreter shutdown, but it does not seem to be the case here: the unit test fail, and fails again when run in verbose mode at the end. I checked that the "codecs" name is a module global: the disassembler shows a LOAD_GLOBAL opcode followed by LOAD_ATTR: 0 LOAD_GLOBAL 0 (codecs) 3 LOAD_ATTR 1 (ascii_decode) ... I fail to imagine a reason, apart from a creeping memory error (in dictionary lookup; chilling idea). Thoughts? -- Amaury Forgeot d'Arc