Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubmoduleAwareBuilder tries to chdir(None) which fails #413

Open
skolpadda opened this issue Nov 23, 2021 · 2 comments
Open

SubmoduleAwareBuilder tries to chdir(None) which fails #413

skolpadda opened this issue Nov 23, 2021 · 2 comments
Labels
bug Something is clearly a bug effort/medium Can be done in 1-2 days gain/medium Affects multiple users

Comments

@skolpadda
Copy link

This line:

self.run_git_archive(relative_git_dir, prefix, commit, initial_tar, None)

calls run_git_archive which tries:

with chdir(subdir) as p:

Since subdir is None here, this raises an exception:

Traceback (most recent call last):
  File "/usr/bin/tito", line 11, in <module>
    load_entry_point('tito==0.6.18', 'console_scripts', 'tito')()
  File "/usr/lib/python3.6/site-packages/tito/cli.py", line 910, in main
    CLI().main(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/tito/cli.py", line 209, in main
    return module.main(argv)
  File "/usr/lib/python3.6/site-packages/tito/cli.py", line 392, in main
    return builder.run(self.options)
  File "/usr/lib/python3.6/site-packages/tito/builder/main.py", line 161, in run
    self.rpm()
  File "/usr/lib/python3.6/site-packages/tito/builder/main.py", line 559, in rpm
    self.tgz()
  File "/usr/lib/python3.6/site-packages/tito/builder/main.py", line 542, in tgz
    self._setup_sources()
  File "/usr/lib/python3.6/site-packages/tito/builder/submodule_aware_builder.py", line 52, in _setup_sources
    os.path.join(self.rpmbuild_sourcedir, self.tgz_filename))
  File "/usr/lib/python3.6/site-packages/tito/builder/submodule_aware_builder.py", line 112, in create_tgz
    self.run_git_archive(relative_git_dir, prefix, commit, initial_tar, None)
  File "/usr/lib/python3.6/site-packages/tito/builder/submodule_aware_builder.py", line 75, in run_git_archive
    with chdir(subdir) as p:
  File "/usr/lib64/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/lib/python3.6/site-packages/tito/common.py", line 138, in chdir
    os.chdir(path)
TypeError: chdir: path should be string, bytes, os.PathLike or integer, not NoneType

Python: 3.6
OS: CentOS 8
tito: 0.6.18

Expected behaviour: tito builds the RPM without any errors.

belonesox added a commit to belonesox/tito that referenced this issue Dec 18, 2021
@belonesox
Copy link

Obvious bug.
image

I quickly fixed it, but I see a lot of other «submodule bugs»…

t0fik added a commit to t0fik/tito that referenced this issue Sep 29, 2022
FrostyX pushed a commit that referenced this issue Oct 4, 2022
@FrostyX
Copy link
Member

FrostyX commented Jan 1, 2024

This seems to be fixed by PR #427, can we close @skolpadda?

@FrostyX FrostyX added bug Something is clearly a bug effort/medium Can be done in 1-2 days gain/medium Affects multiple users labels Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is clearly a bug effort/medium Can be done in 1-2 days gain/medium Affects multiple users
Projects
None yet
Development

No branches or pull requests

3 participants