Apache Mod-Python - Re: mod_python 3.2.3b available for testing

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > October 2005 > Re: mod_python 3.2.3b available for testing





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: mod_python 3.2.3b available for testing
Nick

2005-10-26, 2:45 am

Jim Gallacher wrote:
>
> No, I'm not sure. Now that I play around with it I'm not sure I
> understand the problem at all. Perhaps Nick could elaborate?

[...]
> Other than the fact that "isinstance(t, FileType): returns False, I
> don't see the problem. Nick?


There's 2 issues. I think a documentation change in mod_python where it
states that a file object is returned to say a file-like object instead
is one. That's easy.

The other is that there isn't an easy way to tell whether what you've
got in the field is a file or not, because no matter what you've got
something that "looks" like a file. Under the current documentation you
could have tried isinstance(field.file, file), but that's clearly not
the right thing to do since TemporaryFile doesn't necessarily return an
actual file object. I accept that, but there needs to be an easy way to
know what type the Field object value is -- string or file. Checking
filename or disposition is obtuse, and there may not necessarily be a
file name even if you get a file.

So that's my problem, or at least that's where the conversation has led
me. Is there an easy way to figure out what you've got other than
process of elimination?

Thanks,
Nick

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com