Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Avoid ending up with double quoted variables in docker.

Đang mở
#545 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, python
Lĩnh vực
devops, tooling

Hướng nghiên cứu

The issue names no repository file, test, or entry point. Reproduce the quoted .env examples with python-dotenv and compare the resulting values with the expected behavior described in the issue. Confirm the intended handling of single- and double-quoted assignments, then verify the result with an appropriate repository test or documented outcome.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Related to the buggy way docker handles env-files
see https://github.com/docker/cli/issues/3630#issuecomment-2599705392

When you quote variables in your .env (which IHMO is a best practice):

FOO=BAR
FOO1='BAR1'
FOO2="BAR2"

and then you run docker via docker run --env-file .env
you end up with literal quoted variables inside docker:

FOO=BAR
FOO1='BAR1'
FOO2="BAR2"

This is incorrect, and should be fixed in docker.

and in python via python-dotenv, they become double quoted variables


>>> os.getenv("FOO")
'BAR'

>>> os.getenv("FOO1")
"'BAR1'"

>>> os.getenv("FOO2")
'"BAR2"'

As a work-around for the root-cause, could be avoid ending up with double-quoted variables in python?

Ngôn ngữ chính
Python
Star
8.9k
Fork
581
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của theskumar/python-dotenv

Tất cả issue của theskumar/python-dotenv

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.