-
Notifications
You must be signed in to change notification settings - Fork 48
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
ReST table breaks if package description contains unusual characters #73
Comments
I just saw that you actually let ptable do the table output. How about switching to ptable2 which is still actively developed and should have a compatible API. They might already have fixed this issue. |
@pohlt Thanks for the report. Probably you are talking about " 🐓 " emoji. In my Linux environment I got the following output: $ pip-licenses -d --format=rest
+------+---------+---------+-----------------------------------------+
| Name | Version | License | Description |
+------+---------+---------+-----------------------------------------+
| poyo | 0.5.0 | MIT | A lightweight YAML Parser for Python. ? |
+------+---------+---------+-----------------------------------------+ How is it broken in your environment? |
If switching solves this issue, it's an attractive proposition. However, there are many forked implementations of ptable on PyPI. Making a better choice among them is a difficult decision for me 😔 |
Under Windows 10 (Python 3.7) I get
which is one character too much. I agree: It's difficult to decide which prettytable fork is currently best maintained. PTable hasn't seen a commit for two years now and I'm worried it's basically dead. I'll check if ptable really causes the problem and if ptable2 would fix it. |
There is an open issue kxxoling/PTable#20 which describes the same problem. No reaction for 2.5 years. |
@pohlt Thanks for the working example on Windows 10. It was reproduced in my macOS environment. Also, I tried installing source code for ptable2 from the latest master branch. This issue has not been resolved. If this issue can be solved by using ptable2 in the future, it is better to implement a compatibility layer like P-R in the past. See also) #52 And when I'm sure ptable2 is stable and well maintained, I plan on migrating from PTable. |
After some testing and internal discussions, I would now propose to filter the data which is retrieved from pypi (enabled with a flag). Rationale:
Would you be willing to consider a PR? |
Patch is welcome!! 😄 |
Ok, now we just need someone who generates the actual PR! ;-) I'd like to get your input/guidance before starting. What I plan to do:
Does that make sense to you? |
@pohlt All right, I'll express my opinion.
I think it's fine to adopt it as an opt-out or default behavior. This is because we already do the equivalent when we load the package license file as a stream. Note: However, we have adopted
Yes, I agree.
I agree with Testing and documenting that users can specify the |
This issue has been resolved in pip-licenses 2.3.0 😄 |
Some packages have unusual characters in their description (e.g. poyo). These characters causes ReST tables to break their column alignment.
Filtering the input strings for regular alpha-numerical characters would fix this, I guess.
The text was updated successfully, but these errors were encountered: