askedrelic / journal

Python CLI tool to help with keeping a work/personal journal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python3 support

jtrip opened this issue · comments

When I try to use this with Python 3.4 I am receiving an unexpected error.

Traceback (most recent call last):
 File "/usr/local/bin/journal", line 9, in <module>
   load_entry_point('journal==0.4.0', 'console_scripts', 'journal')()
 File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in load_entry_point
   return get_distribution(dist).load_entry_point(group, name)
 File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in load_entry_point
   return ep.load()
 File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load
   ['__name__'])
 File "/usr/local/lib/python3.4/dist-packages/journal/main.py", line 80
   print "journal: error: config file '" + args.config_file + "' not found"
                                       ^
SyntaxError: Missing parentheses in call to 'print'

I am tempted to see if I can fix it myself, just thought I would post here and see if you or anyone else had taken a look at Python 3 support. Maybe it is just fixing some print statements (easy) or maybe there will be more to it.

Fix away! I haven't touched this project in awhile, but it was written for Python 2.7. I'd support upgrading it to Py3.

My understanding is that targeting Py3.5 as the default and using 3to2 to backport makes sense, but I've also seen six used to support py2/3 at the same time.

I just submitted a pull request for python3 compatibility. It's my first ever pull request, so any feedback is appreciated!

congrats on your first PR @philerooski 🎆

I will take a look