-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add --report argument to __main__.py to omit supported formats #7818
Changes from 3 commits
5b20811
ab9dfd8
89c44be
ca63a12
01fdf2f
970c691
4dbc428
07f2b96
e5a46ef
a619a8d
ff523e3
7e71621
1ac1540
6b0a79c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,9 +129,15 @@ def test_pilinfo() -> None: | |
while lines[0].startswith(" "): | ||
lines = lines[1:] | ||
assert lines[0] == "-" * 68 | ||
assert lines[1].startswith("Python modules loaded from ") | ||
assert lines[2].startswith("Binary modules loaded from ") | ||
assert lines[3] == "-" * 68 | ||
assert lines[1].startswith("Python executable is") | ||
lines = lines[2:] | ||
if lines[0].startswith("Environment Python files loaded from"): | ||
lines = lines[1:] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for the record, this happens for... virtual environments? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct: https://docs.python.org/3/library/sys.html#sys.base_prefix I'm not sure if this can also happen outside of a virtual environment, e.g. on Conda, so I didn't want to explicitly state "Virtual Environment Python files...". |
||
assert lines[0].startswith("System Python files loaded from") | ||
assert lines[1] == "-" * 68 | ||
assert lines[2].startswith("Python Pillow modules loaded from ") | ||
assert lines[3].startswith("Binary Pillow modules loaded from ") | ||
assert lines[4] == "-" * 68 | ||
jpeg = ( | ||
"\n" | ||
+ "-" * 68 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
|
||
from .features import pilinfo | ||
|
||
pilinfo() | ||
pilinfo(supported_formats="--bugreport" not in sys.argv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given some of the issues that we've dealt with, I can imagine users running
python3 -m PIL --bugreport
even if they're using a copy of Python other thanpython3
to invoke their code.Would it be better to ask users to paste the output of
from PIL import features;features.pilinfo(supported_formats=False)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. That also avoids the issue of
--bugreport
not being present in older versions.However, I think adding the option
python3 -m PIL --bugreport
is still useful on its own.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
--bugreport
be documented somewhere then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created nulano#31
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we suggest both? I like the idea of making it extremely easy as a first suggestion:
Paste the output of
python3 -m PIL --bugreport
or the output of the following Python code:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just concerned about users following
python3 -m PIL --bugreport
so verbatim that they don't change the Python command to what they are using to run their script, e.g. #7532 (comment)However, maybe it is better to make most users lives easier than to cater to absolutely everyone.