ronaldoussoren / py2app

py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
Other
342 stars 36 forks source link

py2applet --help crashes with `TypeError: 'NoneType' object is not subscriptable` out of the box #447

Closed glyph closed 2 years ago

glyph commented 2 years ago
$ mktmpenv 
 ↩ Tue May 17 22:29:39 PDT 2022
virtualenvwrapper.user_scripts creating /Users/glyph/.virtualenvs/tmp-ccc58c448feec28/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/glyph/.virtualenvs/tmp-ccc58c448feec28/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/glyph/.virtualenvs/tmp-ccc58c448feec28/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/glyph/.virtualenvs/tmp-ccc58c448feec28/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/glyph/.virtualenvs/tmp-ccc58c448feec28/bin/get_env_details
This is a temporary environment. It will be deleted when you run 'deactivate'.
(tmp-ccc58c448feec28) $ pip install py2app
 ↩ Tue May 17 22:29:43 PDT 2022
Looking in indexes: http://127.0.0.1:3141/root/plus/+simple/
Collecting py2app
  Using cached http://127.0.0.1:3141/root/pypi/%2Bf/3e3/3e576f86c8e6e/py2app-0.28-py2.py3-none-any.whl (833 kB)
Collecting altgraph>=0.16
  Using cached http://127.0.0.1:3141/root/pypi/%2Bf/743/628f2ac6a7c26/altgraph-0.17.2-py2.py3-none-any.whl (21 kB)
Collecting modulegraph>=0.17
  Using cached http://127.0.0.1:3141/root/pypi/%2Bf/798/5a8b3d97307b2/modulegraph-0.19.2-py2.py3-none-any.whl (33 kB)
Collecting macholib>=1.16
  Using cached http://127.0.0.1:3141/root/pypi/%2Bf/5a0/742b587e6e57b/macholib-1.16-py2.py3-none-any.whl (37 kB)
Requirement already satisfied: setuptools in ./.virtualenvs/tmp-ccc58c448feec28/lib/python3.10/site-packages (from modulegraph>=0.17->py2app) (62.1.0)
Installing collected packages: altgraph, modulegraph, macholib, py2app
Successfully installed altgraph-0.17.2 macholib-1.16 modulegraph-0.19.2 py2app-0.28
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the '/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/bin/python -m pip install --upgrade pip' command.
(tmp-ccc58c448feec28) $ py2applet --help
 ↩ Tue May 17 22:30:43 PDT 2022
Traceback (most recent call last):
  File "/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/bin/py2applet", line 8, in <module>
    sys.exit(main())
  File "/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/lib/python3.10/site-packages/py2app/script_py2applet.py", line 143, in main
    build(args, scripts, data_files, options)
  File "/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/lib/python3.10/site-packages/py2app/script_py2applet.py", line 191, in build
    d = setup(
  File "/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 109, in setup
    _setup_distribution = dist = klass(attrs)
  File "/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/lib/python3.10/site-packages/setuptools/dist.py", line 462, in __init__
    _Distribution.__init__(
  File "/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 293, in __init__
    self.finalize_options()
  File "/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/lib/python3.10/site-packages/setuptools/dist.py", line 886, in finalize_options
    ep(self)
  File "/Users/glyph/.virtualenvs/tmp-ccc58c448feec28/lib/python3.10/site-packages/py2app/build_app.py", line 118, in finalize_distribution_options
    base = targets[0].get_dest_base()
TypeError: 'NoneType' object is not subscriptable
(tmp-ccc58c448feec28) $ 
ronaldoussoren commented 2 years ago

Thanks for the report, py2applet isn't properly covered by tests and is a tool that a seldomly use myself.

The bug was introduced by a fix for #414.