Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'bytes' object has no attribute 'encode' #15

Closed
rabernat opened this issue Feb 5, 2018 · 1 comment
Closed

'bytes' object has no attribute 'encode' #15

rabernat opened this issue Feb 5, 2018 · 1 comment

Comments

@rabernat
Copy link

rabernat commented Feb 5, 2018

Thanks for sharing this valuable tool.

I am trying to run autopxd on this header

 autopxd jigsaw_jig_t.h test.pxd

When I do so, I get the following error

Traceback (most recent call last):
  File "/Users/rpa/anaconda/envs/geo_scipy/bin/autopxd", line 11, in <module>
    sys.exit(cli())
  File "/Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/autopxd/__init__.py", line 341, in cli
    outfile.write(translate(infile.read(), infile.name))
  File "/Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/autopxd/__init__.py", line 333, in translate
    p.visit(parse(code, extra_cpp_args=['-I', extra_incdir]))
  File "/Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/autopxd/__init__.py", line 319, in parse
    preprocessed = preprocess(code, extra_cpp_args=extra_cpp_args)
  File "/Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/autopxd/__init__.py", line 310, in preprocess
    result.append(proc.communicate(input=code.encode('utf-8'))[0])
AttributeError: 'bytes' object has no attribute 'encode'

And then, a second later, an additional error:

error: no such file or directory: 'c'
clang: warning: /Users/rpa/anaconda/envs/geo_scipy/lib/python3.6/site-packages/autopxd/include: 'linker' input unused [-Wunused-command-line-argument]

I am using python 3.6 via conda on Mac OS.

Any advice would be appreciated.

@rabernat
Copy link
Author

rabernat commented Feb 5, 2018

Just realized this is a duplicate of #12. Sorry for the noise.

@rabernat rabernat closed this as completed Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant