fix bug
This commit is contained in:
@@ -210,7 +210,7 @@ class DiskOperations:
|
||||
else:
|
||||
messagebox.showerror("错误", f"挂载设备 {device_path} 失败。\n\n"
|
||||
f"普通挂载和 ntfs-3g 挂载均失败。\n"
|
||||
f"如果是 NTFS 文件系统损坏,请先使用文件系统工具中的 "修复文件系统 (ntfsfix)" 修复。")
|
||||
"如果是 NTFS 文件系统损坏,请先使用文件系统工具中的 '修复文件系统 (ntfsfix)' 修复。")
|
||||
return False
|
||||
else:
|
||||
messagebox.showerror("错误", f"挂载设备 {device_path} 失败: {stderr}")
|
||||
@@ -308,11 +308,11 @@ class DiskOperations:
|
||||
success_check, stdout_check, stderr_check = self._execute_shell_command(
|
||||
["parted", "-s", disk_path, "print"],
|
||||
f"检查磁盘 {disk_path} 分区表失败",
|
||||
suppress_critical_dialog_on_stderr_match=("无法辨识的磁盘卷标", "unrecognized disk label"),
|
||||
suppress_critical_dialog_on_stderr_match=("无法辨识的磁盘卷标", "unrecognised disk label"),
|
||||
root_privilege=True
|
||||
)
|
||||
if not success_check:
|
||||
if any(s in stderr_check for s in ("无法辨识的磁盘卷标", "unrecognized disk label")):
|
||||
if any(s in stderr_check for s in ("无法辨识的磁盘卷标", "unrecognised disk label")):
|
||||
logger.info(f"磁盘 {disk_path} 没有可识别的分区表。")
|
||||
has_partition_table = False
|
||||
else:
|
||||
@@ -538,7 +538,7 @@ class DiskOperations:
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["losetup", "-a"],
|
||||
capture_output=True, text=True, check=False
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8', check=False
|
||||
)
|
||||
if result.returncode == 0:
|
||||
for line in result.stdout.splitlines():
|
||||
|
||||
Reference in New Issue
Block a user