Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getStatus() returns FileNotFoundError #2

Closed
Bhupesh-V opened this issue Nov 24, 2019 · 0 comments · Fixed by #3
Closed

getStatus() returns FileNotFoundError #2

Bhupesh-V opened this issue Nov 24, 2019 · 0 comments · Fixed by #3
Assignees
Labels
bug Something isn't working

Comments

@Bhupesh-V
Copy link
Collaborator

Describe the bug
If you run getStatus() more than one time then a FileNot Found Error Occurs.

Status : Wrong Answer
Traceback (most recent call last):
  File "demo.py", line 12, in <module>
    if r.getStatus() == "Wrong Answer":
  File "/home/bhupesh/Desktop/CodeRunner/coderunner/coderunner.py", line 159, in getStatus
    self.inp = self.__readStandardInput()
  File "/home/bhupesh/Desktop/CodeRunner/coderunner/coderunner.py", line 81, in __readStandardInput
    with open(self.inp, "r") as out:
FileNotFoundError: [Errno 2] No such file or directory: 'World'

To Reproduce
Steps to reproduce the behavior:

  1. create an object instance & call getStatus 2 times
r = coderunner.Run(program_name, language, output, Input, path=True)

print("Status : " + r.getStatus())
if r.getStatus() == "Wrong Answer":
	print("Wrong Boi")

Expected behavior
getStatus should return the status every time we call it.

Additional context
The reason it is happening is because getStatus() is actually submitting data twice to the judge server.

@Bhupesh-V Bhupesh-V added the bug Something isn't working label Nov 24, 2019
@Bhupesh-V Bhupesh-V added this to To do in v0.5 Release Nov 25, 2019
Bhupesh-V added a commit that referenced this issue Dec 18, 2019
- wrote 4 new tests
- seggregated I/O of test programs
- partially fixes #2
@Bhupesh-V Bhupesh-V self-assigned this Dec 19, 2019
@Bhupesh-V Bhupesh-V moved this from To do to Done in v0.5 Release Dec 19, 2019
@Bhupesh-V Bhupesh-V mentioned this issue Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
v0.5 Release
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant