braceio / tags

The simplest static site generator
MIT License
191 stars 21 forks source link

Build Exception #4

Closed alixaxel closed 10 years ago

alixaxel commented 10 years ago
alix@900X4C:~/CChimp$ tags -r ./source/ -o ./build/ build
Building site from './source/' into './build/'
Traceback (most recent call last):
  File "/usr/local/bin/tags", line 5, in <module>
    pkg_resources.run_script('brace-tags==1.0.8', 'tags')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/EGG-INFO/scripts/tags", line 61, in <module>
    force=args.force)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/tags/generator.py", line 64, in build_files
    utils.copy_file(filepath, destpath)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/tags/utils.py", line 51, in copy_file
    os.makedirs(filedir, create_mode)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: './build/tatic/style/index'

Besides failing for a weird reason, the source path is ./source/static/style/index.

colevscode commented 10 years ago

Any chance you'd be willing to zip up a copy of your project and send it to support at brace.io?

alixaxel commented 10 years ago

@colevscode It's pretty basic, but you can download it directly from my Dropbox.

Seems like there's a bug with the way the paths are parsed, changed it to:

alix@900X4C:~/CChimp$ tags -r source -o build -w serve

And that specific error disappeared, build/tatic also became build/static.

Then I added 2 partials and it panicked again:

alix@900X4C:~/CChimp$ tags -r source -o build -w serve
HTTP server started on port 8000
Building site from 'source' into 'build'
Traceback (most recent call last):
  File "/usr/local/bin/tags", line 5, in <module>
    pkg_resources.run_script('brace-tags==1.0.8', 'tags')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/EGG-INFO/scripts/tags", line 70, in <module>
    force=args.force)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/tags/generator.py", line 171, in serve_files
    force=force)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/tags/generator.py", line 60, in build_files
    build_file(filename, destfile, root=root)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/tags/generator.py", line 28, in build_file
    output = tags.render(content, filename=filename, rootdir=root)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/tags/tags.py", line 58, in render
    return lang.parse(content, filename=filename, rootdir=rootdir)
  File "/usr/local/lib/python2.7/dist-packages/brace_tags-1.0.8-py2.7.egg/tags/templatelang.py", line 227, in parse
    return parser.transformString(string)
  File "/usr/local/lib/python2.7/dist-packages/pyparsing-2.0.1-py2.7.egg/pyparsing.py", line 1120, in transformString
    return "".join(map(_ustr,_flatten(out)))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 67: ordinal not in range(128)
alixaxel commented 10 years ago

I traced down the cause of this last error, related to #1:

<p>Copyright © 2014, Compliance Chimp</p>

The © was causing the problem, I guess the partial doesn't inherit the charset from the main file.

colevscode commented 10 years ago

Ok 1.0.10 includes fixes to both the extended character issue, and the weird path problem. Thanks for pointing these out!

NinaCarlino commented 10 years ago

Hi! I am using 1.0.10 and am still having these issues. Has anyone else been having these issues after upgrading? I'm runing 1.0.10 on Mac OS:

$ tags serve
HTTP server started on port 8000
Building site from '.' into '_site'
Traceback (most recent call last):
  File "/usr/local/bin/tags", line 5, in <module>
    pkg_resources.run_script('brace-tags==1.0.10', 'tags')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 489, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1214, in run_script
    exec script_code in namespace, namespace
  File "/Library/Python/2.7/site-packages/brace_tags-1.0.10-py2.7.egg/EGG-INFO/scripts/tags", line 70, in <module>

  File "build/bdist.macosx-10.9-intel/egg/tags/generator.py", line 171, in serve_files
  File "build/bdist.macosx-10.9-intel/egg/tags/generator.py", line 64, in build_files
  File "build/bdist.macosx-10.9-intel/egg/tags/utils.py", line 52, in copy_file
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '_site/.git/objects/10'