This project has moved. For the latest updates, please go here.
1

Closed

socket._fileobject.__init__ 'close' param has no effect

description

<Thanks>jdhardy</Thanks>
<Test>test_socket.py (test_fileobject_close)</Test>
 
 
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.
Closed Dec 9, 2014 at 8:37 PM by jdhardy
Migrated to GitHub.

comments

dinov wrote Aug 17, 2008 at 11:35 PM

We need an init that takes **args

wrote Aug 17, 2008 at 11:35 PM

wrote Aug 20, 2008 at 2:24 AM

wrote Aug 20, 2008 at 2:25 AM

dfugate wrote Oct 2, 2008 at 12:25 AM

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

wrote Oct 2, 2008 at 12:26 AM

wrote Oct 2, 2008 at 12:26 AM

wrote May 22, 2009 at 2:28 AM

wrote Sep 24, 2009 at 6:28 PM

wrote Mar 23, 2010 at 7:27 PM

wrote Apr 19, 2011 at 8:55 AM

wrote Nov 3, 2011 at 6:10 AM

wrote Mar 10, 2012 at 8:18 AM

wrote Feb 22, 2013 at 2:14 AM

wrote Dec 9, 2014 at 8:37 PM