PyJaipur / PyJudge

Simple Programming Contest hosting software
MIT License
17 stars 29 forks source link

problem with line 20 in server.py while running the server using python server.py #71

Closed gauravrock closed 5 years ago

gauravrock commented 5 years ago

some problem on line 20 server.py while running the server using python server.py(it happens sometimes)

screenshot 2019-01-27 at 12 31 36 am

shivankgtm commented 5 years ago

can you share your folder structure ?

shivankgtm commented 5 years ago

i think it's case of mac. and we need to add DS_Store in .gitignore.

gauravrock commented 5 years ago

I' ll try to do it @Shivank98. it happens sometimes once it runs but somehow whenever it gets 404 error the next time it gives this error.

shivankgtm commented 5 years ago

yeah try deleting that Ds.. folder for check.

On Mon, Jan 28, 2019, 12:24 AM Gaurav sharma <notifications@github.com wrote:

I' ll try to do it @Shivank98 https://github.com/Shivank98. it happens sometimes once it runs but somehow whenever it gets 404 error the next time it gives this error.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PyJaipur/PyJudge/issues/71#issuecomment-457943875, or mute the thread https://github.com/notifications/unsubscribe-auth/AVkQJuNA241oJ8WUjGYae2_p5VXdDSQDks5vHfXjgaJpZM4aU2jz .

theSage21 commented 5 years ago

actually the problem comes from line 18 which assumes that there will be no extra folders in the listing. We can do a simple check like

for i in os.listdir(question_dir):
    if not i.isdigit():
        continue
    # continue with the rest of the stuff
theSage21 commented 5 years ago

the error is coming because it's trying to find a file there in the path with the DS folder.

theSage21 commented 5 years ago

Perhaps someone can put up a PR which fixes this?

arnabsinha99 commented 5 years ago

I am still getting the 404 Not found error. Could anyone whose server.py is running, help?

gauravrock commented 5 years ago

I am still getting the 404 Not found error. Could anyone whose server.py is running, help?

share the screenshot @arnabsinha99 please

arnabsinha99 commented 5 years ago

I am still getting the 404 Not found error. Could anyone whose server.py is running, help?

share the screenshot @arnabsinha99 please

screenshot 78 screenshot 79

gauravrock commented 5 years ago

@arnabsinha99 your server is running. Please enter this URL after running the server.py: http://localhost:8080/question/1

arnabsinha99 commented 5 years ago

alright. that worked thanks!. some more issues I faced are :-