Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

AttributeError: 'dict' object has no attribute '__dict__' #61

Open
sealj553 opened this issue Sep 9, 2018 · 6 comments
Open

AttributeError: 'dict' object has no attribute '__dict__' #61

sealj553 opened this issue Sep 9, 2018 · 6 comments

Comments

@sealj553
Copy link

sealj553 commented Sep 9, 2018

Expected Behavior:

Running pros make template in a freshly-cloned pros directory builds the template project.

Actual Behavior:

The following error is shown:

Traceback (most recent call last):
  File "/usr/bin/pros", line 11, in <module>
    load_entry_point('pros-cli', 'console_scripts', 'pros')()
  File "/home/jackson/git/pros-cli/proscli/main.py", line 9, in main
    cli.main(prog_name='pros')
  File "/usr/lib/python3.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/jackson/git/pros-cli/proscli/build.py", line 26, in make
    cfg = prosconfig.ProjectConfig(prosconfig.ProjectConfig.find_project('.'))
  File "/home/jackson/git/pros-cli/prosconfig/__init__.py", line 82, in __init__
    super(ProjectConfig, self).__init__(file, error_on_decode=raise_on_error)
  File "/home/jackson/git/pros-cli/prosconfig/__init__.py", line 25, in __init__
    self.__dict__.update(jsonpickle.decode(f.read()).__dict__)
AttributeError: 'dict' object has no attribute '__dict__'

running make template works fine.

System information:

Operating System: Arch Linux
PROS Version: 2.6.1

Additional Information

This looks like a possible fix: https://stackoverflow.com/a/41672053/7112567

@edjubuh
Copy link
Member

edjubuh commented Sep 9, 2018

Can you post the content of the project.pros inside your PROS project?

@sealj553
Copy link
Author

sealj553 commented Sep 9, 2018

It's the default from pros

{
    "py/object": "pros.conductor.project.Project",
    "py/state": {
        "project_name": "hello",
        "target": "cortex",
        "templates": { },
        "upload_options": {}
    }
}

@edjubuh
Copy link
Member

edjubuh commented Sep 9, 2018

It looks like this project was created with PROS 3 and you're working with it in PROS 2. Is that correct?

@sealj553
Copy link
Author

sealj553 commented Sep 9, 2018

I'm not sure which version the project was created with, but it's the 'template' project from the pros master branch along with pros-cli (2).
I can compile as is with just make template, but would you recommend using pros cli-3-support branch along with pros-cli3?

@edjubuh
Copy link
Member

edjubuh commented Sep 9, 2018

PROS CLI 2.x.x doesn't currently have forward compatibility with projects created with PROS CLI 3.x.x. That's not something we're currently interested in implementing, but would be open to a pull request which supports this.

@sealj553 sealj553 changed the title AttributeError: 'ProjectConfig' object has no attribute '__slots__' AttributeError: 'dict' object has no attribute '__dict__' Sep 9, 2018
@sealj553
Copy link
Author

sealj553 commented Sep 9, 2018

It appears that this error is caused by a python syntax error, not anything directly relating to project files. I figured it should be a simple fix on line 25 of prosconfig/__init__.py but I don't have much experience with python.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants