> $ ./python -c "import sys; print(sys.argv)" "$(echo -e 'filename\x90\x90')" > Could not convert argument 3 to str > $ ./python -c "import os; print(os.environ['DUMMY'])" > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "/home/ncoghlan/devel/py3k/Lib/os.py", line 389, in __getitem__ > return self.data[self.keymap(key)] > KeyError: 'DUMMY' > > (Is there a bug report for these yet?) > > I'm also starting to wonder if allowing mixed types might be the way to > go for these interfaces - leaving the bytes objects in place if the > Unicode decode operation fails.
While I can sympathize with people having non-ASCII file names on their disks, I can't sympathize with this example. Normal users just don't put \x90 into their command lines, and those who do deserve the error message they get. Regards, Martin _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com