You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The File object's readat and writeat function could not use long parameters.
The problems are as followed:
User traceback:
Exception (with type 'exceptions.OverflowError'): Python int too large to convert to C long
The test file is as followed:
if "test.txt" in listfiles():
removefile("test.txt")
myfile=openfile("test.txt",True) #Open a file
myfile.writeat("1234", 0)
data = myfile.readat(2**32, 0)
myfile.close()
It seems it should allow long type in all the functions including setmaxfilesize, writeat, readat.
# The code here sets up type checking and variable hiding for you. You should not need to change anything below here.
sec_file_def = {"obj-type":SecureFile,
"name":"SecureFile",
"setmaxfilesize":{"type":"func","args":(int,long, type(None)),"exceptions":Exception,"return":(type(None)),"target":SecureFile.setmaxfilesize},
"writeat":{"type":"func","args":(str,(int,long)),"exceptions":Exception,"return":(int,type(None)),"target":SecureFile.writeat},
"readat":{"type":"func","args":((int,long,type(None)),(int,long)),"exceptions":Exception,"return":str,"target":SecureFile.readat},
"close":{"type":"func","args":None,"exceptions":None,"return":(bool,type(None)),"target":SecureFile.close}
}
The text was updated successfully, but these errors were encountered:
The File object's readat and writeat function could not use long parameters.
The problems are as followed:
User traceback:
Exception (with type 'exceptions.OverflowError'): Python int too large to convert to C long
The test file is as followed:
However from the file https://github.com/SeattleTestbed/docs/blob/master/EducationalAssignments/SetMaxFileSizePartOne.md#building-the-security-layer
It seems it should allow long type in all the functions including setmaxfilesize, writeat, readat.
The text was updated successfully, but these errors were encountered: