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

Error while pushing to remote #8214

Closed
2 tasks done
ShockedPlot7560 opened this issue Oct 14, 2022 · 11 comments
Closed
2 tasks done

Error while pushing to remote #8214

ShockedPlot7560 opened this issue Oct 14, 2022 · 11 comments
Assignees
Labels
bug Something is broken. translate-toolkit Issues which need to be fixed in the translate-toolkit

Comments

@ShockedPlot7560
Copy link

Describe the issue

The following error appears

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Create project
  2. Create component from blank
  3. Create string translation
  4. Push changes

Expected behavior

Work normally

Screenshots

image

Exception traceback

Environment:


Request Method: POST
Request URL: https://domain.com/translate/plutonium-mcpe/faction/fr/?&offset=3

Django Version: 4.1.1
Python Version: 3.10.7
Installed Applications:
['customize',
 'weblate.addons',
 'weblate.auth',
 'weblate.checks',
 'weblate.formats',
 'weblate.glossary',
 'weblate.machinery',
 'weblate.trans',
 'weblate.lang',
 'weblate_language_data',
 'weblate.memory',
 'weblate.screenshots',
 'weblate.fonts',
 'weblate.accounts',
 'weblate.configuration',
 'weblate.utils',
 'weblate.vcs',
 'weblate.wladmin',
 'weblate.metrics',
 'weblate',
 'weblate.gitexport',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin.apps.SimpleAdminConfig',
 'django.contrib.admindocs',
 'django.contrib.sitemaps',
 'django.contrib.humanize',
 'social_django',
 'crispy_forms',
 'compressor',
 'rest_framework',
 'rest_framework.authtoken',
 'django_filters']
