FWIW, the thing that changed was https://code.launchpad.net/~wgrant/launchpad/bug-677270/+merge/279974. Strictly speaking, to match that you ought to use quote(sourcepkg, safe='/~+'), but it makes no difference since there are no longer any characters that are legal in source package names and that are escaped in librarian URLs.
FWIW, the thing that changed was https:/ /code.launchpad .net/~wgrant/ launchpad/ bug-677270/ +merge/ 279974. Strictly speaking, to match that you ought to use quote(sourcepkg, safe='/~+'), but it makes no difference since there are no longer any characters that are legal in source package names and that are escaped in librarian URLs.