1
""" List all available codec modules.
3
(c) Copyright 2005, Marc-Andre Lemburg (mal@lemburg.com).
5
Licensed to PSF under a Contributor Agreement.
9
import os, codecs, encodings
15
for filename in os.listdir(dir):
16
if filename[-3:] != '.py':
19
# Check whether we've found a true codec
25
except Exception as reason:
26
# Probably an error from importing the codec; still it's
29
print('* problem importing codec %r: %s' % \
35
if __name__ == '__main__':
36
names = listcodecs(encodings.__path__[0])
38
print('all_codecs = [')