← Back to DAGDA | Support | Source: https://github.com/mozilla/bleach/issues/503
Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

Test suite fails with Python 3.8.1 #503

Closed

Description

@Ma27

This happens since urllib.parse parses URLs like path:80 as scheme=path,path=80 (https://bugs.python.org/issue27657).

Which causes errors like this:

def test_uri_value_allowed_protocols(data, kwargs, expected):
>       assert clean(data, **kwargs) == expected
E       assert '<a>valid</a>' == '<a href="192...00">valid</a>'
E         - <a>valid</a>
E         + <a href="192.168.100.100:8000">valid</a>

tests/test_clean.py:676: AssertionError

Currently preparing a patch for this :)

Activity

  1. added a commit that references this issue on Dec 21, 2019
  2. hugovk commented on Jan 28, 2020

    @hugovk
    Contributor

    @Ma27 Hi, any progress with the patch? Thanks!

  3. Ma27 commented on Jan 28, 2020

    @Ma27
    Author

    Huh, I thought I provided a status update here as well, sorry!

    Unfortunately I'm not sure if I actually want to work around this, the code already depends on some heuristics and I'm afraid that patching around in there will cause some mean regressions.

    I still hope that the change gets reverted again: python/cpython#16839 (comment)

  4. kitterma commented on Feb 16, 2020

    @kitterma

    I don't see much evidence of upstream python3.8 activity to revert. Even if they do, the same problem will occur once 3.9 is out, so it's got to be solved sooner or later.

  5. Ma27 commented on Apr 16, 2020

    @Ma27
    Author

    Even if they do, the same problem will occur once 3.9 is out, so it's got to be solved sooner or later.

    Agreed. While taking a look at this a few months ago I realized though that sanitizing has more culprits than I anticipated, so unless the change is reverted, someone else should fix the library accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions