Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2246117 - python-dotenv fails to build: Error: Invalid value: Invalid value for '-f' "/builddir/build/BUILD/python-dotenv-0.21.1/.env" does not exist.
Summary: python-dotenv fails to build: Error: Invalid value: Invalid value for '-f' "/...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-dotenv
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F39FTBFS F40FTBFS PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-25 13:20 UTC by Karolina Surma
Modified: 2023-10-26 14:01 UTC (History)
5 users (show)

Fixed In Version: python-dotenv-1.0.0-1.fc40
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-10-26 14:01:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-10-25 13:20:48 UTC
python-dotenv fails to build with Python 3.13.0a1.

+ /usr/bin/python3 -m tox --current-env -q --recreate -e py313
============================= test session starts ==============================
platform linux -- Python 3.13.0a1, pytest-7.4.2, pluggy-1.3.0
cachedir: .tox/py313/.pytest_cache
rootdir: /builddir/build/BUILD/python-dotenv-0.21.1
configfile: setup.cfg
testpaths: tests
collected 147 items / 1 skipped

tests/test_cli.py ............................FFFFF....                  [ 25%]
tests/test_main.py ..................................................... [ 61%]
.......                                                                  [ 65%]
tests/test_parser.py ...........................................         [ 95%]
tests/test_utils.py .                                                    [ 95%]
tests/test_variables.py ......                                           [100%]

=================================== FAILURES ===================================
____________________________ test_get_default_path _____________________________

tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_get_default_path0')

    def test_get_default_path(tmp_path):
        sh.cd(str(tmp_path))
        with open(str(tmp_path / ".env"), "w") as f:
            f.write("a=b")
    
>       result = sh.dotenv("get", "a")

tests/test_cli.py:160: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.13/site-packages/sh.py:1508: in __call__
    rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
/usr/lib/python3.13/site-packages/sh.py:737: in __init__
    self.wait()
/usr/lib/python3.13/site-packages/sh.py:799: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 2

    def handle_command_exit_code(self, code):
        """here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(
                self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"]
            )
>           raise exc
E           sh.ErrorReturnCode_2: 
E           
E             RAN: /builddir/build/BUILDROOT/python-dotenv-0.21.1-5.fc40.x86_64/usr/bin/dotenv get a
E           
E             STDOUT:
E           
E           
E             STDERR:
E           Error opening env file: [Errno 2] No such file or directory: '/builddir/build/BUILD/python-dotenv-0.21.1/.env'

/usr/lib/python3.13/site-packages/sh.py:826: ErrorReturnCode_2
___________________________________ test_run ___________________________________

tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_run0')

    def test_run(tmp_path):
        sh.cd(str(tmp_path))
        dotenv_file = str(tmp_path / ".env")
        with open(dotenv_file, "w") as f:
            f.write("a=b")
    
>       result = sh.dotenv("run", "printenv", "a")

tests/test_cli.py:171: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.13/site-packages/sh.py:1508: in __call__
    rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
/usr/lib/python3.13/site-packages/sh.py:737: in __init__
    self.wait()
/usr/lib/python3.13/site-packages/sh.py:799: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 2

    def handle_command_exit_code(self, code):
        """here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(
                self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"]
            )
>           raise exc
E           sh.ErrorReturnCode_2: 
E           
E             RAN: /builddir/build/BUILDROOT/python-dotenv-0.21.1-5.fc40.x86_64/usr/bin/dotenv run printenv a
E           
E             STDOUT:
E           
E           
E             STDERR:
E           Usage: dotenv run [OPTIONS] [COMMANDLINE]...
E           Try 'dotenv run --help' for help.
E           
E           Error: Invalid value: Invalid value for '-f' "/builddir/build/BUILD/python-dotenv-0.21.1/.env" does not exist.

/usr/lib/python3.13/site-packages/sh.py:826: ErrorReturnCode_2
_______________________ test_run_with_existing_variable ________________________

tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_run_with_existing_variabl0')

    def test_run_with_existing_variable(tmp_path):
        sh.cd(str(tmp_path))
        dotenv_file = str(tmp_path / ".env")
        with open(dotenv_file, "w") as f:
            f.write("a=b")
        env = dict(os.environ)
        env.update({"LANG": "en_US.UTF-8", "a": "c"})
    
>       result = sh.dotenv("run", "printenv", "a", _env=env)

tests/test_cli.py:184: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.13/site-packages/sh.py:1508: in __call__
    rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
/usr/lib/python3.13/site-packages/sh.py:737: in __init__
    self.wait()
