-
Notifications
You must be signed in to change notification settings - Fork 53
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
Begin development for Python 3 #143
base: master
Are you sure you want to change the base?
Conversation
Fixed one python2 syntax error in the new repy version.
Fix a bug such that students couldn't use FileInUseError in their code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of little comments. I had a lot of thoughts that I could have applied over and over but just flagged the first instance...
|
||
# Store a file handle | ||
# Always open in mode r+b, this avoids Windows text-mode | ||
# quirks, and allows reading and writing | ||
self.fobj = safe_open(self.abs_filename, "r+b") | ||
self.fobj = open(self.abs_filename, "r+") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This almost certainly breaks the security of the system.
@@ -336,7 +336,7 @@ def close(self): | |||
OPEN_FILES_LOCK.acquire() | |||
|
|||
# Tell nanny we're gone. | |||
nanny.tattle_remove_item('filesopened', self.abs_filename) | |||
#nanny.tattle_remove_item('filesopened', self.abs_filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the nanny call removals are also likely a security concern.
@@ -386,7 +386,7 @@ def readat(self,sizelimit,offset): | |||
end of the file, or if the sizelimit was 0. | |||
""" | |||
# Check the arguments | |||
if sizelimit < 0 and sizelimit != None: | |||
if sizelimit != None and sizelimit < 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this edit?
@@ -464,6 +464,7 @@ def writeat(self,data,offset): | |||
raise RepyArgumentError("Negative read offset speficied!") | |||
if type(data) is not str: | |||
raise RepyArgumentError("Data must be specified as a string!") | |||
#data = data.encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should likely be removed.
#data = data.encode('utf-8') |
@@ -26,7 +26,7 @@ | |||
import nonportable # for getruntime | |||
import harshexit # for harshexit() | |||
import threading # for Lock() | |||
import thread # to catch thread.error | |||
import _thread as thread # to catch thread.error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
@@ -1,4 +1,5 @@ | |||
""" | |||
irint(str(newcontext)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug?
@@ -48,3 +48,4 @@ | |||
"169.229.131.81", # Berkley | |||
"140.142.12.202"] # Univ. of Washington | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -82,31 +82,32 @@ | |||
import sys # This is to get sys.executable to launch the external process | |||
import time # This is to sleep | |||
|
|||
# Currently required to filter out Android-specific debug messages, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole module will need to be rethought most likely.
https://github.com/SeattleTestbed/affix ../DEPENDENCIES/affix | ||
https://github.com/SeattleTestbed/common ../DEPENDENCIES/common | ||
https://github.com/SeattleTestbed/utf ../DEPENDENCIES/utf | ||
https://github.com/kcg295/seattlelib_v2 ../DEPENDENCIES/seattlelib_v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to be changed. Likely should be a parameter...
# see SeattleTestbed/repy_v1#120. | ||
# This causes tracebacks to have an inaccurate line number, so we adjust | ||
# them in multiple modules. See SeattleTestbed/repy_v2#95. | ||
code = encoding_header.ENCODING_DECLARATION + code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This likely needs to be retained for security reasons.
This pull request begins development for a Python 3 port of repy. It is an incomplete port, so I recommend it be merged into a new branch so development can continue.
This port was motivated by porting assignments using repy to python 3. As such, not every feature of repy was ported, and many were knowingly removed. This will need to be fixed for a complete port.