On 1/14/07, Calvin Spealman <[EMAIL PROTECTED]> wrote: > Is it a more general problem that null-terminated strings are used > with data from strings we specifically allow to contain null bytes? > Perhaps a migration of *FromString() to *FromStringAndSize() > functions, or taking Python string object pointers, would be a more > general solution to set as a goal, so this sort of thing can't crop up > down the road, again.
Most of the time this is taken care of by the argument type codes passed to PyArg_ParseTuple() and friends. If you use 's' then it assumes the string is for consumption of C code that uses null-termination, and it checks that there are no null bytes. Try open("foo\0"). -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com