/usr/lib/python3.13/site-packages/sh.py:799: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 2

    def handle_command_exit_code(self, code):
        """here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(
                self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"]
            )
>           raise exc
E           sh.ErrorReturnCode_2: 
E           
E             RAN: /builddir/build/BUILDROOT/python-dotenv-0.21.1-5.fc40.x86_64/usr/bin/dotenv run printenv a
E           
E             STDOUT:
E           
E           
E             STDERR:
E           Usage: dotenv run [OPTIONS] [COMMANDLINE]...
E           Try 'dotenv run --help' for help.
E           
E           Error: Invalid value: Invalid value for '-f' "/builddir/build/BUILD/python-dotenv-0.21.1/.env" does not exist.

/usr/lib/python3.13/site-packages/sh.py:826: ErrorReturnCode_2
________________ test_run_with_existing_variable_not_overridden ________________

tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_run_with_existing_variabl1')

    def test_run_with_existing_variable_not_overridden(tmp_path):
        sh.cd(str(tmp_path))
        dotenv_file = str(tmp_path / ".env")
        with open(dotenv_file, "w") as f:
            f.write("a=b")
        env = dict(os.environ)
        env.update({"LANG": "en_US.UTF-8", "a": "c"})
    
>       result = sh.dotenv("run", "--no-override", "printenv", "a", _env=env)

tests/test_cli.py:197: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.13/site-packages/sh.py:1508: in __call__
    rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
/usr/lib/python3.13/site-packages/sh.py:737: in __init__
    self.wait()
/usr/lib/python3.13/site-packages/sh.py:799: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 2

    def handle_command_exit_code(self, code):
        """here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(
                self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"]
            )
>           raise exc
E           sh.ErrorReturnCode_2: 
E           
E             RAN: /builddir/build/BUILDROOT/python-dotenv-0.21.1-5.fc40.x86_64/usr/bin/dotenv run --no-override printenv a
E           
E             STDOUT:
E           
E           
E             STDERR:
E           Usage: dotenv run [OPTIONS] [COMMANDLINE]...
E           Try 'dotenv run --help' for help.
E           
E           Error: Invalid value: Invalid value for '-f' "/builddir/build/BUILD/python-dotenv-0.21.1/.env" does not exist.

/usr/lib/python3.13/site-packages/sh.py:826: ErrorReturnCode_2
___________________________ test_run_with_none_value ___________________________

tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_run_with_none_value0')

    def test_run_with_none_value(tmp_path):
        sh.cd(str(tmp_path))
        dotenv_file = str(tmp_path / ".env")
        with open(dotenv_file, "w") as f:
            f.write("a=b\nc")
    
>       result = sh.dotenv("run", "printenv", "a")

tests/test_cli.py:208: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.13/site-packages/sh.py:1508: in __call__
    rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
/usr/lib/python3.13/site-packages/sh.py:737: in __init__
    self.wait()
/usr/lib/python3.13/site-packages/sh.py:799: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 2

    def handle_command_exit_code(self, code):
        """here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(
                self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"]
            )
>           raise exc
E           sh.ErrorReturnCode_2: 
E           
E             RAN: /builddir/build/BUILDROOT/python-dotenv-0.21.1-5.fc40.x86_64/usr/bin/dotenv run printenv a
E           
E             STDOUT:
E           
E           
E             STDERR:
E           Usage: dotenv run [OPTIONS] [COMMANDLINE]...
E           Try 'dotenv run --help' for help.
E           
E           Error: Invalid value: Invalid value for '-f' "/builddir/build/BUILD/python-dotenv-0.21.1/.env" does not exist.

/usr/lib/python3.13/site-packages/sh.py:826: ErrorReturnCode_2
=========================== short test summary info ============================
FAILED tests/test_cli.py::test_get_default_path - sh.ErrorReturnCode_2: 
FAILED tests/test_cli.py::test_run - sh.ErrorReturnCode_2: 
FAILED tests/test_cli.py::test_run_with_existing_variable - sh.ErrorReturnCod...
FAILED tests/test_cli.py::test_run_with_existing_variable_not_overridden - sh...
FAILED tests/test_cli.py::test_run_with_none_value - sh.ErrorReturnCode_2: 
=================== 5 failed, 142 passed, 1 skipped in 1.07s ===================

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06561163-python-dotenv/

For all our attempts to build python-dotenv with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-dotenv/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2023-10-26 12:14:31 UTC
https://koschei.fedoraproject.org/package/python-dotenv indicates this is not Python 3.13 related

Comment 3 Fedora Update System 2023-10-26 13:58:25 UTC
FEDORA-2023-f390b1adf7 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-f390b1adf7

Comment 4 Fedora Update System 2023-10-26 14:01:14 UTC
FEDORA-2023-f390b1adf7 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.