TypeError: Odd-length string
I am running Fedora 30.
I tried to update the list, but it just gives me "TypeError: Odd-length string".
Full traceback is here:
Traceback (most recent call last):
File "psi_client.py", line 440, in
Any fix, or having a same issue?
Same Issue
same here, i'm fedora 30 and run the docker:latest. during update got same error:
root@fefbd46bc6a8:~/psiphon# psiphon -u 100% [......................................................] 1409925 / 1409925Traceback (most recent call last): File "psi_client.py", line 440, in <module> update() File "psi_client.py", line 311, in update js = i[loc:].decode('hex') File "/usr/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode output = binascii.a2b_hex(input) TypeError: Odd-length string root@fefbd46bc6a8:~/psiphon#
it seems "servers.dat" file did not generate in the normal way so serverlist did not get updated and timeout issue occurs, i used windows based server_list.dat and had no luck (format is different) i'm going to use android version and check whether that file is ok with linux or not!
Edit: it seems this part of code has issue :
f = open('server_list','r')
lol=f.read()
lol = json.loads(lol)
lol = lol["data"]
serv = lol.split('\n')
regions = dict()
regions["propagation_channel_id"] = "FFFFFFFFFFFFFFFF"
regions["sponsor_id"] = "FFFFFFFFFFFFFFFF"
regions["servers"] = list()
for i in serv:
loc = i.find('{"webServerCertificate":'.encode('hex'))
js = i[loc:].decode('hex')
js = json.loads(js)
regions["servers"].append(i)
json.dump(regions, open('servers.dat', 'w'))
so i've edited this part with this code and the output file is structural the same with the original file but cannot be read (i'm so noob in python)
f = open('server_list','r')
lol=f.read()
lol = json.loads(lol)
lol = lol["data"]
serv = lol.split('\n')
regions = dict()
regions["propagation_channel_id"] = "FFFFFFFFFFFFFFFF"
regions["sponsor_id"] = "FFFFFFFFFFFFFFFF"
regions["servers"] = list()
for i in serv:
loc = i.find('"webServerCertificate":'.encode('hex'))
js = "{" + i[loc:].decode('hex')
js = json.loads(js)
regions["servers"].append(i)
json.dump(regions, open('servers.dat', 'w'))
OK issue fixed and output file is working, it seems the main file needs some maintenance since the project is written in 2017 and today's server_list file does not matches. so I've updated the file and output is OK now please test if this is working. thanks
File is ok, the issue is main script should be written from scratch!! i get
delimiter: <class 'pexpect.exceptions.EOF'>
DEBUG: OSSH connection: Timeout exceeded.
for all updated servers!! and i have no knowledge of fixing this issue!! this project is dead!!
I think it is splitting the file in the wrong point. Some of the string that are used to split the file actually didn't exist in the actual file, and that cause the error, I guess.
also, For the future users - This project won't work anymore due to different file format. Main core of Psiphon has been wrote in Go, Which is compilable in Linux. So If you need to use Psiphon in Linux, Complie it by yourself.
If someone is interested at writing the new Psiphon client from scratch, let me know. as I get some free time, I will open a new repository and start developing one. @Erixcode you might want to check this
If someone is interested at writing the new Psiphon client from scratch, let me know. as I get some free time, I will open a new repository and start developing one. @Erixcode you might want to check this
@KokoseiJ I am interested to help out in writing a new psiphon client. I know we have stopped activity and development around the python client but this used to work atleast when @thispc and me modified it 2 years back. Lemme know where you are getting started.
@KokoseiJ I am interested to help out in writing a new psiphon client. I know we have stopped activity and development around the python client but this used to work atleast when @thispc and me modified it 2 years back. Lemme know where you are getting started.
Oh, My god.
OK. but since I am doing another project and I don't have much time to spend at programming(I can write codes in weekend only), It's quite hard to start a new project right now. I will contact you when I've got some free time. My project will probably be done at november.
and, sorry for my bad english If it's hard to read. English is not my main language.
I would be happy to help if my low knowledge helps xD
@tanmaytat11 @thispc @Erixcode I made a PR. check: https://github.com/thispc/psiphon/pull/30 It works on my side, but I can't build a ssh binary. dunno if it's because I am using Fedora. Anyway, I hope you guys to check my fix. and, Merry Christmas everyone!
Edit: plus, I am planning to completely remake the pyclient from scratch with Python3 as this code is running on Python 2 and containing some unnecessary parts because it's from 2012.
@KokoseiJ I think Binary Build issue is because mismatch in openssl version with current one already installed on the system. I tried docker to avoid this issue but still got error as i mentioned before! which i think the code needs to be rewritten from scratch.
@Erixcode Well That's above my ability. using it with SSH relay is the current solution I guess. plus, You can disable OSSH by removing preserved ssh executable, which will make that error disappear.
Oh god Oh fuck It won't work without handshaking