Package: itstool
Version: 2.0.6-2
Severity: normal
X-Debbugs-Cc: scho...@ubuntu.com

Hi,

Since the transition to Python 3.12, it now emits SyntaxWarnings when
using unknown escape sequences, which typically happens on regexps.
itstool is impacted in its default path:

❯ itstool
/usr/bin/itstool:239: SyntaxWarning: invalid escape sequence '\s'
  if re.sub('\s+', ' ', text).strip() != '':
/usr/bin/itstool:337: SyntaxWarning: invalid escape sequence '\s'
  message = re.sub('\s+', ' ', message).strip()
/usr/bin/itstool:475: SyntaxWarning: invalid escape sequence '\s'
  return re.sub('\s+', ' ', self.locnote).strip()
/usr/bin/itstool:477: SyntaxWarning: invalid escape sequence '\s'
  return '(itstool) link: ' + re.sub('\s+', ' ', self.locnoteref).strip()
/usr/bin/itstool:891: SyntaxWarning: invalid escape sequence '\<'
  regex = re.compile('(.*) \<(.*)\>, (.*)')
/usr/bin/itstool:926: SyntaxWarning: invalid escape sequence '\s'
  if re.sub('\s+', '', prevtext) == '':
/usr/bin/itstool:1452: SyntaxWarning: invalid escape sequence '\.'
  _locale_pattern = 
re.compile('([a-zA-Z0-9-]+)(_[A-Za-z0-9]+)?(@[A-Za-z0-9]+)?(\.[A-Za-z0-9]+)?')
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-05-22 17:25+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <l...@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

This has been reported both upstream and in Launchpad, but it seems that
upstream is somewhat unresponsive, so I think the patch posted in
https://github.com/itstool/itstool/pull/51 should be carried in Debian,
even just to reduce the amount of noise in build logs :)

I'll be posting a Salsa MR to that effect shortly.

-- System Information:
Debian Release: trixie/sid
  APT prefers noble-updates
  APT policy: (500, 'noble-updates'), (500, 'noble-security'), (500, 'noble')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.8.0-31-generic (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_USER, TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages itstool depends on:
ii  python3          3.12.3-0ubuntu1
ii  python3-libxml2  2.9.14+dfsg-1.3ubuntu3

itstool recommends no packages.

itstool suggests no packages.

-- no debconf information

Reply via email to