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
We reviewed changes in 9d1323c...6ad95cc on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
The reason will be displayed to describe this comment to others. Learn more.
Writing to file opened without write mode causes IOError
The f.write("config file.") operation is performed on a file that is likely opened without a write mode (w, a, or x). This causes an IOError since write operations require appropriate file opening modes. This prevents the file content from being updated as intended.
Open the file using a write mode like w to allow f.write() to succeed without errors and properly update file contents.
The reason will be displayed to describe this comment to others. Learn more.
Mutable default `moons` list causes shared state bugs
Using a mutable default value like the list assigned to the moons parameter means the same list object is reused on every function call. This can cause unexpected side effects when the list is modified, as changes persist across calls and affect all usages.
Replace the default list with None and inside the function assign a new list if the argument is None. This approach isolates each call with its own fresh list, avoiding shared state issues.
The reason will be displayed to describe this comment to others. Learn more.
Use of `os.tempnam()` allows symlink attack vulnerabilities
The code calls os.tempnam("dir1"), which generates a temporary filename vulnerable to symlink attacks. An attacker could replace the file with a symbolic link, leading to unauthorized file modification or data leaks.
Replace os.tempnam() with os.tmpfile() or the tempfile module which securely creates temporary files preventing symlink race conditions.
The reason will be displayed to describe this comment to others. Learn more.
Undefined `o` variable causes runtime error
The variable o is used to call system but is never defined or imported, which results in a runtime error preventing the command from executing. This stops the intended extraction operation from running properly.
Define or import the variable o properly before using it, commonly this is the os module for system calls or another appropriate context object.
BaseNumberGenerator.get_number raises NotImplemented, which is invalid for raise. This causes confusing TypeError behavior and obscures contract violations.
Replace with raise NotImplementedError() to signal unimplemented abstract behavior correctly.
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
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.
Copy of #104