[Bug 2069994] Re: Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]: No closing quotation

Xu Zhen 2069994 at bugs.launchpad.net
Sat Jul 27 05:47:18 UTC 2024


If the output of blkid has a backslash character at the end of the
LABEL/PARTLABEL part, this problem will occur.

For example, if you run

e2label /dev/sdaX $'\xe5\xb7\xa5\xe4\xbd\x9c'

to set the label of a partition to "工作" (which means "work" in English),
blkid will output something like this:

/dev/sdaX: LABEL="M-eM-7M-%M-dM-=M-^\"
UUID="97711aa1-0cf2-4b7a-a56e-c957d6e82701" BLOCK_SIZE="4096"
TYPE="ext4" PARTUUID="efdaf75d-03"

The shlex module in Python will fail when parsing the output of blkid

$ python3
Python 3.12.4 (main, Jun 27 2024, 13:53:59) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shlex
>>> shlex.split('LABEL="M-eM-7M-%M-dM-=M-^\\"')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.12/shlex.py", line 313, in split
    return list(lex)
           ^^^^^^^^^
  File "/usr/lib/python3.12/shlex.py", line 300, in __next__
    token = self.get_token()
            ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/shlex.py", line 109, in get_token
    raw = self.read_token()
          ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/shlex.py", line 191, in read_token
    raise ValueError("No closing quotation")
ValueError: No closing quotation


** Changed in: ubuntu-desktop-provision
       Status: Incomplete => Confirmed

** Also affects: curtin
   Importance: Undecided
       Status: New

** Changed in: curtin
       Status: New => Confirmed

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

Title:
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:         No closing
  quotation

Status in curtin:
  Confirmed
Status in subiquity:
  Incomplete
Status in ubuntu-desktop-provision:
  Confirmed

Bug description:
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/lib/python3.10/site-packages/curtin/commands/main.py", line 202, in main
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             ret = args.func(args)
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 2224, in curthooks
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             builtin_curthooks(cfg, target, state)
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 2100, in builtin_curthooks
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             detect_and_handle_multipath(cfg, target, osfamily=osfamily)
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 1106, in detect_and_handle_multipath
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             mp_device = block.detect_multipath(target)
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/lib/python3.10/site-packages/curtin/block/__init__.py", line 685, in detect_multipath
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             return _legacy_detect_multipath(target_mountpoint)
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/lib/python3.10/site-packages/curtin/block/__init__.py", line 590, in _legacy_detect_multipath
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             binfo = blkid(cache=False)
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/lib/python3.10/site-packages/curtin/block/__init__.py", line 565, in blkid
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             for tok in util.shlex_split(curdata))
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/lib/python3.10/site-packages/curtin/util.py", line 1385, in shlex_split
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             return shlex.split(str_in)
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/usr/lib/python3.10/shlex.py", line 315, in split
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             return list(lex)
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/usr/lib/python3.10/shlex.py", line 300, in __next__
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             token = self.get_token()
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/usr/lib/python3.10/shlex.py", line 109, in get_token
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             raw = self.read_token()
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:           File "/snap/ubuntu-desktop-bootstrap/205/usr/lib/python3.10/shlex.py", line 191, in read_token
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:             raise ValueError("No closing quotation")
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:         ValueError: No closing quotation
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:         No closing quotation
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]:         
  Jun 21 14:06:35 ubuntu subiquity_log.7400[13454]: Stderr: ''
  Jun 21 14:06:36 ubuntu subiquity_event.7400[7400]:   curtin command install

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




More information about the foundations-bugs mailing list