Open
Conversation
Fixed one python2 syntax error in the new repy version.
Fix a bug such that students couldn't use FileInUseError in their code.
JustinCappos
reviewed
Feb 9, 2021
Contributor
JustinCappos
left a comment
There was a problem hiding this comment.
Lots of little comments. I had a lot of thoughts that I could have applied over and over but just flagged the first instance...
| # 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+") |
Contributor
There was a problem hiding this comment.
This almost certainly breaks the security of the system.
|
|
||
| # Tell nanny we're gone. | ||
| nanny.tattle_remove_item('filesopened', self.abs_filename) | ||
| #nanny.tattle_remove_item('filesopened', self.abs_filename) |
Contributor
There was a problem hiding this comment.
the nanny call removals are also likely a security concern.
| """ | ||
| # Check the arguments | ||
| if sizelimit < 0 and sizelimit != None: | ||
| if sizelimit != None and sizelimit < 0: |
| 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') |
Contributor
There was a problem hiding this comment.
Should likely be removed.
Suggested change
| #data = data.encode('utf-8') |
| import harshexit # for harshexit() | ||
| import threading # for Lock() | ||
| import thread # to catch thread.error | ||
| import _thread as thread # to catch thread.error |
| @@ -1,4 +1,5 @@ | |||
| """ | |||
| irint(str(newcontext)) | |||
| "169.229.131.81", # Berkley | ||
| "140.142.12.202"] # Univ. of Washington | ||
|
|
||
|
|
| 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, |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
This likely needs to be retained for security reasons.
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.