confight icon indicating copy to clipboard operation
confight copied to clipboard

Giv full controll of the stream to the loaders

Open frank-lenormand opened this issue 1 year ago • 0 comments

The file loaders get passed a stream object that was opened by confight.

When overriding a loader for a given format, this might be an issue if the stream is expected to be opened with specific options, or even if the underlying loader implementation doesn’t accept a stream (e.g. only a file path).

Example: tomllib.load() expects the stream to be opened in rb mode, but confight passes a stream opened in r mode to the loader.

frank-lenormand avatar May 13 '24 07:05 frank-lenormand