SystemError: E:Syntax error /etc/apt/apt.conf.d/50unattended-upgrades:14: Malformed tag

I’m building a snap using snapcraft 3.9.8 / multipass 1.0.2. It fails with:

SystemError: E:Syntax error /etc/apt/apt.conf.d/50unattended-upgrades:14: Malformed tag

Is there a bug in the image being used or is snapcraft at fault trying to manipulate / disable unattended-upgrades?

Here’s the full output:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/snap/snapcraft/3970/lib/python3.6/site-packages/snapcraft/__init__.py", line 343, in <module>
    from snapcraft._store import (  # noqa
  File "/snap/snapcraft/3970/lib/python3.6/site-packages/snapcraft/_store.py", line 36, in <module>
    from snapcraft.internal import cache, deltas, repo
  File "/snap/snapcraft/3970/lib/python3.6/site-packages/snapcraft/internal/repo/__init__.py", line 31, in <module>
    from ._deb import Ubuntu  # noqa
  File "/snap/snapcraft/3970/lib/python3.6/site-packages/snapcraft/internal/repo/_deb.py", line 33, in <module>
    import apt
  File "/snap/snapcraft/3970/lib/python3.6/site-packages/apt/__init__.py", line 34, in <module>
    apt_pkg.init_config()
SystemError: E:Syntax error /etc/apt/apt.conf.d/50unattended-upgrades:14: Malformed tag

To reproduce, clone https://github.com/popey/ephemeral-snap/ and ninja the source-tag to 6.3.0. It will fail (fails for me and @bashfulrobot)

Here is the offending line:

"UbuntuESMApps:bionic-apps-security"";

We are currently not disabling unattended upgrades, we will look into this.