marshmallow-code / marshmallow-code/marshmallow
fields.Url ValidationError parsing internationalized domain name
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 738
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 7
Description
Description
The perfectly valid urls in the test case below are resolved correctly by most contemporary browsers (and – curiously – wget, but not curl), but do not pass marshmallows Url field validation. Which i think they should, because they do show up in real world data.
I'm not sure how to best approach the problem.
Test Case
"""Tests for marshmallow.validate"""
import pytest
from marshmallow import validate
@pytest.mark.parametrize(
"valid_url",
[
"http://www.kunstkontor-nürnberg.de",
"http://💩.la",
],
)
def test_url_absolute_valid(valid_url):
validator = validate.URL(relative=False)
assert validator(valid_url) == valid_url
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied parametrized test with validate.URL(relative=False), then trace the URL validation entry point to see how the two internationalized domain names are handled. Done means both examples are accepted and returned unchanged, with the regression covered by the test case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100