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

Bad Token Error on Conversion #50

Open
rfspencer opened this issue Jul 11, 2018 · 8 comments
Open

Bad Token Error on Conversion #50

rfspencer opened this issue Jul 11, 2018 · 8 comments
Assignees

Comments

@rfspencer
Copy link

OSX 10.13.5
Cinema 4D Studio R19.053 (Build RB224935)
C4D Prototype Converter v1.2.0

I get an error when running the script converter, following the tutorial content:

   bad token: type=56, value='\r', context=(", (5, 3))
@NiklasRosenstein NiklasRosenstein self-assigned this Jul 11, 2018
@NiklasRosenstein
Copy link
Collaborator

Hi @rfspencer

I can not reproduce your issue. I need some more information, please include the full console output.

@NiklasRosenstein
Copy link
Collaborator

If possible, it would also help if you uploaded the script you are trying to convert. If you do, please do not paste the script code into the GitHub comment but instead add the file as an attachment. You can also email the file to me if you don't want to share it publicly. rosensteinniklas@gmail.com

@rfspencer
Copy link
Author

Hey @NiklasRosenstein!

Thanks for getting back to me. I've attached the script I was trying to convert; it was just the default "Hello World" script, but I also get this error when converting others, as well.

hello-world.py.zip

I also attached a screen shot, if that helps at all.
screen shot 2018-07-11 at 1 33 51 pm

@rfspencer
Copy link
Author

rfspencer commented Jul 11, 2018

And here's the console output:

Creating /Users/richspencer/Library/Preferences/MAXON/Cinema 4D R19_8DA1506D/plugins/hello-world.pyp
Traceback (most recent call last):
  File "/Users/richspencer/Library/Preferences/MAXON/Cinema 4D R19_8DA1506D/plugins/c4d_prototype_converter-v1.2.0/c4d_prototype_converter/ui/ScriptConverter.py", line 284, in on_create
    cnv.create()
  File "/Users/richspencer/Library/Preferences/MAXON/Cinema 4D R19_8DA1506D/plugins/c4d_prototype_converter-v1.2.0/c4d_prototype_converter/ui/ScriptConverter.py", line 192, in create
    code = refactor.indentation(code, self.indent)
  File "/Users/richspencer/Library/Preferences/MAXON/Cinema 4D R19_8DA1506D/plugins/c4d_prototype_converter-v1.2.0/c4d_prototype_converter/refactor.py", line 371, in indentation
    return str(refactor_string([fixer], code))
  File "/Users/richspencer/Library/Preferences/MAXON/Cinema 4D R19_8DA1506D/plugins/c4d_prototype_converter-v1.2.0/c4d_prototype_converter/refactor.py", line 60, in refactor_string
    return rt.refactor_string(code, filename)
  File "/Applications/MAXON/Cinema 4D R19/resource/modules/python/Python.osx.framework/lib/python2.7/lib2to3/refactor.py", line 380, in refactor_string
    name, err.__class__.__name__, err)
  File "/Applications/MAXON/Cinema 4D R19/resource/modules/python/Python.osx.framework/lib/python2.7/lib2to3/refactor.py", line 377, in refactor_string
    tree = self.driver.parse_string(data)
  File "/Applications/MAXON/Cinema 4D R19/resource/modules/python/Python.osx.framework/lib/python2.7/lib2to3/pgen2/driver.py", line 106, in parse_string
    return self.parse_tokens(tokens, debug)
  File "/Applications/MAXON/Cinema 4D R19/resource/modules/python/Python.osx.framework/lib/python2.7/lib2to3/pgen2/driver.py", line 71, in parse_tokens
    if p.addtoken(type, value, (prefix, start)):
  File "/Applications/MAXON/Cinema 4D R19/resource/modules/python/Python.osx.framework/lib/python2.7/lib2to3/pgen2/parse.py", line 116, in addtoken
    ilabel = self.classify(type, value, context)
  File "/Applications/MAXON/Cinema 4D R19/resource/modules/python/Python.osx.framework/lib/python2.7/lib2to3/pgen2/parse.py", line 172, in classify
    raise ParseError("bad token", type, value, context)
ParseError: bad token: type=56, value='\r', context=('', (4, 3))

@NiklasRosenstein
Copy link
Collaborator

Hi @rfspencer thanks for the all the info you provided.

I'm trying hard but I just can not reproduce the error. :-(

What is weird is that it says in the error message line 4 column 3. But line 4 in your Script is empty and thus has no column 3.

Could you please try it with all of these 3 scripts for me and see if the error persists for any or all of them?

test-scripts.zip

@jochemdk013
Copy link

Hi Niklas,

Same problem over here (with different numbers...). This is of course not my tag plugin, but no matter what I test, I always get the same error. (R19 mac os 10.12).

Hope there's a solution, tia, Jochem

screen shot 2019-01-03 at 14 27 45

screen shot 2019-01-03 at 14 28 15

@jochemdk013
Copy link

Just to add to the above... I just tested your V1.2.0 on R20 & I get the same message - fyi

@jochemdk013
Copy link

OK... one more addition. Just tested the script & prototype converter on Windows10 R19, without R20 installed and it worked fine :). Can it be and issue with both having R19 & 20 installed? Thx, Jochem

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

3 participants