GithubHelp home page GithubHelp logo

Comments (7)

seejohnrun avatar seejohnrun commented on August 17, 2024

Type is actually specified as an arg to that function, not in **kwargs, ie:

def posts(self, blogname, type=None, **kwargs):
  # woo

Hope this helps!

from pytumblr.

Chaobunny avatar Chaobunny commented on August 17, 2024

I saw that before posting this, but I don't think that is the problem. I'm still getting an error in the traceback where it calls a helper function from the send_api_request function; it seems the helper function does not reflect this function signature?

C:\Users...\Desktop\Machine Learning Project\client_test.py in ()
42
43 args = { 'limit':2}
---> 44 posts = client.posts(urls[0], 'text', **args)
45 print(posts)

C:\Users....\AppData\Local\Enthought\Canopy\User\lib\site-packages\pytumblr-0.0.5-py2.7.egg\pytumblr\helpers.pyc in add_dot_tumblr(_args, *_kwargs)
42 args = list(args)
43 args[1] += ".tumblr.com"
---> 44 return fn(_args, *_kwargs)
45 return add_dot_tumblr

TypeError: posts() takes exactly 2 arguments (5 given)

Unless I'm missing something glaringly obvious in how I call this function?

For the record, I have also tried type='text' as the second argument but then I get the 'type is not a valid argument' error again.

from pytumblr.

seejohnrun avatar seejohnrun commented on August 17, 2024

I added a few tests to exercise and demonstrate this behvaior.
What value do you have in urls[0] ? Seems this is a different error you're running into

from pytumblr.

Chaobunny avatar Chaobunny commented on August 17, 2024

urls[0] is just the name of a blog, i.e. like 'seejohnrun' in the example you provided. If I replace urls[0] with 'seejohnrun' I get the same error, so that isn't it.

args = {'limit':2}
#print(urls[0])
posts = client.posts('seejohnrun','photo', **args)

Here is my full stacktrace.

TypeError                                 Traceback (most recent call last)
C:\Users\...\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.1.0.1371.win-x86_64\lib\site-packages\IPython\utils\py3compat.pyc in execfile(fname, glob, loc)
    174             else:
    175                 filename = fname
--> 176             exec compile(scripttext, filename, 'exec') in glob, loc
    177     else:
    178         def execfile(fname, *where):

C:\Users\...\Desktop\Machine Learning Project\client_test.py in <module>()
     43 args = {'limit':2}
     44 #print(urls[0])
---> 45 posts = client.posts('seejohnrun','photo', **args)
     46 print(posts)

C:\Users\...\AppData\Local\Enthought\Canopy\User\lib\site-packages\pytumblr-0.0.5-py2.7.egg\pytumblr\helpers.pyc in add_dot_tumblr(*args, **kwargs)
     42             args = list(args)
     43             args[1] += ".tumblr.com"
---> 44         return fn(*args, **kwargs)
     45     return add_dot_tumblr

TypeError: posts() takes exactly 2 arguments (4 given)

Why does it say posts() takes exactly 2 arguments? Doesn't the inclusion of **kwargs imply it can take many more? It won't seem to ever let me call posts() with the function signature from init.py, and specifying type= in the argument field generates the error I originally posted about.

I'm not sure what the first item in the stack trace is referring to either, that could be the error maybe?

from pytumblr.

seejohnrun avatar seejohnrun commented on August 17, 2024

Yeah I would imagine that this must be something to do with your setup (window, ipython, etc)
the py3compat may mean you're trying to run all of this with python3 - which is probably going to be a non-starter

from pytumblr.

Chaobunny avatar Chaobunny commented on August 17, 2024

Is this not compatible with Python 3.1?

Regardless, I found an easy workaround for the problem where I just get posts of all types and filter them afterwards. I'm still unclear about what exactly is going wrong, but if it's just the Python version then I suppose my workaround is the best solution other than changing the version of Python on my computer.

Thanks for your help.

from pytumblr.

seejohnrun avatar seejohnrun commented on August 17, 2024

Not that it's a good thing, but check out https://python3wos.appspot.com/ (look for the locks too!)
Python 3 was not backward compatible with Python 2.

That said, I'll see what I can do over the next week, if people are interested

from pytumblr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.