-
Notifications
You must be signed in to change notification settings - Fork 307
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
Silent failure when wrong distribution format #895
Comments
Ah, I can fix the issue in logging.basicConfig(level=logging.WARNING)
return ...so I guess this is an issue with |
...huh, apparently it's because the
|
Thanks for the detailed report and investigation. It certainly sounds like logging isn't configured properly to catch all scenarios. I'll take a closer look, hopefully within the next week. |
Nice, thank you! FWIW, following this SO answer to print a message whenever a logger is disabled: https://stackoverflow.com/a/28694704
...and the thing at def _handle_existing_loggers(existing, child_loggers, disable_existing):
"""
When (re)configuring logging, handle loggers which were in the previous
configuration but are not in the new configuration. There's no point
deleting them as other threads may continue to hold references to them;
and by disabling them, you stop them doing any logging.
However, don't disable children of named loggers, as that's probably not
what was intended by the user. Also, allow existing loggers to NOT be
disabled if disable_existing is false.
"""
root = logging.root
for log in existing:
logger = root.manager.loggerDict[log]
if log in child_loggers:
if not isinstance(logger, logging.PlaceHolder):
logger.setLevel(logging.NOTSET)
logger.handlers = []
logger.propagate = True
else:
logger.disabled = disable_existing ...so the issue seems to be that loggers had already been created (and configured?..) by the time Anyway -- that's enough from me. Thanks for looking into it! |
I can reproduce the behavior you described by running
Adding a
So, when run as a module, the exception is reported using the Lines 51 to 70 in 4223ee1
I'm not sure if that choice was correct. Will explore, and open a PR. |
Your Environment
Thank you for taking the time to report an issue.
To more efficiently resolve this issue, we'd like to know some basic information about your system and setup.
I installed twine into a virtualenv with
pip install -U twine
.I'm targeting TestPyPi.
The Issue
The
twine upload
command is silently failing.It's my fault it's failing: after running
python -m build
, I wanted to examine the source archive, so I rangunzip dist/zingest-shared-0.0.1.tar.gz
, which transformed it into a TAR file,dist/zingest-shared-0.0.1.tar
.However,
twine upload
was silently failing because of this:...I had to stick a breakpoint in
twine/commands/upload.py
withipdb.set_trace()
to figure out what the problem was:...that error bubbles up to
twine/__main__.py
, where there is an attempt to log it, but nothing is output (maybe logging is never configured?):Steps to Reproduce
python -m build
gunzip dist/*.gz
python -m twine upload -r testpypi dist/*
The text was updated successfully, but these errors were encountered: