Original link: https://www.kawabangga.com/posts/4783
The error is also very inexplicable, when did I compare None to String?
The main reason is that the PR submitted by the user two days ago was completely passed, and I only merged it. How can it not work after the merge to the master?
I vaguely feel that there is some dependency on the broker. If the dependencies installed before the diff may be located faster (this is why I type a line of
pip list in CI every time!) But this time I want to go directly to find Looking for what is the problem, idle is idle.
So let’s start with the wrong poetry first, and I directly add a lot of prints to its code (the advantage of Python, just change the installed package directly). Then I kept narrowing the scope and found that there is a
copy.copy in the code of poetry-core, and the content after the copy is different from the previous one:
So I started to study what is special about the object of this copy, and found that it was an object in tomlkit. Not a simple list.
Then I jumped to tomlkit to look at this object, and found that it was a custom list. The code was a bit long. It took some time to read and understand. After parsing, in order to maintain the format problem, a
Null dummy object would be added to occupy the place. Originally, this dummy would not be in the value, but once copied,
__init__ did not filter out Null, which resulted in the
None being added.
Submitted a PR to fix: https://github.com/sdispater/tomlkit/pull/221
This is not the point, the point is, this bug is not very triggerable:
- Need to use
copy.copy, except copy I can’t think of other scenarios where this problem will occur, and poetry is just used, and the copy is the classifier;
- I need to have some comments in the copied list of toml, and in my iredis, I just wrote a line of comment in order to remind myself where to find the classifier list;
These are not the point. The point is that I took a look at the repository and found that the problem with the code was introduced two days ago , and it happened to be triggered by me within two days.
These are still not the point. The point is that the author of this code is actually my brother Ming ( @frostming )! ! !
This article is reprinted from: https://www.kawabangga.com/posts/4783
This site is for inclusion only, and the copyright belongs to the original author.