Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 removes the codeset parameter from gettext.translation #38

Open
Tracked by #39
poya-dev opened this issue Feb 15, 2024 · 3 comments
Open
Tracked by #39
Assignees

Comments

@poya-dev
Copy link

poya-dev commented Feb 15, 2024

When executing the aptsources-cleanup it gets the below traceback errors:

Traceback (most recent call last):
  File "/home/poya/Downloads/cleanup/aptsources-cleanup-0.1.7.5.2/./aptsources-cleanup", line 9, in <module>
    runpy.run_module('aptsources_cleanup', run_name='__main__')
  File "<frozen runpy>", line 229, in run_module
  File "<frozen runpy>", line 88, in _run_code
  File "/home/poya/Downloads/cleanup/aptsources-cleanup-0.1.7.5.2/src/aptsources_cleanup/__main__.py", line 386, in <module>
    rv = main()
         ^^^^^^
  File "/home/poya/Downloads/cleanup/aptsources-cleanup-0.1.7.5.2/src/aptsources_cleanup/__main__.py", line 35, in main
    args = parse_args(args)
           ^^^^^^^^^^^^^^^^
  File "/home/poya/Downloads/cleanup/aptsources-cleanup-0.1.7.5.2/src/aptsources_cleanup/__main__.py", line 199, in parse_args
    translations.add_fallback(
  File "/home/poya/Downloads/cleanup/aptsources-cleanup-0.1.7.5.2/src/aptsources_cleanup/util/functools.py", line 144, in <lambda>
    return lambda *args: getter(self._get_instance())(*args)
                                ^^^^^^^^^^^^^^^^^^^^
  File "/home/poya/Downloads/cleanup/aptsources-cleanup-0.1.7.5.2/src/aptsources_cleanup/util/functools.py", line 98, in _get_instance
    self._li_instance = self._li_factory()
                        ^^^^^^^^^^^^^^^^^^
  File "/home/poya/Downloads/cleanup/aptsources-cleanup-0.1.7.5.2/src/aptsources_cleanup/util/gettext.py", line 137, in _make_translations
    translations = translation('messages', get_localedir(), fallback=True)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/poya/Downloads/cleanup/aptsources-cleanup-0.1.7.5.2/src/aptsources_cleanup/util/gettext.py", line 99, in translation
    return _gettext.translation(
           ^^^^^^^^^^^^^^^^^^^^^
TypeError: translation() takes from 1 to 5 positional arguments but 6 were given
@davidfoerster davidfoerster changed the title Traceback Error Python 3.11 removes the codeset parameter from gettext.translation Feb 15, 2024
@davidfoerster
Copy link
Owner

davidfoerster commented Feb 15, 2024

I see that Python 3.11 removed the codeset parameter from gettext.translation. Luckily, we don’t use that anywhere, so I’ll simply remove it. I’ll push that in a moment.

@davidfoerster
Copy link
Owner

davidfoerster commented Feb 15, 2024

Do you know how to use Git? Could you please try out #39? (see Usage: from source if you don’t know how)

@davidfoerster davidfoerster self-assigned this Feb 15, 2024
@Fandyfr
Copy link

Fandyfr commented May 5, 2024

bro, install with

wget https://github.com/davidfoerster/aptsources-cleanup/releases/download/v0.1.7.5.2/aptsources-cleanup.pyz

at I work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants