From: "Joey Vagedes via groups.io" <joeyvagedes=microsoft.com@groups.io>
To: devel@edk2.groups.io
Cc: Liming Gao <gaoliming@byosoft.com.cn>,
Michael D Kinney <michael.d.kinney@intel.com>,
Sean Brogan <sean.brogan@microsoft.com>
Subject: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin: UncrustifyCheck: use stat instead of os.stat
Date: Mon, 22 Jan 2024 15:21:08 -0800 [thread overview]
Message-ID: <20240122232108.134-2-joey.vagedes@gmail.com> (raw)
In-Reply-To: <20240122232108.134-1-joey.vagedes@gmail.com>
The UncrustifyCheck plugin passes os.stat.S_IWRITE to os.chmod, when
attempting to change file permissions. os.stat.S_IWRITE does not exist
as os.stat is a function. The correct value is stat.S_IWRITE.
Signed-off-by: Joey Vagedes <joey.vagedes@gmail.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
---
.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
index 9aeef5a5a3..73dc03c0dc 100644
--- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
+++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
@@ -12,6 +12,7 @@ import logging
import os
import pathlib
import shutil
+import stat
import timeit
from edk2toolext.environment import version_aggregator
from edk2toolext.environment.plugin_manager import PluginManager
@@ -628,7 +629,7 @@ class UncrustifyCheck(ICiBuildPlugin):
"""
Private function to attempt to change permissions on file/folder being deleted.
"""
- os.chmod(path, os.stat.S_IWRITE)
+ os.chmod(path, stat.S_IWRITE)
func(path)
for _ in range(3): # retry up to 3 times
--
2.40.1.vfs.0.0
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114153): https://edk2.groups.io/g/devel/message/114153
Mute This Topic: https://groups.io/mt/103898982/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-01-22 23:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 23:21 [edk2-devel] [PATCH v1 0/1] UncrustifyCheck: use stat instead of os.stat Joey Vagedes via groups.io
2024-01-22 23:21 ` Joey Vagedes via groups.io [this message]
2024-01-22 23:25 ` [edk2-devel] [PATCH v1 1/1] .pytool/Plugin: " Michael D Kinney
2024-01-23 15:56 ` Joey Vagedes via groups.io
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240122232108.134-2-joey.vagedes@gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox