Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent failure based on filename #66

Open
2 tasks done
NickSto opened this issue Jan 16, 2022 · 2 comments
Open
2 tasks done

Silent failure based on filename #66

NickSto opened this issue Jan 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@NickSto
Copy link

NickSto commented Jan 16, 2022

It looks like this has a similar issue to slacka/WoeUSB#206: The USB creation failed, then after I renamed the iso file, it succeeded.

Good Habit Checklist for Issue Reporting

  • I've searched the issue tracker and is pretty sure that there's no duplicate issue already filed
  • I've built the latest development snapshot using the instructions in README and verified that the issue can still be reproduced (for bug reports)

Issue Reproduce Instructions

  1. I installed the latest release (v0.2.10), which I see is also the latest development version.
  2. I launched it with /usr/local/bin/woeusbgui
  3. I selected my iso: a Windows 10 21H1 named Windows 10 [bits 64] [down 2021-07-14] [name Win10_21H1_English_x64].iso
  4. I selected my target device - a 7.4GB Kanguru USB drive
  5. I hit "Install"

Then I renamed the iso to its original filename (Win10_21H1_English_x64.iso) and tried again. It succeeded this time.

Expected Behavior

It actually installs the iso onto the USB drive

Current Behavior

It returns instantly with an installation succeeded message. But in the console it gives the traceback I pasted below.

Info of My Environment

WoeUSB Version

v0.2.10

WoeUSB Source

Installed from the release .tar.gz according to the README

  • using sudo python3 -m pip install .

Information about the Operating System

Ubuntu 20.04.3 LTS

Information about the Source Media

Windows 10 version 21H1

  • Win10_21H1_English_x64.iso
  • sha256sum: 6911e839448fa999b07c321fc70e7408fe122214f5c4e80a9ccc64d22d0d85ea

Information about the Target Device

Kanguru Flashblu 30 8GB

Traceback

$ /usr/local/bin/woeusbgui 
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/dist-packages/WoeUSB/gui.py", line 403, in run
    core.main(source_fs_mountpoint, target_fs_mountpoint, self.source, self.target, "device", temp_directory,
  File "/usr/local/lib/python3.8/dist-packages/WoeUSB/core.py", line 155, in main
    if utils.check_source_and_target_not_busy(install_mode, source_media, target_device, target_partition):
  File "/usr/local/lib/python3.8/dist-packages/WoeUSB/utils.py", line 151, in check_source_and_target_not_busy
    if check_is_target_device_busy(source_media):
  File "/usr/local/lib/python3.8/dist-packages/WoeUSB/utils.py", line 134, in check_is_target_device_busy
    if re.findall(device, mount) != []:
  File "/usr/lib/python3.8/re.py", line 241, in findall
    return _compile(pattern, flags).findall(string)
  File "/usr/lib/python3.8/re.py", line 304, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.8/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.8/sre_parse.py", line 948, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.8/sre_parse.py", line 443, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/usr/lib/python3.8/sre_parse.py", line 598, in _parse
    raise source.error(msg, len(this) + 1 + len(that))
re.error: bad character range 1-0 at position 55
@WaxyMocha
Copy link
Member

Huh, @jacobgkau, can you look at this? I'm not familiar with re so it might be easier for you to fix.

@NickSto
Copy link
Author

NickSto commented Feb 27, 2022

From a quick glance, it looks like it might be using the raw filename string as a regex in re.findall(). You're gonna run into some pain doing that, if the filename contains any special regex characters (there's a lot). If you're just trying to find it in the output of mount, that doesn't require regex at all. You could just do a simple substring in string search.

@WaxyMocha WaxyMocha added the bug Something isn't working label Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants