From: Alan K. <jyt...@xh...> - 2007-12-14 05:21:19
|
Philip Jenvey checked in a _fileobject implementation as a part of his extension of the socket module to support fileno(). You can see the updated module here. http://jython.svn.sourceforge.net/viewvc/jython/trunk/jython/Lib/socket.py?view=log IIRC, the _fileobject class was taken directly from cpython, so it should be possible to copy and paste it into your local socket module. However, I don't think that copying the entire new module will work, since it depends on a lot of new java functionality that Philip has written. http://jython.svn.sourceforge.net/viewvc/jython/trunk/jython/src/org/python/core/io/ Lastly; if any module actually uses socket._fileobject, this is really a bug in that module, because it is relying on an implementation detail. If you come across such usage in a module in a jython distribution (e.g. urllib2), then it would be great if you could report it as such in the jython bug tracker. http://www.jython.org/bugs Similarly, it should reported as a bug in the ClientCookie and ClientForm modules, if they use it. Regards, Alan. On Dec 14, 2007 7:13 AM, Daniel Menezes <dan...@gm...> wrote: > What's URL branche? > > https://jython.svn.sourceforge.net/svnroot/jython/branches/Release_2_2maint/jython > or > http://jython.svn.sourceforge.net/viewvc/jython/trunk/jython/ > > Thanks. > > On Dec 13, 2007 6:00 PM, Jeff Emanuel <jem...@fr...> wrote: > > It appears someone checked in changes to socket.py in Jython > > that includes _fileobject on Dec 1, 2007. Maybe you can try downloading > > and building the latest jython sources to see if it works for > > your libraries. > > > > > > > > > > > > > > > > Daniel Menezes wrote: > > > Hi Jeff, please see: > > > http://fepy.sourceforge.net/doc/fepy-options.html#interactive-usage > > > > > > Same problem, and solution for .NET. > > > > > > Thanks. > > > > > > On Dec 13, 2007 3:41 PM, Daniel Menezes < dan...@gm...> > wrote: > > > > > >> I need access _fileobject, because i have using libs: > > >> http://wwwsearch.sourceforge.net/ClientCookie/ > > >> http://wwwsearch.sourceforge.net/ClientForm/ > > >> > > >> And, this libs access _fileobject. > > >> > > >> Is possible use ClientCookie and ClientForm in Jython? > > >> > > >> Thanks. > > >> > > >> > > >> > > >> On Dec 13, 2007 3:30 PM, Jeff Emanuel < jem...@fr...> wrote: > > >> > > >>> Because the implementation of the socket module in > > >>> Jython is different from the C Python implementation. > > >>> Don't write code that relies on implementation details. > > >>> > > >>> > > >>> Daniel Menezes wrote: > > >>>> Why this code work fine in Python 2.5 and don't work in Jython 2.2.1? > > >>>> > > >>>> On Dec 13, 2007 3:09 PM, Jeff Emanuel <jem...@fr...> wrote: > > >>>> > > >>>>> Aren't names that begin with _ considered private > > >>>>> implementation details? > > >>>>> > > >>>>> > > >>>>> Daniel Menezes wrote: > > >>>>>> When call socket._fileobject, return error: 'module' object has no > > >>>>> attribute > > >>>>>> '_fileobject' > > >>>>>> > > >>>>>> ========================= > > >>>>>> Jython 2.2.1 (don't work) > > >>>>>> ========================= > > >>>>>> > > >>>>>> C:\jython2.2.1>jython.bat > > >>>>>>>>> import socket > > >>>>>>>>> socket._fileobject > > >>>>>> Traceback (innermost last): > > >>>>>> File "<console>", line 1, in ? > > >>>>>> AttributeError: 'module' object has no attribute '_fileobject' > > >>>>>> > > >>>>>> > > >>>>>> ===================== > > >>>>>> Python 2.5 (work fine) > > >>>>>> ===================== > > >>>>>> C:\Python25> python.exe > > >>>>>>>>> import socket > > >>>>>>>>> socket._fileobject > > >>>>>> <class 'socket._fileobject'> > > >>>>>> > > >>>>>> > > >>>>>> Anyone can help me? > > >>>>>> > > >>>>>> > > >>>>>> Thanks. > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>> > ------------------------------------------------------------------------ > > >>>>>> > > >>> > ------------------------------------------------------------------------- > > >>>>>> SF.Net email is sponsored by: > > >>>>>> Check out the new SourceForge.net Marketplace. > > >>>>>> It's the best place to buy or sell services > > >>>>>> for just about anything Open Source. > > >>>>>> > > >>> > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > >>>>>> > > >>> > ------------------------------------------------------------------------ > > >>>>>> _______________________________________________ > > >>>>>> Jython-users mailing list > > >>>>>> Jyt...@li... > > >>>>>> https://lists.sourceforge.net/lists/listinfo/jython-users > > >>>> > > >>>> > > >>> > ------------------------------------------------------------------------ > > >>>> > > >>> > ------------------------------------------------------------------------- > > >>>> SF.Net email is sponsored by: > > >>>> Check out the new SourceForge.net Marketplace. > > >>>> It's the best place to buy or sell services > > >>>> for just about anything Open Source. > > >>>> > > >>> > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > >>>> > > >>>> > > >>> > ------------------------------------------------------------------------ > > >>>> _______________________________________________ > > >>>> Jython-users mailing list > > >>>> Jyt...@li... > > >>>> https://lists.sourceforge.net/lists/listinfo/jython-users > > >> > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > ------------------------------------------------------------------------- > > > > > > > > > > > SF.Net email is sponsored by: > > > Check out the new SourceForge.net Marketplace. > > > It's the best place to buy or sell services > > > for just about anything Open Source. > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > Jython-users mailing list > > > Jyt...@li... > > > https://lists.sourceforge.net/lists/listinfo/jython-users > > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > |