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

Fix invalid namespace reference #4

Merged
merged 1 commit into from Feb 8, 2022
Merged

Conversation

juergenhoetzel
Copy link
Contributor

Fixes:

→ ./tarstats.py NONEXISTENT
Traceback (most recent call last):
  File "/home/juergen/ghq/github.com/isotopp/tarstats/./tarstats.py", line 188, in tarstats
    stats = tarstat(name)
  File "/home/juergen/ghq/github.com/isotopp/tarstats/./tarstats.py", line 143, in tarstat
    with tarfile.open(filename, "r") as t:
  File "/usr/lib/python3.10/tarfile.py", line 1613, in open
    return func(name, "r", fileobj, **kwargs)
  File "/usr/lib/python3.10/tarfile.py", line 1679, in gzopen
    fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
  File "/usr/lib/python3.10/gzip.py", line 174, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'NONEXISTENT'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/juergen/ghq/github.com/isotopp/tarstats/./tarstats.py", line 227, in <module>
    main()
  File "/home/juergen/ghq/github.com/isotopp/tarstats/./tarstats.py", line 223, in main
    tarstats(args.tarfile, args.json, args.totals)
  File "/home/juergen/ghq/github.com/isotopp/tarstats/./tarstats.py", line 190, in tarstats
    print(f"Can't read '{name}': {e}", file=sys.stderr)
NameError: name 'sys' is not defined

@isotopp isotopp merged commit 188cd97 into isotopp:main Feb 8, 2022
@isotopp
Copy link
Owner

isotopp commented Feb 8, 2022

Ah, yes. I overlooked that one. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants