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
This extends the existing implementation for detecting
bad file permissions to account for calls to pathlib
module functions in addition to those from the os module.
The pathlib chmod and lchmod functions are really just
wrappers around the os module equivalents. However, since
they are class methods, the pre-existing logic in the
code did not consider the corresponding pathlib function calls.
Note that the filename is not easily parsable in the case of pathlib.
ClosesPyCQA#1042
This extends the existing implementation for detecting
bad file permissions to account for calls to pathlib
module functions in addition to those from the os module.
The pathlib chmod and lchmod functions are really just
wrappers around the os module equivalents. However, since
they are class methods, the pre-existing logic in the
code did not consider the corresponding pathlib function calls.
Note that the filename is not easily parsable in the case of pathlib.
ResolvesPyCQA#1042
The current implementation of B103: set_bad_file_permissions works well for uses of the chmod functions from the
os
module directly.It fails to report insecure permissions when the equivalent functions from the
pathlib
module are being used instead.As a simple example, consider:
This should trigger an equivalent warning just as
os.chmod("dummy_file", 0o666)
currently does.The code should be generalized to support the
pathlib
version of the chmod functions as well.The text was updated successfully, but these errors were encountered: