Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #6

Merged
merged 4 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
url = https://github.com/package-url/purl-spec
[submodule "survey/drivers/sonatype/package_url_java/repo"]
path = survey/drivers/sonatype/package_url_java/repo
url = https://github.com/sonatype/package-url-java.git
url = https://github.com/sonatype/package-url-java
[submodule "survey/drivers/maennchen/purl/repo"]
path = survey/drivers/maennchen/purl/repo
url = https://github.com/maennchen/purl.git
Expand Down
10 changes: 8 additions & 2 deletions survey/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ async def __aenter__(self):
async def __aexit__(self, exc_type, exc_value, traceback):
# The Python documentation says communicate always closes stdin,
# but it only closes if a value is passed.
await self.process.communicate(b"")
try:
await self.process.communicate(b"")
except Exception:
maxrake marked this conversation as resolved.
Show resolved Hide resolved
pass

async def parse(self, purls):
async def write_request():
Expand All @@ -55,7 +58,10 @@ async def read_response():
results = []
for _ in purls:
line = await self.process.stdout.readline()
line = json.loads(line)
try:
line = json.loads(line)
except Exception:
maxrake marked this conversation as resolved.
Show resolved Hide resolved
line = {"error": f"invalid json: {line}"}
error = line.get("error")
if error is not None:
results.append(Error(error))
Expand Down
2 changes: 2 additions & 0 deletions survey/drivers/package_url/packageurl_php/format
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

error_reporting(E_ALL ^ E_DEPRECATED);

include("repo/src/BuildParseTrait.php");
include("repo/src/PackageUrl.php");
include("repo/src/PackageUrlBuilder.php");
Expand Down
2 changes: 2 additions & 0 deletions survey/drivers/package_url/packageurl_php/parse
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

error_reporting(E_ALL ^ E_DEPRECATED);

include("repo/src/BuildParseTrait.php");
include("repo/src/PackageUrl.php");
include("repo/src/PackageUrlParser.php");
Expand Down
1 change: 1 addition & 0 deletions survey/drivers/sonatype/package_url_java/repo
Submodule repo added at 6af9e5