Skip to content

getStatus() returns FileNotFoundErrorΒ #2

@Bhupesh-V

Description

@Bhupesh-V

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions