poetry: poetry develop failing on non-ASCII characters
authors = [
"Sébastien Eustace <sebastien@eustace.io>"
]
$ poetry develop -vvv
[AttributeError]
'NoneType' object has no attribute 'group'
authors = [
"Sebastien Eustace <sebastien@eustace.io>"
]
Installing dependencies from lock file
Nothing to install or update
Installing poetry (0.11.0-alpha.3)
As far as I know, the re
library doesn’t have any ability to support unicode character classes but regex
can handle them properly.
I don’t know if this has been brought up before or this is a windows-only thing, considering this happened while poetry develop
ing poetry itself. as far as I checked, nobody has made an issue about this before.
Windows 10, python 3.6.4, poetry 0.11.0a3.
edit: #66 is similar.
In the meantime, catching errors:
def _get_author(self): # type: () -> dict
+ if self._authors:
+ m = AUTHOR_REGEX.match(self._authors[0])
+ else:
+ m = None
- if not self._authors:
+ if not m:
+ # log.info('Could not find an author') or whatever
return {"name": None, "email": None}
m = AUTHOR_REGEX.match(self._authors[0])
name = m.group("name")
email = m.group("email")
return {"name": name, "email": email}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 26 (12 by maintainers)
@jacebrowning Thanks for the pointer a few months back regarding
AUTHOR_REGEX
. After a bit of experimentation, I think that this has to do not with Poetry per se but rather with a bug in there
module (see https://github.com/lark-parser/lark/issues/590).Replacing
re
withregex
solves everything:So my question would now be - should I submit a pull request with
import regex as re
to Poetry? Or would adding a dependency risk breaking things? Thanks!@vlcinsky sure I understand. I just needed to get something done really quickly.
The full output:
I have installed it like this:
The same here! My lastname has an ó
I have the same problem as @laxan. Can’t init new project because of non-ascii character in my git user name.
I get the same on
poetry build
from non-ascii package names, for example:This is on MacOS. Edit: Unicode author name crashes as well.