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

python -m pdm list get an error #19

Closed
stacklens opened this issue Feb 6, 2020 · 0 comments · Fixed by #20
Closed

python -m pdm list get an error #19

stacklens opened this issue Feb 6, 2020 · 0 comments · Fixed by #20
Assignees
Labels
🐛 bug Something isn't working

Comments

@stacklens
Copy link

Environment: Windows 10, Python 3.7

When the library is empty, the following error occurs during python -m pdm list:

C:\Users\dusai>python -m pdm add cowsay
Adding packages to default dependencies: cowsay
Traceback (most recent call last):
  File "C:\Users\dusai\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\dusai\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\dusai\AppData\Roaming\Python\Python37\site-packages\pdm\__main__.py", line 4, in <module>
    cli.main()
  File "C:\Users\dusai\AppData\Local\Programs\Python\Python37\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "C:\Users\dusai\AppData\Local\Programs\Python\Python37\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\dusai\AppData\Local\Programs\Python\Python37\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\dusai\AppData\Local\Programs\Python\Python37\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\dusai\AppData\Local\Programs\Python\Python37\lib\site-packages\click\decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "C:\Users\dusai\AppData\Local\Programs\Python\Python37\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\dusai\AppData\Roaming\Python\Python37\site-packages\pdm\cli\commands.py", line 161, in add
    actions.do_add(project, dev, section, sync, save, strategy, editables, packages)
  File "C:\Users\dusai\AppData\Roaming\Python\Python37\site-packages\pdm\cli\actions.py", line 175, in do_add
    project.add_dependencies(requirements)
  File "C:\Users\dusai\AppData\Roaming\Python\Python37\site-packages\pdm\project\core.py", line 261, in add_dependencies
    deps = self.tool_settings["dependencies"]
  File "C:\Users\dusai\AppData\Roaming\Python\Python37\site-packages\pdm\project\core.py", line 35, in getter
    _cache = func(self, *args, **kwargs)
  File "C:\Users\dusai\AppData\Roaming\Python\Python37\site-packages\pdm\project\core.py", line 91, in tool_settings
    data = data.setdefault(sec, {})
AttributeError: 'NoneType' object has no attribute 'setdefault'

When the library has any sitepackage, the error disappears:

C:\Users\dusai>python -m pdm list
pdmtest  1.0.0 (-e c:\users\dusai)
cowsay   2.0.3

😆😆😆It's a great tool. Keep going!😆😆😆

@frostming frostming added the 🐛 bug Something isn't working label Feb 6, 2020
@frostming frostming self-assigned this Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants