Python exception when attempting to write to full device

Bug #325375 reported by Loïc Minier
2
Affects Status Importance Assigned to Milestone
usb-creator (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi,

I formatted a device directly with mkfs.vfat (mkfs.vfat -I /dev/sdc) and usb-creator was happy to try to write to that, but it then failed with:
[17:15:51] Source CD: /home/lool/isos/ubuntu/cdimage/daily-live/current/jaunty-desktop-i386.iso
[17:15:51] Destination disk: /dev/sdc
[17:15:51] Persistence size: 1432109056 MB
[17:15:52] Traceback (most recent call last):
[17:15:52] File "/usr/lib/python2.5/site-packages/usbcreator/gtk_frontend.py", line 476, in install
[17:15:52] self.backend.install_bootloader()
[17:15:52] File "/usr/lib/python2.5/site-packages/usbcreator/backend.py", line 457, in install_bootloader
[17:15:52] num = re.match('.*([0-9]+)$', tmp).groups()[0]
[17:15:52] AttributeError: 'NoneType' object has no attribute 'groups'

The fix to avoid the exception and usb-creator hanging seems simple enough, changing:
        num = re.match('.*([0-9]+)$', tmp).groups()[0]
to:
        match = re.match('.*([0-9]+)$', tmp)
        num = None
        if match:
            num = match.groups()[0]

is enough to properly get a popup that partition number detection failed; of course it would be better to be able to proceed, but there's probably a reason why it's not allowed.

Cheers

Related branches

Revision history for this message
Evan (ev) wrote :

The reason that it's not allowed is that, last I checked, HAL didn't report filesystems that spanned a disk, rather than a partition. I have, however, made your suggested change.

Changed in usb-creator:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package usb-creator - 0.1.12

---------------
usb-creator (0.1.12) jaunty; urgency=low

  [ Evan Dandrea ]
  * Correct grammatical typo in the GTK frontend (LP: #297569).
  * Depend on mcopy as syslinux only recommends it (LP: #296093).
  * Mark more strings for translation. Thanks István Nyitrai (LP: #310804).
  * Change the Debian maintainer to the Ubuntu Installer Team.
  * Work around a long standing GTK label bug by using a Python version of
  * libview's WrapLabel.
  * Fix nonsense 1 byte writes of the casper-rw ext3 loopback fs
    (LP: #313364).
  * Basic file copy error handling.
  * Sync the disk at the end of installation.
  * Better handle filesystem-on-disk in the bootloader installing code.
    Thanks Loïc Minier (LP: #325375)

  [ Jonathan Ernst ]
  * Menu entry should be named "USB startup disk creator" (LP: #286924)
  * Add French translation to desktop file

 -- Evan Dandrea <email address hidden> Wed, 18 Feb 2009 10:45:56 +0000

Changed in usb-creator:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.