Skip to content

Warnings when running s3cmd 2.4.0 on Python 3.12 (Linux Mint22.2/Ubuntu) #1431

@rustlegit

Description

@rustlegit

(Note I am not a regular user of Github - this was written by ChatGPT but seems to me to describe the issue, I am in the process of upgrading to Linux Mint 22.2 which now uses a newer version of Python)

Environment

  • Linux Mint 22.2 (based on Ubuntu 24.04)
  • Python 3.12.7
  • s3cmd 2.4.0-2 (installed from Mint/Ubuntu repository)

Observed behavior
Running s3cmd produces multiple warnings:

/usr/local/bin/s3cmd:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').run_script('s3cmd==2.4.0', 's3cmd')
/usr/local/lib/python3.12/dist-packages/s3cmd-2.4.0-py3.12.egg/S3/S3Uri.py:122: SyntaxWarning: invalid escape sequence '.'
/usr/local/lib/python3.12/dist-packages/s3cmd-2.4.0-py3.12.egg/S3/S3Uri.py:170: SyntaxWarning: invalid escape sequence '\w'
/usr/local/lib/python3.12/dist-packages/s3cmd-2.4.0-py3.12.egg/S3/FileLists.py:525: SyntaxWarning: invalid escape sequence '*'

Expected behavior
No warnings should be emitted during normal usage.

Notes

  • These warnings appear only after upgrading to Python 3.12 (they were not present with Python 3.11).
  • The pkg_resources warning comes from the entry point script using pkg_resources.run_script().
  • The SyntaxWarnings are due to regex strings written as "\\.", "\\w", "\\*" instead of raw strings (r"\.", etc.).

Suggested fix

  • Update regex patterns to use raw strings.
  • Replace pkg_resources.run_script() with modern setuptools entry points or direct imports.

Related reports

  • Issue Cannot run with python 3.12 on macOS sonoma #1343: "Cannot run with Python 3.12 on macOS Sonoma" (runtime errors, not warnings).
  • Homebrew issue #152280: mentions s3cmd packaging problems with Python 3.12.
  • No pull requests currently address these warnings.

Impact
Functionality is not broken, but the warnings are noisy and may confuse users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions