Skip to content

URL query values are percent-decoded twice #4208

Closed

Description

@winklemad

Version: master at 88d16d0db10c852d1d292628b2c832f1ed117056

Redis version: Not applicable; this occurs before connecting to Redis.

Platform: Python 3.10.9 on macOS

Description:

ConnectionPool.from_url decodes URL query values twice:

import redis

pool = redis.ConnectionPool.from_url(
    "redis://localhost?client_name=worker%2520name"
)
print(pool.connection_kwargs["client_name"])

Expected:

worker%20name

Actual:

worker name

This mutates literal percent-encoded sequences in query options, so callers
cannot preserve values such as the intended client name.

Activity

  1. vladvildanov commented on Jul 27, 2026

    @vladvildanov
    Collaborator

    @winklemad Hey! Thanks for addressing this, would take care of it

  2. vladvildanov commented on Jul 27, 2026

    @vladvildanov
    Collaborator

    @winklemad #4222 should address this issue, feel free to leave your comments on that

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions