hpc / charliecloud

Now hosted on GitLab.
https://gitlab.com/charliecloud/main
Apache License 2.0
312 stars 60 forks source link

`ch-image build` issues syntax warnings with Python 3.12 #1834

Closed wiene closed 9 months ago

wiene commented 9 months ago

Running ch-image build on a system using Charliecloud 0.36 and Python 3.12 one gets the following syntax warnings:

/usr/lib/charliecloud/build_cache.py:910: SyntaxWarning: invalid escape sequence '\g'
  "#\g<0>", text, flags=re.MULTILINE)
/usr/lib/charliecloud/force.py:187: SyntaxWarning: invalid escape sequence '\['
  "if ! grep -Eq '\[epel\]' /etc/yum.conf /etc/yum.repos.d/*; then "
/usr/lib/charliecloud/force.py:202: SyntaxWarning: invalid escape sequence '\['
  "if ! grep -Eq '\[epel\]' /etc/yum.conf /etc/yum.repos.d/*; then "

This issue was initially reported in Debian bug 1063467.

reidpr commented 9 months ago

I can reproduce with Python 3.12.2 built from upstream sources:

$ python3 --version
Python 3.12.2
$ ch-image --version
/home/reidpr/charliecloud/bin/../lib/build_cache.py:910: SyntaxWarning: invalid escape sequence '\g'
  "#\g<0>", text, flags=re.MULTILINE)
/home/reidpr/charliecloud/bin/../lib/force.py:187: SyntaxWarning: invalid escape sequence '\['
  "if ! grep -Eq '\[epel\]' /etc/yum.conf /etc/yum.repos.d/*; then "
/home/reidpr/charliecloud/bin/../lib/force.py:202: SyntaxWarning: invalid escape sequence '\['
  "if ! grep -Eq '\[epel\]' /etc/yum.conf /etc/yum.repos.d/*; then "
0.37~pre+0ff0c5c