Comments (7)
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.
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.
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.
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.
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.
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.
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)
- How do I get pytumblr into my project and get it running? HOT 2
- Adding source_url to a new post HOT 2
- Proposing a PR to fix a few small typos
- Scheduling posts
- source_url not added as a valid parameter
- How to send and receive tumblr messages via apis HOT 1
- API returns older posts than requested
- Upload v0.1.1 to pypi? HOT 1
- No way of returning all notes?
- Neue Post Format, post type filters, and content HOT 1
- Support for type hints? HOT 1
- Mention some requirements in interactive_console.py
- 'tags' problem HOT 1
- TypeError: expected str, bytes or os.PathLike object, not BufferedReader HOT 1
- Get keys for local application HOT 2
- May I know what need to input for the default callback in order to use this lib locally? HOT 1
- .tagged Method Returning Random Posts
- 'page_number' and 'tumblelog' missing in official docs and in 'posts' function
- poll support?
- `ValueError: Only unicode objects are escapable` on client.info() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytumblr.