Skip to content

Commit 47b8a1d

Browse files
committed
add encode kwarg to .to_string()
1 parent 9efce47 commit 47b8a1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/packageurl/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def to_dict(self, encode: bool | None = False, empty: Any = None) -> dict[str, A
398398

399399
return data
400400

401-
def to_string(self) -> str:
401+
def to_string(self, encode: bool | None = True) -> str:
402402
"""
403403
Return a purl string built from components.
404404
"""
@@ -409,7 +409,7 @@ def to_string(self) -> str:
409409
self.version,
410410
self.qualifiers,
411411
self.subpath,
412-
encode=True,
412+
encode=encode,
413413
)
414414

415415
purl = [self.SCHEME, ":", type, "/"]

0 commit comments

Comments
 (0)