main
main copied to clipboard
socket._fileobject.__init__ 'close' param has no effect
C:\Users\Jeff>ipy
IronPython 2.0 Beta (2.0.0.4000) on .NET 2.0.50727.3053
Type "help", "copyright", "credits" or "license" for more information.
> > > import socket
> > > fd = socket._fileobject(None, close=True)
> > > Traceback (most recent call last):
> > > File "<stdin>", line 1, in <module>
> > > TypeError: __init__() got an unexpected keyword argument 'close'
> > > ^Z
C:\Users\Jeff>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
on
win32
Type "help", "copyright", "credits" or "license" for more information.
import socket
fd = socket._fileobject(None, close=True)
What's weird is that looking at the _fileobject constructor (in socket.cs), it has a close argument.
This breaks urllib2.py from the Python standard library.
Work Item Details
Original CodePlex Issue: Issue 17894 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Aug 17, 2008 at 4:00 AM Reported by: jdhardy Updated on: Feb 22, 2013 at 2:14 AM Updated by: jdhardy Test: test_socket.py (test_fileobject_close) Thanks: jdhardy
On 2008-08-18 06:35:49 UTC, dinov commented:
We need an init that takes **args
On 2008-10-02 07:25:25 UTC, dfugate commented:
We take the parameter now, but don't use it correctly: E:\vslrft\Merlin\Main\Languages\IronPython\Tests>cpy Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import socket fd = socket._fileobject(None, close=True) fd.closed True fd = socket._fileobject(None) fd.closed True ^Z
E:\vslrft\Merlin\Main\Languages\IronPython\Tests>ipyd IronPython 2.0 Beta (2.0.0.5000) on .NET 2.0.50727.3053 Type "help", "copyright", "credits" or "license" for more information.
import socket fd = socket._fileobject(None, close=True) fd.closed False