Installed Middleware:
['weblate.middleware.RedirectMiddleware',
 'weblate.middleware.ProxyMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'weblate.accounts.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'social_django.middleware.SocialAuthExceptionMiddleware',
 'weblate.accounts.middleware.RequireLoginMiddleware',
 'weblate.api.middleware.ThrottlingMiddleware',
 'weblate.middleware.SecurityMiddleware']



Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/views/edit.py", line 611, in translate
    response = handle_translate(request, unit, this_unit_url, next_unit_url)
  File "/usr/local/lib/python3.10/site-packages/weblate/utils/ratelimit.py", line 123, in rate_wrap
    return function(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/views/edit.py", line 422, in handle_translate
    go_next = perform_translation(unit, form, request)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/views/edit.py", line 332, in perform_translation
    saved = unit.translate(
  File "/usr/local/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/models/unit.py", line 1350, in translate
    saved = self.save_backend(
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/models/unit.py", line 958, in save_backend
    self.translation.commit_pending("pending unit", None)
  File "/usr/local/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/models/translation.py", line 573, in commit_pending
    return self.component.commit_pending(reason, user, skip_push=skip_push)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/models/component.py", line 166, in on_link_wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/models/component.py", line 1616, in commit_pending
    translation._commit_pending(reason, user)
  File "/usr/local/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/models/translation.py", line 613, in _commit_pending
    self.update_units(units, store, author_name, author.id)
  File "/usr/local/lib/python3.10/site-packages/weblate/trans/models/translation.py", line 781, in update_units
    store.save()
  File "/usr/local/lib/python3.10/site-packages/weblate/formats/ttkit.py", line 328, in save
    self.save_atomic(self.storefile, self.save_content)
  File "/usr/local/lib/python3.10/site-packages/weblate/formats/base.py", line 372, in save_atomic
    callback(temp)
  File "/usr/local/lib/python3.10/site-packages/weblate/formats/ttkit.py", line 324, in save_content
    self.store.serialize(handle)
  File "/usr/local/lib/python3.10/site-packages/translate/storage/ini.py", line 120, in serialize
    _outinifile[match.groupdict()["section"]][

Exception Type: AttributeError at /translate/plutonium-mcpe/faction/fr/
Exception Value: 'NoneType' object has no attribute 'groupdict'

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 4.14.1
  • Django: 4.1.1
  • siphashc: 2.1
  • translate-toolkit: 3.7.3
  • lxml: 4.9.1
  • Pillow: 9.2.0
  • bleach: 5.0.1
  • python-dateutil: 2.8.2
  • social-auth-core: 4.3.0
  • social-auth-app-django: 5.0.0
  • django-crispy-forms: 1.14.0
  • oauthlib: 3.2.1
  • django-compressor: 4.1
  • djangorestframework: 3.13.1
  • django-filter: 22.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.8.0
  • rapidfuzz: 2.8.0
  • openpyxl: 3.0.10
  • celery: 5.2.7
  • kombu: 5.2.4
  • translation-finder: 2.14
  • weblate-language-data: 2022.7
  • html2text: 2020.1.16
  • pycairo: 1.21.0
  • pygobject: 3.42.2
  • diff-match-patch: 20200713
  • requests: 2.28.1
  • django-redis: 5.2.0
  • hiredis: 2.0.0
  • sentry_sdk: 1.9.8
  • Cython: 0.29.32
  • misaka: 2.1.1
  • GitPython: 3.1.27
  • borgbackup: 1.2.2
  • pyparsing: 3.0.9
  • pyahocorasick: 1.4.4
  • python-redis-lock: 3.7.0
  • charset-normalizer: 2.1.1
  • Python: 3.10.7
  • Git: 2.30.2
  • psycopg2: 2.9.3
  • psycopg2-binary: 2.9.3
  • phply: 1.2.5
  • ruamel.yaml: 0.17.21
  • tesserocr: 2.5.2
  • boto3: 1.24.73
  • zeep: 4.1.0
  • aeidon: 1.11
  • iniparse: 0.5
  • mysqlclient: 2.1.1
  • Mercurial: 6.2.2
  • git-svn: 2.30.2
  • git-review: 2.3.1
  • Redis server: 6.2.7
  • PostgreSQL server: 14.5
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: mail.domain.com
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://cache:6379/1, redis://cache:6379/1, regular
  • Platform: Linux 5.4.0-105-generic (x86_64)

Weblate deploy checks

System check identified some issues:

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W018) You should not have DEBUG set to True in deployment.

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.14.1/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.14.1/admin/backup.html

System check identified 6 issues (1 silenced).

Additional context

No response

@ShockedPlot7560
Copy link
Author

ShockedPlot7560 commented Oct 14, 2022

The error:

AttributeError at /commit/plutonium-mcpe/faction/fr/
'NoneType' object has no attribute 'groupdict'

@github-actions
Copy link

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

@github-actions github-actions bot added the wontfix Nobody will work on this. label Oct 25, 2022
@nijel
Copy link
Member

nijel commented Oct 25, 2022

Can you please share the INI file you are translating? There seems to be some incompatibility in that.

@github-actions github-actions bot removed the wontfix Nobody will work on this. label Oct 26, 2022
@ShockedPlot7560
Copy link
Author

Can you please share the INI file you are translating? There seems to be some incompatibility in that.

I will send you that in the week

@ShockedPlot7560
Copy link
Author

The ini in the github repository is empty. I have add translation item directly in the interface. When I try to save data / push updates.

@nijel nijel added bug Something is broken. translate-toolkit Issues which need to be fixed in the translate-toolkit labels Nov 4, 2022
@nijel
Copy link
Member

nijel commented Nov 4, 2022

Ah, starting from an empty file might be the issue. Probably, the library we use for that does not cope with an empty file.

nijel added a commit to nijel/translate that referenced this issue Nov 4, 2022
- This now behaves same as JSON or YAML.
- Added tests and fixed some issues discovered by them.

See WeblateOrg/weblate#8214
@nijel
Copy link
Member

nijel commented Nov 4, 2022

The translate-toolkit side of the issue should be addressed by translate/translate#4749

@nijel nijel self-assigned this Nov 4, 2022
@nijel nijel closed this as completed Nov 4, 2022
@github-actions
Copy link

github-actions bot commented Nov 4, 2022

The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable).

@github-actions
Copy link

github-actions bot commented Nov 4, 2022

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

nijel added a commit to translate/translate that referenced this issue Nov 4, 2022
- This now behaves same as JSON or YAML.
- Added tests and fixed some issues discovered by them.

See WeblateOrg/weblate#8214
@ShockedPlot7560
Copy link
Author

ShockedPlot7560 commented Nov 5, 2022

How can i update my weblate to get last changes and say if this is completed ?

@nijel
Copy link
Member

nijel commented Nov 5, 2022

I want to release translate toolkit today (translate/translate#4750), once it's done it will appear in the Weblate Docker container (bleeding or edge) tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken. translate-toolkit Issues which need to be fixed in the translate-toolkit
Projects
None yet
Development

No branches or pull requests

2 participants