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

Strange Issue with (possibly within my env?) #577

haydenflinner opened this issue Sep 20, 2018 · 2 comments · Fixed by #607

Strange Issue with (possibly within my env?) #577

haydenflinner opened this issue Sep 20, 2018 · 2 comments · Fixed by #607


Copy link

haydenflinner commented Sep 20, 2018

Hey, loving the library so far. Very handy and all it's missing to me is make-like dependency refresh recognition, which I might get around to working on eventually if there's any interest.

Had a script that was working, then stopped working after I poked around reading the source. Here's the traceback

Traceback (most recent call last):
  File "/spare/local/hflinner/venv-infra/bin/invoke", line 11, in <module>
  File "/spare/local/hflinner/venv-infra/lib/python2.7/site-packages/invoke/", line 363, in run
  File "/spare/local/hflinner/venv-infra/lib/python2.7/site-packages/invoke/", line 532, in execute
  File "/spare/local/hflinner/venv-infra/lib/python2.7/site-packages/invoke/", line 129, in execute
	result = call.task(*args, **call.kwargs)
  File "/spare/local/hflinner/venv-infra/lib/python2.7/site-packages/invoke/", line 128, in call
	result = self.body(*args, **kwargs)
  File "/spare/local/hflinner/invoke/myproj/tools/tests/", line 23, in build1
  File "/spare/local/hflinner/venv-infra/lib/python2.7/site-packages/invoke/", line 94, in run
	return self._run(runner, command, **kwargs)
  File "/spare/local/hflinner/venv-infra/lib/python2.7/site-packages/invoke/", line 100, in _run
	command = self._prefix_commands(command)Had a script that was working, then stopped working after I poked around reading 
  File "/spare/local/hflinner/venv-infra/lib/python2.7/site-packages/invoke/", line 242, in _prefix_commands
	current_directory = self.cwd
  File "/spare/local/hflinner/venv-infra/lib/python2.7/site-packages/invoke/", line 125, in getattr
	raise AttributeError(err)
AttributeError: No attribute or config key found for 'cwd'

Valid keys: ['Path', 'debug', 'find_config', 'find_here', 'lazy', 'listen', 'log_dir', 'make',  'market', 'mytarget', 'run', 'runners', 'server', 'set_paths', 'sudo', 'super_repo_root', 'task', 'tasks', 'workspace']

Valid real attributes: ['cd', 'clear', 'config', 'cwd', 'from_data', 'pop', 'popitem', 'prefix', 'run', 'setdefault', 'sudo', 'update']

Notice that the error is that cwd isn't found but cwd is a valid real attribute. This happened after I poked around in the source a bit, so I suspected it was my fault for accidentally changing something. So I rm -rf invoke* 'd in my site-packages directory and reinstalled, but the problem persists. There's nothing that seems suspicious to me in my config. I'm executing invoke build1 mytarget where build1 looks like this

def build1(ctx, target):"Releasing {} to {}"
                .format(target, ctx.make.release_dir))
   cfg = ctx[target]

Where the traceback is erroring out on the Adding a cwd field to my "fixes" the issue. But this function used to work!

Note: Fixed my error, turned out to be something that I think could be handled better?
Where repo_root is a pathlib2 Path obj, not a string (my is somewhat large and involved).

Copy link

fndari commented Sep 26, 2018

This seems to be the same as #454. I submitted a mini-PR (#583) to do exactly what you ended up doing, but on the side.

Copy link

Let's consider this duplicated by the other issues @fndari mentions plus the other linked one above - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging a pull request may close this issue.

3 participants