casperdcl / git-fame

:star: Pretty-print `git` repository collaborators sorted by contributions
Other
641 stars 34 forks source link

TypeError: 'NoneType' object is not callable on FreeBSD #98

Closed vedranmiletic closed 2 months ago

vedranmiletic commented 2 months ago

FreeBSD 14.1, Python 3.11. I get:

% git fame
Traceback (most recent call last):
File "/home/vedran/workspace/website/.venv/bin/git-fame", line 5, in <module>
from gitfame import main
File "/home/vedran/workspace/website/.venv/lib/python3.11/site-packages/gitfame/__init__.py", line 1, in <module>
from ._gitfame import (__author__, __copyright__, __date__, __licence__, __license__, __version__,
File "/home/vedran/workspace/website/.venv/lib/python3.11/site-packages/gitfame/_gitfame.py", line 66, in <module>
from ._utils import (TERM_WIDTH, Str, TqdmStream, check_output, fext, int_cast_or_len, merge_stats,
File "/home/vedran/workspace/website/.venv/lib/python3.11/site-packages/gitfame/_utils.py", line 30, in <module>
TERM_WIDTH = _screen_shape_wrapper()(sys.stdout)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

Any ideas what to do?

casperdcl commented 2 months ago

what's the output of this?

import sys, tqdm
print(sys.platform)
print(tqdm.utils._screen_shape_linux(sys.stdout))
vedranmiletic commented 2 months ago

what's the output of this?

import sys, tqdm
print(sys.platform)
print(tqdm.utils._screen_shape_linux(sys.stdout))
Python 3.11.9 (main, Jul 11 2024, 01:05:32) [Clang 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a on freebsd14
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, tqdm
>>> print(sys.platform)
freebsd14
>>> print(tqdm.utils._screen_shape_linux(sys.stdout))
(152, 45)
casperdcl commented 2 months ago

This should be fixed now if you upgrade to tqdm>=4.66.5.

vedranmiletic commented 2 months ago

It works, thanks!