Opened 4 years ago

Closed 4 years ago

#8063 release blocker: regression closed fixed (fixed)

URLPath.click incorrectly adds extra slashes on python 3

Reported by: Glyph Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

python 2 (what I would expect):

$ python -c 'from twisted.python.urlpath import URLPath; print(str(URLPath.fromBytes(b"http://localhost/").click(b"/hello")))'
http://localhost/hello

python 3 (oops):

$ python -c 'from twisted.python.urlpath import URLPath; print(str(URLPath.fromBytes(b"http://localhost/").click(b"/hello")))'
http://localhost//hello

I am planning to fix this in the IRI ticket since gutting URLPath will be a good way of validating that the new algorithms work properly for existing stuff, and the new URL object already has tests for edge cases like this, whereas URLPath itself has almost no coverage.

I am tagging this as a "regression" even though it isn't really, because if this functionality started behaving this way on py2 it would be a regression. So the port isn't really finished and it would be a bit misleading to ship with that in the NEWS file. Someone else can feel free to disagree with me of course :).

Change History (2)

comment:1 Changed 4 years ago by Glyph

Fix is up for review on #5388.

comment:2 Changed 4 years ago by Glyph

Resolution: fixed
Status: newclosed

(In [45992]) Merge iri-5388-4: new, internationalizable URL

Author: glyph, itamar

Reviewer: jonathanj, hawkowl

Fixes: #5388 Fixes: #8063

twisted.python.url is a new abstraction for URLs, supporting RFC 3987 IRIs.

This change also replaces the guts of twisted.python.urlpath, reducing duplication since we cannot deprecate it immediately.

Note: See TracTickets for help on using tickets.