HomeSoftware Heritage

Fix TypeError caused by empty lists being passed as a string to re.sub.

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Fix TypeError caused by empty lists being passed as a string to re.sub.

In make_api_response, empty lists were not JSONized because they were
mistakenly detected as a None, which caused these empty lists to be
passed to urlize_links_and_mails, which expects strings.

It caused a TypeError when calling re.sub() on it, which was catched
so it still returned a result (and a correct one, since empty lists
don't need substitution).

This commit removes the catch workaround and always passes the right
type.

Details

Provenance
vlorentzAuthored on Jan 7 2021, 5:19 PM
vlorentzPushed on Jan 8 2021, 12:20 PM
Differential Revision
D4819: Fix TypeError caused by empty lists being passed as a string to re.sub.
Build Status
Buildable 18223
Build 28125: test-and-buildJenkins console · Jenkins

Commit No Longer Exists

This commit no longer exists in the repository.