Skip to content

Conversation

@myteron
Copy link
Contributor

@myteron myteron commented Mar 27, 2025

Trying to address issues reported in #835 , the excessive attack section might be to much but covers all boundaries I discovered.

@andrew-costello
Copy link
Contributor

I am reviewing this.

Copy link
Contributor

@andrew-costello andrew-costello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some typo's noticed, as well as some warnings with Pylint. Left some comments with the warnings, not sure if they are relevant in this case or not.

try:
result = get_datetime(currtime, hours)
print(f"{hours} OK, datetime='{result}'")
except Exception as exception:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am getting this error in Pylint, saying that the exception is too general:

Catching too general exception ExceptionPylintW0718:broad-exception-caught

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attack section is not expected to be clean

try:
result = get_datetime(currtime, hours)
print(f"{hours} OK, datetime='{result}'")
except Exception as exception:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again with the general exception warning, not sure if it is relevant a I believe you want to catch all exceptions:

Catching too general exception ExceptionPylintW0718:broad-exception-caught

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the attack section does not require to be 'compliant' so won't change this.

Copy link
Contributor

@andrew-costello andrew-costello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, +1.

@myteron myteron merged commit 3d932d8 into ossf:main May 19, 2025
2 checks passed
@myteron myteron deleted the pySCG_CWE-191-bugfix branch May 19, 2025 13:13
@myteron myteron moved this from Backlog to Done in Python Secure Coding Guide Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants