Python RCON Help - struct.error: unpack requires a string argument of length 8
import valve.rcon address = ('x.x.x.x',28216) pwd = 'abcdefg' valve.rcon.RCONMessage.ENCODING = "utf-8" with valve.rcon.RCON(address,pwd) as rcon: print(rcon("echo Hello, world!"))

I get the following error:
File "/home/xxxxx/anaconda3/envs/rcon/lib/python2.7/site-packages/valve/rcon.py", line 180, in decode id_, type_ = struct.unpack("<ii", fixed_fields) struct.error: unpack requires a string argument of length 8

Any help with this is greatly appreciated. I'm not a python/programming expert, but i'm willing to read and follow. This error comes up regardless if I use python 3.7 or 2.7.
< >
Showing 1-8 of 8 comments
Metal_Warrior 12 Jan, 2021 @ 1:48pm 
Well, this seems to be the point:

unpack requires a string argument of length 8

I don't see a string here, and most certainly nothing the length of 8 chars.
knownasthatguy 12 Jan, 2021 @ 1:50pm 
is that to say that im not getting anything back from the server?
knownasthatguy 12 Jan, 2021 @ 1:55pm 
Here is the return data i'm getting:

“÷˜
knownasthatguy 12 Jan, 2021 @ 2:03pm 
here is the buffer data:

print(buffer_.decode('latin-1').encode("utf-8"))
print(type(buffer_))

Ï¥}V
<type 'str'>
[N]ebsun 12 Jan, 2021 @ 7:09pm 
What is the game server ? does it support this type of rcon ?
knownasthatguy 24 Jan, 2021 @ 2:03pm 
that's a good question. I'll ask
knownasthatguy 24 Jan, 2021 @ 2:19pm 
Hosting site said they are using RCON and not WebRCON
Vojtík 8 Mar, 2021 @ 3:18am 
cau
< >
Showing 1-8 of 8 comments
Per page: 1530 50