1

I am making a pygame LAN game and encountered this error

The code is hosted on github: https://github.com/EmilioMendoza98/LANGame

I get the error "SyntaxError: unexpected EOF while parsing" on line 58 for the client and line 66 on the server

I am fairly new to both pygame and sockets so I am completely in the dark here how do I fix this?

4
  • Please verify if you are mentioning the source of error to be these: client side, I could not find line 66 in server.py in servertesting directory. Would you verify that the line address you mentioned for the server exists or am I looking in the wrong place? Commented Dec 20, 2020 at 4:35
  • 2
    Links to code are not acceptable on Stack Overflow. Please post the relevant code in the question itself! Commented Dec 20, 2020 at 4:41
  • Oh I see. Yes, it would be good if suggestions of @KlausD. are abided by. It would help a lot. Thanks for the suggestion. i learnt something new today. Commented Dec 20, 2020 at 5:22
  • @punter147 It seems like i didn't add the files to my repo. I have now added them and they are under the main directory Commented Dec 20, 2020 at 5:44

1 Answer 1

1

I have run your code and had made some changes in multiple files. I have raised a pull request against your repository. Please check that out. A brief explanation of why this is happening is found in this post. The data that you are receiving from the socket is an incomplete/incorrect python statement. It depends on the particular situation, but I could see the error throwing as the data coming from the socket read as 2pos, which is where eval() throws the error. Apologise for not explaining it clearly, but in the process of explaining it clearly I will be making assumptions that are not true in the current code. Therefore, please check my PR against your repository.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.