datadesk / django-bigbuild

The open-source engine that powers bigbuilder, the Los Angeles Times Data Desk's system for publishing standalone pages
http://www.latimes.com/projects/
MIT License
24 stars 0 forks source link

upstream bug in python-frontmatter 0.4 is crashing new installs #38

Closed palewire closed 7 years ago

palewire commented 7 years ago

we will need to adjust our code to handle that change.

cc @eyeseast

eyeseast commented 7 years ago

What's the error you're getting?

Sent from my iPhone

On Mar 7, 2017, at 9:51 PM, Ben Welsh notifications@github.com wrote:

we will need to adjust our code to handle that change.

cc @eyeseast

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

palewire commented 7 years ago

  File "manage.py", line 8, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/bigbuild/management/commands/createpage.py", line 70, in handle
    self.create_page_directory(page)
  File "/Users/ryanbmarx/ctbigbuilder/repo/config/toolbox/management/commands/createpage.py", line 51, in create_page_directory
    dark=self.dark,
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/bigbuild/models/pages.py", line 70, in create_directory
    self.write_frontmatter()
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/bigbuild/models/pages.py", line 95, in write_frontmatter
    frontmatter.dump(self, path or self.frontmatter_path)
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/frontmatter/__init__.py", line 153, in dump
    content = dumps(post, handler, **kwargs).encode(encoding)
  File "/Users/ryanbmarx/ctbigbuilder/lib/python2.7/site-packages/frontmatter/__init__.py", line 183, in dumps
    handler = post.handler or YAMLHandler()
AttributeError: 'Page' object has no attribute 'handler'```
palewire commented 7 years ago

I'm guessing it's post.handler.

eyeseast commented 7 years ago

Thought that might be the case. I can push a fix that'll make it smoother.

The other you can and probably should do is explicitly set a handler, whether it's YAMLHandler or something else.

palewire commented 7 years ago

Okie dokie. No problem. I've been thinking of rewriting my frontmatter system inside a Django serializer so maybe this is the time. FWIW, the bug does signal you may have lost a chunk of backward compatibility with your upgrade. Might be worth flipping up the big digit on the next version number.

eyeseast commented 7 years ago

Yeah, was wondering about if it's time for a bigger version.

Here's a PR that fixes the issue: https://github.com/eyeseast/python-frontmatter/pull/34

palewire commented 7 years ago

Thank you.

eyeseast commented 7 years ago

New release pushed and published as v0.4.1. This should actually preserve backwards compatibility, at least as far as what I outlined in the original readme. Let me know if you run into other issues.