Skip to content

Hostname containing Unicode characters makes pygenie/utils.py error out #18

@artwr

Description

@artwr

The "offending" line is https://github.com/Netflix/pygenie/blob/master/pygenie/utils.py#L34-L40

Even when importing unicode literals, it seems like socket.getfqdn() returns a str instead of a unicode, and the concatenation fails if the hostname contains a unicode character.

With newer Mac OSX, it seems the hostname is set with a unicode apostrophe by default e.g. "Arthur’s".

steps to reproduce on Mac OSX:

oldhost=$(scutil --get HostName)  # To save your current hostname
scutil --set HostName Arthur’s . # for instance
# Running anything importing pygenie under python 2
python2 -c "import pygenie"

It's more of an FYI, since there is an easy workaround (no unicode in the hostname)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions