Jim Gallacher wrote:
Are you sure there is anything to correct? In both cases, the object
has the same methods available for manipulating files (t.write('a'),
for example). They are not the same type of object, so they have
different dir() output, but don't they have the same functionality?
Wh
Jorey Bump wrote:
Jim Gallacher wrote:
Nick wrote:
More info:
python 2.4.2 on Linux:
>>> import tempfile
>>> t = tempfile.TemporaryFile()
>>> t
', mode 'w+b' at 0xb7df07b8>
>>> type(t)
>>> dir(t)
['__class__', '__delattr__', '__doc__', '__getattribute__',
'__hash__', '__init__', '__it
Indrek Järve wrote:
This behaviour has been with Python for quite a while, so claiming it's
simply a Python bug will be the same as declaring we don't support Windows.
Our company's software that runs on Windows and uses mod_python simply
patches util.py with the following change:
227c227
<
Jim Gallacher wrote:
You may have misunderstood. I was not suggesting that
tempfile.TemporaryFile was introduced in 3.1.4, only that it existed
there. Looking at the svn repository I see it's used in 3.0.0-beta and
2.7.9, so this bug has been lurking for a while. ;)
Yes, although the fact tha
Nick wrote:
Jim Gallacher wrote:
So this is an inconsistency within Python. Should mod_python attempt
to correct it, or just claim a Python bug?
I think we should correct it. I'm sure users don't care that we
implement this with TemporaryFile. That being said, I wonder how many
applicatio
Well, here's another alternative: provide some other attribute to Field,
such as is_file, to determine whether or not the Field is an actual file
upload or something else. Because as implemented, the file attribute will
always return a file-type object.
Nick
Nick wrote:
Jorey Bump wrote:
A
Jorey Bump wrote:
Are you sure there is anything to correct? In both cases, the object has
the same methods available for manipulating files (t.write('a'), for
example). They are not the same type of object, so they have different
dir() output, but don't they have the same functionality? What
Jim Gallacher wrote:
Nick wrote:
More info:
python 2.4.2 on Linux:
>>> import tempfile
>>> t = tempfile.TemporaryFile()
>>> t
', mode 'w+b' at 0xb7df07b8>
>>> type(t)
>>> dir(t)
['__class__', '__delattr__', '__doc__', '__getattribute__',
'__hash__', '__init__', '__iter__', '__new__', '_
Jim Gallacher wrote:
So this is an inconsistency within Python. Should mod_python attempt
to correct it, or just claim a Python bug?
I think we should correct it. I'm sure users don't care that we
implement this with TemporaryFile. That being said, I wonder how many
applications on Windows w
Nick wrote:
More info:
python 2.4.2 on Linux:
>>> import tempfile
>>> t = tempfile.TemporaryFile()
>>> t
', mode 'w+b' at 0xb7df07b8>
>>> type(t)
>>> dir(t)
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__',
'__init__', '__iter__', '__new__', '__reduce__', '__reduce_e
Right, that's exactly what I'm having to do; I was thinking though that
mod_python should present a consistent interface, even if Python doesn't.
And, it is a bug in Python, even if it's a documentation bug (which claims
that the behavior of fdopen is to return a file object). I disagree that
11 matches
Mail list logo