Feature: Stream bytes out on copy_from_container

未關閉 適合新手
#1,149 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

@archit15singh 已經在處理了。

開始於 2026年11月22日。

  • #1152 來自 @archit15singh —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
67/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
docker, python
領域
backend

研究方向

先閱讀 copy_file_from_container() 的 Python 實作及其測試;issue 未指定特定檔案。檢查目前基於 Path 的複製如何實作,以及附近的 API 如何提供串流。完成標準是呼叫端可以收集複製的位元組,而不必將其寫入暫存檔,並且測試涵蓋新行為。

由索引模型根據 Issue 內容生成。

描述

🚀 enhancement

What are you trying to do?

In Testcontainers Java, there's a handy override for copyFileFromContainer() that let's you pass a function to collect the output stream. This seems to be primarily exist so you can stream the bytes out without writing them to disk.

In Testcontainers Go, CopyFileFromContainer() returns an io.ReadCloser directly which is super nice.

It would be handy if there was a way to do this in the python version, which currently only supports passing a Path and writing to that path.

Why should it be done this way?

I don't want to use a temporary file on disk.

Other references:
https://golang.testcontainers.org/features/files_and_mounts/

https://github.com/testcontainers/testcontainers-java/blob/e16dca9ea8e8b097c7b15aa8f420cee0a1b16687/core/src/main/java/org/testcontainers/containers/ContainerState.java#L404

主要語言
Python
星號
2.3k
分支
397
平均合併
8 天 16 小時
30 天內合併 PR
5

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

testcontainers/testcontainers-python 的其他 Issue

查看 testcontainers/testcontainers-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。