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

After install from GitHub master, error running torf: TypeError: expected str, bytes or os.PathLike object, not NoneType #1

Closed
marcelpaulo opened this issue May 20, 2018 · 4 comments

Comments

@marcelpaulo
Copy link
Contributor

I've just installed torf on Xubuntu 18.04 with Python 3.65:

paulo:~/src$ pip3 install --user git+https://github.com/rndusr/torf-cli.git
Collecting git+https://github.com/rndusr/torf-cli.git
  Cloning https://github.com/rndusr/torf-cli.git to /tmp/pip-kssluewc-build
Collecting pyxdg (from torf-cli==1.2)
  Using cached https://files.pythonhosted.org/packages/39/03/12eb9062f43adb94e30f366743cb5c83fd15fef026500cd4de42c7c12280/pyxdg-0.26-py2.py3-none-any.whl
Collecting torf>=1.3 (from torf-cli==1.2)
  Using cached https://files.pythonhosted.org/packages/dc/9b/8b82bb81dc06753921c02205c3eadf600b1ceec002761baab6188f115675/torf-1.3.tar.gz
Collecting bencoder.pyx<2.0.0,>=1.1.1 (from torf>=1.3->torf-cli==1.2)
  Using cached https://files.pythonhosted.org/packages/90/96/aed139c3b893ce09e8d1033303e5451c2799a9741d29028d3c80c5c66853/bencoder.pyx-1.2.1-cp36-cp36m-manylinux1_x86_64.whl
Building wheels for collected packages: torf
  Running setup.py bdist_wheel for torf ... done
  Stored in directory: /home/paulo/.cache/pip/wheels/55/19/37/eeaf4874c7718d0d3b29c85d980b946d5d29706863853e2400
Successfully built torf
Installing collected packages: pyxdg, bencoder.pyx, torf, torf-cli
  Running setup.py install for torf-cli ... done
Successfully installed bencoder.pyx-1.2.1 pyxdg-0.26 torf-1.3 torf-cli-1.2

and if I run torf with any option/arg, I always get the same error, for instance, running torf -h:

paulo:~/src$ torf -h
Traceback (most recent call last):
  File "/home/paulo/.local/bin/torf", line 11, in <module>
    load_entry_point('torf-cli==1.2', 'console_scripts', 'torf')()
  File "/home/paulo/.local/lib/python3.6/site-packages/torfcli/__init__.py", line 13, in run
    from ._cli import run, CLIError
  File "/home/paulo/.local/lib/python3.6/site-packages/torfcli/_cli.py", line 39, in <module>
    _DEFAULT_PROFILE_FILE = os.path.join(BaseDirectory.load_first_config(_vars.__appname__), 'config')
  File "/usr/lib/python3.6/posixpath.py", line 80, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
@marcelpaulo
Copy link
Contributor Author

I came by the solution: ~/.config/torf has to be created before running torf.

@rndusr
Copy link
Owner

rndusr commented May 20, 2018

That's not a solution. The config file is optional and any raised exception is a bug.

@rndusr rndusr reopened this May 20, 2018
@rndusr rndusr closed this as completed in 4c67074 May 20, 2018
@rndusr
Copy link
Owner

rndusr commented May 20, 2018

Now a missing config file shouldn't be an issue anymore.

@marcelpaulo
Copy link
Contributor Author

You're damn right: solution was wrong, it was mere working around a bug. I've pulled your latest commits, removed the config directory, and torf works without it.

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

No branches or pull requests

2 participants