Home » Coding » Python » tinyp2p - trying to get it to work
tinyp2p - trying to get it to work [message #17439] Sun, 07 October 2007 17:51 Go to next message
Fantus  is currently offline Fantus
Messages: 2
Registered: October 2007
Junior Member
Hello

I am doing a small research and I found this:

http://www.freedom-to-tinker.com/tinyp2p.html

I tried to get it to work. So far I managed to run it as a server using
a command:

> python tinyp2p.py haslo server 10.10.10.1 2233

It starts listening on a given port so I assume it works fine (I can
telnet from other machine to 10.10.10.1 on 2233)

Now when I try to run a client using following command:

> python tinyp2p.py haslo client http://10.10.10.1:2233 koniki

it gives me some strange output and erros:


Traceback (most recent call last):
File "tinyp2p.py", line 14, in ?
for url in pxy(ar[3]).f(pw(ar[3]),0,[]):
File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
verbose=self.__verbose
File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in _parse_response
return u.close()
File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: 'exceptions.TypeError:coercing to Unicode:
need string or buffer, list found'>



Can anybody help me to solve this? Please. I did browse google but found
nothing.

Regards
Fantus.
Re: tinyp2p - trying to get it to work [message #17453 is a reply to message #17439 ] Sun, 07 October 2007 21:13 Go to previous messageGo to next message
Marc Christiansen  is currently offline Marc Christiansen
Messages: 3
Registered: September 2007
Junior Member
Fantus <fantus@poczta.fm> wrote:
> Hello
>
> I am doing a small research and I found this:
>
> http://www.freedom-to-tinker.com/tinyp2p.html
[...]
> Now when I try to run a client using following command:
>
> > python tinyp2p.py haslo client http://10.10.10.1:2233 koniki
>
> it gives me some strange output and erros:
>
>
> Traceback (most recent call last):
> File "tinyp2p.py", line 14, in ?
> for url in pxy(ar[3]).f(pw(ar[3]),0,[]):
> File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
> return self.__send(self.__name, args)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
> verbose=self.__verbose
> File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
> return self._parse_response(h.getfile(), sock)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in _parse_response
> return u.close()
> File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
> raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault 1: 'exceptions.TypeError:coercing to Unicode:
> need string or buffer, list found'>
>
>
> Can anybody help me to solve this? Please. I did browse google but found
> nothing.

I had a (not so quick) look. The code proves its point (i.e. writing a
very small p2p application is possible), but it is horrible. With only
one server, the code is broken; maybe it works using multiple servers, I
didn't test. A quick fix seems to be to change the line
pr() and [aug(s) for s in aug(pr()[0])]
to
pr() and [aug(s) for s in aug(pr()[0])] or pr([myU])

Please don't take tinyp2p.py as an example on writing python.

HTH Marc
Re: tinyp2p - trying to get it to work [message #17464 is a reply to message #17453 ] Mon, 08 October 2007 01:49 Go to previous message
Fantus  is currently offline Fantus
Messages: 2
Registered: October 2007
Junior Member
Marc Christiansen pisze:
>> Can anybody help me to solve this? Please. I did browse google but found
>> nothing.
>
> I had a (not so quick) look. The code proves its point (i.e. writing a
> very small p2p application is possible), but it is horrible. With only
> one server, the code is broken; maybe it works using multiple servers, I
> didn't test. A quick fix seems to be to change the line
> pr() and [aug(s) for s in aug(pr()[0])]
> to
> pr() and [aug(s) for s in aug(pr()[0])] or pr([myU])
>
> Please don't take tinyp2p.py as an example on writing python.
>
> HTH Marc

It seems to be working! Respect.

I know this app is a bit messy but I couldnt't find anything else that
would implement p2p basics and wouldn't have hundrends or thousands of
lines of code. I need something very simple and this is fine.

Thank you Marc!
Previous Topic:Re: The Modernization of Emacs: terminology buffer and keybinding
Next Topic:Top Programming Languages of 2013
Goto Forum:
  


Current Time: Fri May 16 02:36:11 EDT 2008

Total time taken to generate the page: 1.90209 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software