TypeError: Can't intern string
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Fedora 31
- Poetry version: 1.0.5
- Link of a Gist with the contents of your pyproject.toml file:
Issue
I’m facing this issue when building my poetry project using the new poetry-core. When looking a little deeper, it seems like the fix in commit was not applied to poetry-core.
I would love to help out with a PR, but will need some direction 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Python not interning strings when in interactive mode?
Looks like you are using anaconda, so I checked this in the console and found different ids and then wrote a function in...
Read more >Guide to String Interning in Python - Stack Abuse
String Interning is a process of storing only one copy of each distinct string value in memory. This means that, when we create...
Read more >The internals of Python string interning - guilload.com
Furthermore, string subclasses cannot be interned. ... def intern(string): if string is None or not type(string) is str: raise TypeError if ...
Read more >PyString in pyo3::types - Rust
Intern the given string. This will return a reference to the same Python string object if called repeatedly with the same string.
Read more >TypeError: cannot use a string pattern on a bytes-like
Bytes objects contain a sequence of single bytes. They are immutable, like strings, which means they cannot be changed. A bytes object is ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@darkvariantdivine definitely give you this, this is an interesting issue.
For anyone who is interested in the root case, when
tomlkit
reads in thetoml
file, the values oftool.poetry.exclude
are of tyle<class 'tomlkit.items.String'>
. This in most parts works seamlessly everwhere a string is required. However, it seems that in this particular case, since one of the values (“devops”) is an absolute path, ie. no relative path or glob,pathlib
decides to use a code path that ends up triggerring the a call tosys.intern(exclude[0])
and this is what fails.An immediate workaround would be to use
devops/**
instead ofdevops
.Thanks @finswimmer and @abn for this. Poetry is a great tool, I hope it continues to grow!