[Bug 2059414] [NEW] Syntax error on curtin/block/__init__.py#L317-L318

Cho Jaeho 2059414 at bugs.launchpad.net
Thu Mar 28 11:41:14 UTC 2024


Public bug reported:

There is a syntax error on 'curtin/block/__init__.py#L317-L318'
- https://github.com/canonical/curtin/blob/master/curtin/block/__init__.py#L317-L318

Python string interpolation is not working because of omitting of
parenthesis. As a result, it prints "TypeError: not enough arguments for
format string". but that is not what I expected. It should print
RuntimeError for "Device ~ not present in sfdisk dump ~".


Below is original one:
```
        raise RuntimeError('Device %s not present in sfdisk dump:\n%s' %
                           devpath, util.json_dumps(sfdisk_info))
```

It should be like this:
```
        raise RuntimeError('Device %s not present in sfdisk dump:\n%s' %
                           (devpath, util.json_dumps(sfdisk_info)))
```

** Affects: curtin
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to curtin.
https://bugs.launchpad.net/bugs/2059414

Title:
  Syntax error on curtin/block/__init__.py#L317-L318

Status in curtin:
  New

Bug description:
  There is a syntax error on 'curtin/block/__init__.py#L317-L318'
  - https://github.com/canonical/curtin/blob/master/curtin/block/__init__.py#L317-L318

  Python string interpolation is not working because of omitting of
  parenthesis. As a result, it prints "TypeError: not enough arguments
  for format string". but that is not what I expected. It should print
  RuntimeError for "Device ~ not present in sfdisk dump ~".

  
  Below is original one:
  ```
          raise RuntimeError('Device %s not present in sfdisk dump:\n%s' %
                             devpath, util.json_dumps(sfdisk_info))
  ```

  It should be like this:
  ```
          raise RuntimeError('Device %s not present in sfdisk dump:\n%s' %
                             (devpath, util.json_dumps(sfdisk_info)))
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/2059414/+subscriptions




More information about the foundations-bugs mailing list