Éric Araujo <mer...@netwok.org> added the comment:

> Arguably, the command shouldn't fail, it should simply omit the bdist_msi 
> command from the listing.
> But as _msi is part of Python, the installation is broken if it isn't present 
> so I guess that
> handling the issue gracefully isn't really important.
My first feeling was agreement with your request, but then you added that _msi 
is part of Python, so I’m not sure we should increase the code complexity for a 
non-issue.

> (I assume the missing _msi extension isn't an issue on Unix).
Yep, see Lib/packaging/command/__init__.py:

  # XXX this is crappy
  if os.name == 'nt':
      _COMMANDS['bdist_msi'] = 'packaging.command.bdist_msi.bdist_msi'

> it feels symptomatic of a general lack of clean error handling, which I think 
> should be fixed :-(
I suppose the traceback would have been much more useful with #12703 fixed.  
(There are a number of resolve_name-like functions out there, it’s sad to see 
it reimplemented with various degree in the quality of error reporting over and 
over again.)

Besides the problem with resolve_name, I think there’s a specific problem with 
bdist_msi.  As you can see with the comment I added in the code and quoted 
above, I’m not satisfied with the way we add bdist_msi to the set of available 
commands.  It’s the only command to be special-cased; I guess it can’t be 
helped, so maybe I should remove the comment.  I could change the conditional 
to register the command if _msi can be successfully imported; however, I fear 
this would hide bugs, as _msi is a part of a Python installation on Windows, so 
I’d rather continue to check os.name.  Would you be satisfied with a more 
helpful traceback that would point you immediately to missing msi?  Do you 
prefer that bdist_msi catch an ImportError for _msi and print a short error 
message instead of a traceback in all its glory?

----------
assignee: tarek -> eric.araujo
title: pysetup run --list-commands fails with a traceback -> Improve detection 
of availability of bdist_msi command
versions: +3rd party

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13172>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to