vifactor / repostat

Inspired by gitstats project: git repository desktop analyzer
GNU General Public License v3.0
106 stars 13 forks source link

Error running on Windows 10 #158

Closed andreroggeri closed 4 years ago

andreroggeri commented 4 years ago

I got the following error on my machine:

Generating HTML report...
Traceback (most recent call last):
  File "c:\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python\python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python\Python37-32\Scripts\repostat.exe\__main__.py", line 9, in <module>
  File "c:\python\python37-32\lib\site-packages\analysis\repostat.py", line 48, in main
    .create(output_path)
  File "c:\python\python37-32\lib\site-packages\report\htmlreportcreator.py", line 120, in create
    os.symlink("general.html", os.path.join(path, "index.html"))
OSError: symbolic link privilege not held

Workaround: Run as administrator

Related: #155

vifactor commented 4 years ago

Hi, thanks for reporting. Indeed, documentation says:

On newer versions of Windows 10, unprivileged accounts can create symlinks if Developer Mode is enabled. When Developer Mode is not available/enabled, the SeCreateSymbolicLinkPrivilege privilege is required, or the process must be run as an administrator. OSError is raised when the function is called by an unprivileged user.

which is confirmed by your workaround. Although, Windows version is not supported so far, I'll add a fix in v2.0.2 which at least removes the crash.

On the other hand, I would appreciate if you leave a brief instruction about installation of repostat in Windows.

andreroggeri commented 4 years ago

Thanks for the quick response.

My installation was made through pip.

I just followed the instructions on the README. Beside this error the rest of the process was smooth (although it took quite a while to run on a large repo)

vifactor commented 4 years ago

v2.0.2 should fix. Please, reopen if it does not. Thanks