manolomartinez / greg

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

Error "split() takes no keyword arguments" on new install #58

Closed TypeFaster2 closed 8 years ago

TypeFaster2 commented 8 years ago

I have a new install of greg and am seeing the following messages when trying to do a download:

mal@stn6714:~$ greg download 1
Traceback (most recent call last):
  File "/home/mal/.local/bin/greg", line 9, in <module>
    load_entry_point('Greg==0.4.6', 'console_scripts', 'greg')()
  File "/home/mal/.local/lib/python3.2/site-packages/greg/gregparser.py", line 118, in main
    function(vars(args))
  File "/home/mal/.local/lib/python3.2/site-packages/greg/greg.py", line 825, in download
    issues = parse_for_download(args)
  File "/home/mal/.local/lib/python3.2/site-packages/greg/greg.py", line 497, in parse_for_download
    for group in single_arg.split(sep=","):
TypeError: split() takes no keyword arguments

The system is running on is Debian 7.11 Python is 3.2.3

Do you have any tips on what I might look at to identify and correct the issue?

Mal.

manolomartinez commented 8 years ago

Hello, does this happen when you try to download any entry in any podcast, or just for one particular case? If the latter, could you please post the actual podcast and entry that is misbehaving?

Thanks, Manolo

TypeFaster2 commented 8 years ago

Hi, The error happens with all podcasts, including the example PhilosophyBites.

I have a dev and prod machine. I upgraded Dev from Wheezy to Jessie, which also upgraded Python to Python 3.4.2. That seems to have fixed the problem.

I still have the issue on prod, hopefully I can upgrade that next week. If that fixes it I'll update and close this.

Cheers,
Mal

Narrat commented 8 years ago

You could try what happens if you remove the sep= from the function call (just "," remaining between ()) https://github.com/manolomartinez/greg/search?utf8=%E2%9C%93&q=.split%28sep Those need to be adjusted

manolomartinez commented 8 years ago

Sorry, I see now that the error was about split() taking no keyword arguments. What was your python version, before the upgrade? I thought split() understood sep since 3.x, but I might be wrong about that, of course.

EDIT: You did say that your previous python was 3.2.3. Sorry again!

Narrat commented 8 years ago

Changed inbetween the 3.x line 3.2.x is using the old syntax

Edit: With 3.3.0 it changed

manolomartinez commented 8 years ago

Huh, thanks @Narrat. I should say as much in the README, then.

Narrat commented 8 years ago

Well, the call to split could also be changed. .split(",") is working, no need to explicit call on that (dunno if I missed sth)

TypeFaster2 commented 8 years ago

Hi, I tried changing

160 single_arg = single_arg.translate({32: None})  # eliminates spaces
161     for group in single_arg.split(sep=","):
162         if not("-" in group):
163             list_of_feeds.append(group)
164         else:
165             extremes = group.split(sep="-")

to

    single_arg = single_arg.translate({32: None})  # eliminates spaces
    for group in single_arg.split(","):
        if not("-" in group):
            list_of_feeds.append(group)
        else:
            extremes = group.split("-")

Then I ran "greg check -f PhilosophyBites", which returned a list of episodes, as expected. But I got the error:

greg $ greg download 1
... something went wrong.Are you sure your last greg check went well?

I tried changing every instance of split(sep="x") to split("x") with the same result.

Cheers.

manolomartinez commented 8 years ago

I will look into it, but if it's still a 3.2 / 3.4 thing, and there are many changes to be made, I think it'll be most sensible to be forthcoming about the python versions that greg will work with.

TypeFaster2 commented 8 years ago

Thanks Manolo, I upgraded my prod machine to Jessie and Python 3.4.2 which has fixed this for me. So I'm going to close this issue.

Greg is doing exactly what I wanted it to do, so thanks for putting it together. And thanks to for the active support.

Cheers.

Mal.

manolomartinez commented 8 years ago

Thank you for the kind words, Mal. You have a cool blog, btw :)