manolomartinez / greg

A command-line podcast aggregator
GNU General Public License v3.0
297 stars 37 forks source link

greg add IsADirectoryError - missing global conf file #43

Closed ghost closed 8 years ago

ghost commented 8 years ago
Traceback (most recent call last):
  File "/home/nick/.local/bin/greg", line 9, in <module>
    load_entry_point('Greg==0.4.5', 'console_scripts', 'greg')()
  File "/home/nick/.local/lib/python3.4/site-packages/greg/gregparser.py", line 117, in main
    args.func(vars(args))
  File "/home/nick/.local/lib/python3.4/site-packages/greg/greg.py", line 629, in add
    with open(session.data_filename, 'w') as configfile:
IsADirectoryError: [Errno 21] Is a directory: '/home/nick/.local/share/greg/data'
ghost commented 8 years ago

Ok, so installing greg from git using pip install --user git+https://github.com/manolomartinez/greg.git doesn't create the following directory:

/home/nick/.local/lib/python3.4/site-packages/greg/data/greg.conf

Which means there is there is no global greg.conf

If greg.conf is missing then greg doesn't know where to find the default data directory which in this case is '/home/nick/.local/share/greg/data`

So this commit bf15fd3 fixes the fallback to this location. Let me know if this is a good way to handle this or not.

manolomartinez commented 8 years ago

Ugh, yes, thanks for opening this issue, Nick.

The right way to do it, I think, is to get setuptools to install package data as we intended. This is a famous mess, but I think I got it working now.

This commit accomplishes it, I think.

ghost commented 8 years ago

Works perfect! Thanks.