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

Control characters are not supported in XML 1.0 #9893

Closed
2 tasks done
tcitworld opened this issue Sep 8, 2023 · 2 comments
Closed
2 tasks done

Control characters are not supported in XML 1.0 #9893

tcitworld opened this issue Sep 8, 2023 · 2 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@tcitworld
Copy link

tcitworld commented Sep 8, 2023

Describe the issue

Errors generating RSS feeds.

I already tried

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

Steps to reproduce the behavior

Somone accesses an RSS feed endpoint which doesn't seem to be documented according to: https://docs.weblate.org/en/weblate-5.0/api.html#rss-feeds

This one generates an error: https://weblate.framasoft.org/exports/rss/mobilizon/backend-errors/en/265973/
This one works properly: https://weblate.framasoft.org/exports/rss/mobilizon/backend-errors/en/

Issue at Sentry: https://sentry.mobilizon.org/share/issue/19a93cbf78da43d998afffff32bfcd7d/

Expected behavior

If the endpoint is indeed non existing, just 404 instead of error.

Screenshots

No response

Exception traceback

Traceback (most recent call last):
  File "/var/www/weblate/weblate-env/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/var/www/weblate/weblate-env/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/var/www/weblate/weblate-env/lib/python3.9/site-packages/sentry_sdk/integrations/django/views.py", line 84, in sentry_wrapped_callback
    return callback(request, *args, **kwargs)
  File "/var/www/weblate/weblate-env/lib/python3.9/site-packages/django/contrib/syndication/views.py", line 48, in __call__
    feedgen.write(response, "utf-8")
  File "/var/www/weblate/weblate-env/lib/python3.9/site-packages/django/utils/feedgenerator.py", line 232, in write
    self.add_root_elements(handler)
  File "/var/www/weblate/weblate-env/lib/python3.9/site-packages/django/utils/feedgenerator.py", line 250, in add_root_elements
    handler.addQuickElement("title", self.feed["title"])
  File "/var/www/weblate/weblate-env/lib/python3.9/site-packages/django/utils/xmlutils.py", line 20, in addQuickElement
    self.characters(contents)
  File "/var/www/weblate/weblate-env/lib/python3.9/site-packages/django/utils/xmlutils.py", line 27, in characters
    raise UnserializableContentError(

Exception Type: UnserializableContentError at /exports/rss/mobilizon/backend-errors/en/265973/
Exception Value: Control characters are not supported in XML 1.0
Raised during: weblate.trans.feeds.TranslationChangesFeed

How do you run Weblate?

PyPI module

Weblate versions

  • Weblate: 5.0
  • Django: 4.2.2
  • siphashc: 2.1
  • translate-toolkit: 3.10.0
  • lxml: 4.9.1
  • Pillow: 9.1.0
  • nh3: 0.2.8
  • python-dateutil: 2.8.2
  • social-auth-core: 4.3.0
  • social-auth-app-django: 5.0.0
  • django-crispy-forms: 2.0
  • oauthlib: 3.1.1
  • django-compressor: 4.3.1
  • djangorestframework: 3.14.0
  • django-filter: 21.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.12.2
  • rapidfuzz: 2.6.0
  • openpyxl: 3.0.9
  • celery: 5.2.3
  • django-celery-beat: 2.5.0
  • kombu: 5.2.3
  • translation-finder: 2.15
  • weblate-language-data: 2022.7
  • html2text: 2020.1.16
  • pycairo: 1.20.1
  • PyGObject: 3.42.0
  • diff-match-patch: 20230430
  • requests: 2.31.0
  • django-redis: 5.2.0
  • hiredis: 2.0.0
  • sentry-sdk: 1.29.2
  • Cython: 0.29.26
  • misaka: 2.1.1
  • GitPython: 3.1.26
  • borgbackup: 1.2.4
  • pyparsing: 3.1.1
  • pyahocorasick: 1.4.2
  • python-redis-lock: 4.0.0
  • charset-normalizer: 2.0.12
  • Python: 3.9.2
  • Git: 2.30.2
  • psycopg2-binary: 2.9.3
  • phply: 1.2.6
  • ruamel.yaml: 0.17.20
  • tesserocr: 2.6.1
  • boto3: 1.28.36
  • zeep: 4.1.0
  • aeidon: 1.10.1
  • iniparse: 0.5
  • Mercurial: 6.4.4
  • git-svn: 2.30.2
  • git-review: 2.2.0
  • PostgreSQL server: 13.11
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: localhost
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://localhost:6379, redis://localhost:6379, regular
  • Platform: Linux 5.10.0-25-amd64 (x86_64)

Weblate deploy checks

System check identified some issues:

INFOS:
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
	HINT: https://docs.weblate.org/fr/weblate-5.0/admin/backup.html

System check identified 1 issue (1 silenced).

Additional context

No response

@nijel nijel self-assigned this Sep 8, 2023
@nijel nijel added the bug Something is broken. label Sep 8, 2023
@nijel nijel added this to the 5.0.1 milestone Sep 8, 2023
@nijel
Copy link
Member

nijel commented Sep 8, 2023

Already fixed by 8a7718b.

@nijel nijel closed this as completed Sep 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

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.

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

No branches or pull requests

2 participants