Senthil Kumaran orsent...@gmail.com added the comment:
Fix committed in revision 84932. A property based fileno was not required,
because it is hardly set, it is always often a read-only attribute. Also, py3k
behavior is same as the current fix.
--
Senthil Kumaran orsent...@gmail.com added the comment:
Documented it in r84933, r84934 and r84935
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Changes by Senthil Kumaran orsent...@gmail.com:
--
assignee: - orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
___
Changes by Mark Lawrence breamore...@yahoo.co.uk:
--
versions: +Python 2.7 -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
Changes by Kevin Dwyer kevin.p.dw...@gmail.com:
--
nosy: +kevindication
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
___
Mark Lawrence breamore...@yahoo.co.uk added the comment:
These patches are small and marked as easy, can they be accepted?
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
Changes by Daniel Diniz aja...@gmail.com:
--
keywords: +easy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
___
Python-bugs-list
Changes by Daniel Diniz aja...@gmail.com:
--
nosy: +orsenthil
versions: -Python 2.4, Python 2.5, Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
Changes by Daniel Diniz aja...@gmail.com:
--
nosy: +jjlee
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
___
Python-bugs-list mailing
Daniel Diniz aja...@gmail.com added the comment:
OK, I'll work on a test + patch.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
___
Daniel Diniz aja...@gmail.com added the comment:
IMHO, using a fileno property looks better than __getattr__. Setting an
attribute in init works too, unless fp changes during the object life
(then 3.x is broken IIUC).
It works OK as a property of either urllib.addinfourl or of
Changes by Daniel Diniz aja...@gmail.com:
--
components: +Library (Lib) -None
type: - behavior
Added file: http://bugs.python.org/file13031/urllib_fileno.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
Daniel Diniz aja...@gmail.com added the comment:
Hmm, always run all the tests :)
fileno is set in test_urllib2. New patches.
Added file: http://bugs.python.org/file13032/httplib_fileno_2.diff
___
Python tracker rep...@bugs.python.org
Changes by Daniel Diniz aja...@gmail.com:
Removed file: http://bugs.python.org/file13030/httplib_fileno.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
Changes by Daniel Diniz aja...@gmail.com:
Added file: http://bugs.python.org/file13033/urllib_fileno_2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
Changes by Daniel Diniz aja...@gmail.com:
Removed file: http://bugs.python.org/file13031/urllib_fileno.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
___
Daniel Diniz aja...@gmail.com added the comment:
The urllib patch breaks test_pyclbr because test_pyclbr can't handle
properties. I think the test is wrong here, hence the hack attached...
otherwise, let's go with httplib.
Added file: http://bugs.python.org/file13036/test_pyclbr_property.diff
Georg Brandl ge...@python.org added the comment:
Well, easy access is not the point. If the object is supposed to have
the file-like interface, and can provide a fileno(), it should.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
Brett Cannon br...@python.org added the comment:
Georg is right and this has been fixed apparently in 3.0, leaving 2.7
and older broken.
There are two possible solutions to this. One is to change
socket._fileobject.fileno() to simply try self._sock.fp.fileno() if
self._sock.fileno() does not
Brett Cannon br...@python.org added the comment:
Another option is to change urllib.addinfourl to look for fileno() on an
HTTPResponse object.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1327971
Daniel Diniz aja...@gmail.com added the comment:
Besides being outdated, the OP shows it's trivial to access the fileno:
r.fileno = r.fp.fileno. I suggest closing.
--
nosy: +ajaksu2
___
Python tracker rep...@bugs.python.org
21 matches
Mail list logo