Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybaloney committed Jan 27, 2025
2 parents f86ecc5 + 62ab0cc commit 58bb70f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions src/CSnakes.Runtime/Locators/RedistributableLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,18 @@ protected override string GetLibPythonPath(string folder, bool freeThreaded = fa
private static async Task<string> DownloadFileToTempDirectoryAsync(string fileUrl)
{
using HttpClient client = new();
using var contentStream = await client.GetStreamAsync(fileUrl);

string tempFilePath = Path.GetTempFileName();
using FileStream fileStream = new FileStream(tempFilePath, FileMode.Create, FileAccess.Write, FileShare.None);
await contentStream.CopyToAsync(fileStream);
var contentStream = await client.GetStreamAsync(fileUrl).ConfigureAwait(false);
await using (contentStream.ConfigureAwait(false))
{
string tempFilePath = Path.GetTempFileName();
var fileStream = new FileStream(tempFilePath, FileMode.Create, FileAccess.Write, FileShare.None);
await using (fileStream.ConfigureAwait(false))
{
await contentStream.CopyToAsync(fileStream).ConfigureAwait(false);
}

return tempFilePath;
return tempFilePath;
}
}

private static string DecompressZstFile(string zstFilePath)
Expand Down
2 changes: 1 addition & 1 deletion src/Packaging.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PackageIcon>logo.jpeg</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/tonybaloney/CSnakes</RepositoryUrl>
<VersionPrefix>1.0.25</VersionPrefix>
<VersionPrefix>1.0.26</VersionPrefix>
<PackageLicenseFile>LICENSE</PackageLicenseFile>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down

0 comments on commit 58bb70f

Please sign in to comment.