James Y Knight wrote:
> Those aren't good behaviors, and can't be solved simply by pretending
> certain files don't exist.

A couple of output comparisons for two of James's examples (system
Python is 2.5.3, the Python :

$ python -V
Python 2.5.2
$ python -c "import sys; print sys.argv" "$(echo -e 'filename\x90\x90')"
['-c', 'filename\x90\x90']
$ python -c "import os; print os.environ['DUMMY']"
filename??

$ ./python -V
Python 3.0b3+
$ ./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.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://www.boredomandlaziness.org
_______________________________________________
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

Reply via email to