SyntaxWarning: invalid escape sequence '\.'

Bug #2059412 reported by Nathan Teodosio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Wishlist
Nathan Teodosio

Bug Description

Installing software-properties gives

--->
/usr/lib/python3/dist-packages/softwareproperties/gtk/DialogMirror.py:197: SyntaxWarning: invalid escape sequence '\.'
  elif re.match("^((ftp)|(http)|(file)|(rsync)|(https))://([a-z]|[A-Z]|[0-9]|:|/|\.|~)+$", uri) == None:
<---

Marked as "wishlist" importance because Python still passes that to re.match as '\.' instead of '.', so the behavior is correct, as can be confirmed with

--->
% python3 -c 'print("\.")'
<string>:1: SyntaxWarning: invalid escape sequence '\.'
\.
<---

In a future Python version they will be eventually a SyntaxError[1].

[1] https://docs.python.org/3/reference/lexical_analysis.html#escape-sequences

Related branches

description: updated
description: updated
Nick Rosbrook (enr0n)
Changed in software-properties (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.99.48

---------------
software-properties (0.99.48) noble; urgency=medium

  * Fix Python's warning of invalid escape sequence (LP: #2059412).
  * Make pressing enter on close button of out-of-date cache dialog trigger
    the close button, not the reload button (LP: #2061978).
  * Limit the comments in 'other software' tab to a single line (LP: #2060915).
  * apt-add-repository --list now displays deb822 sources (LP: #2060331).

 -- Nathan Pratta Teodosio <email address hidden> Thu, 18 Apr 2024 09:17:51 +0200

Changed in software-properties (Ubuntu):
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.