question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
abncommented, Aug 13, 2020

@darkvariantdivine definitely give you this, this is an interesting issue.

For anyone who is interested in the root case, when tomlkit reads in the toml file, the values of tool.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 to sys.intern(exclude[0]) and this is what fails.

An immediate workaround would be to use devops/** instead of devops.

0reactions
darkvariantdivinecommented, Aug 17, 2020

Thanks @finswimmer and @abn for this. Poetry is a great tool, I hope it continues to grow!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found