ekaitz-zarraga / droWMark

VIM plugin to post in Wordpress using Markdown
http://www.vim.org/scripts/script.php?script_id=5374
GNU General Public License v3.0
0 stars 1 forks source link

Python 3 Support #1

Open ekaitz-zarraga opened 8 years ago

ekaitz-zarraga commented 8 years ago

Running in python3.5 raises this exception. Looks related with internal libraries of XML RPC

Error detected while processing function PostWordPress:
line   25:
Traceback (most recent call last):
  File "/usr/lib/python3.5/xmlrpc/client.py", line 509, in __dump
    f = self.dispatch[type(value)]
KeyError: <class 'map'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/kaditx/projects/dotfiles/vim/.vim/bundle/droWMark/plugin/drowmark.py", line 77, in <module>
    post.id = wp.call(NewPost(post)) # Post it!
  File "/usr/local/lib/python3.5/dist-packages/wordpress_xmlrpc/base.py", line 37, in call
    raw_result = server_method(*args)
  File "/usr/lib/python3.5/xmlrpc/client.py", line 1089, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.5/xmlrpc/client.py", line 1423, in __request
    allow_none=self.__allow_none).encode(self.__encoding, 'xmlcharrefreplace')
  File "/usr/lib/python3.5/xmlrpc/client.py", line 948, in dumps
    data = m.dumps(params)
  File "/usr/lib/python3.5/xmlrpc/client.py", line 501, in dumps
    dump(v, write)
  File "/usr/lib/python3.5/xmlrpc/client.py", line 523, in __dump
    f(self, value, write)
  File "/usr/lib/python3.5/xmlrpc/client.py", line 594, in dump_struct
    dump(v, write)
  File "/usr/lib/python3.5/xmlrpc/client.py", line 523, in __dump
    f(self, value, write)
  File "/usr/lib/python3.5/xmlrpc/client.py", line 594, in dump_struct
    dump(v, write)
  File "/usr/lib/python3.5/xmlrpc/client.py", line 513, in __dump
    raise TypeError("cannot marshal %s objects" % type(value))
TypeError: cannot marshal <class 'map'> objects
Press ENTER or type command to continue
ekaitz-zarraga commented 8 years ago

Work on branch python3.5support: https://github.com/ekaitz-zarraga/droWMark/tree/python3.5support

OliverLeitner commented 7 years ago

hey guys, just wanted to let you know that i have my fork of droWMark python3 working.

it autodetects if you got python2 or python3, and uses the binary accordingly.

ekaitz-zarraga commented 7 years ago

Hey!

I've been looking your advances and it looks great. I need to spend some time merging all you made but I want to test it first and I don't have enough time for it.

About Python3, my code also checks python2 or python3, but this issue goes further than that. When I opened it WordpressXML-RPC library was broken for python3 and I was unable to make it work. Did you experiment something similar?

I want to thank you for all the work you made. If you can, please, separate it in functionalities and make some pull requests. That way is easier for me to test everything.

All the best.

OliverLeitner commented 7 years ago

i had different things hang..., first of all the simple stuff, needed to change the print command to have brackets, which is a p3 must..., thats why i actually needed the additional python-future module, as this enables you to load p3 module specifics in p2.

then there was a little problem with map, i have it currently surrounded by list, but ill have a deeper look into that, as i want this to be cleaner...

then theres no pyfile anymore, so i switched the vimscript of postwordpress to using the normal commandline.

theres more to be done, i.e. running pylint makes my eyes bleed..., but now it runs without breaking over here... if you experience anything, please let me know...

i am planning on splitting up things a bit..., to make it easier to read, so that should help in putting things back into yours..., and i also still got a little problem in the editing, as it looses formatting on the way..., but thats probably a 1-2 hours fix... so no biggy...

ekaitz-zarraga commented 7 years ago

Perfect then. Keep working in your part, making stuff easier to read and I'll check the result and merge it here. Right?

Meanwhile I'll try to take a look to what you have done and maybe propose some changes.

Thank you for your time!

OliverLeitner commented 7 years ago

if i find out how that pull request thing works... never done that so far...

ekaitz-zarraga commented 7 years ago

Good moment to start ;)