Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket.getfqdn() return hostname with trailing . (dot) in WSL #113818

Open
gugupy opened this issue Jan 8, 2024 · 0 comments
Open

socket.getfqdn() return hostname with trailing . (dot) in WSL #113818

gugupy opened this issue Jan 8, 2024 · 0 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@gugupy
Copy link

gugupy commented Jan 8, 2024

Bug report

Bug description:

I faced this problem when I was working on smtplib.SMTP where ehlo falied with invalid domain name.

While debug the problem found WSL default adding the host entry in /etc/hosts as below,

...
127.0.0.1       gugupy.       gugupy

FQDN

>>> import socket
>>> socket.getfqdn()
>>> gugupy.

So self.local_hostname set to gugupy. which actually lead to the problem.

CPython versions tested on:

3.11

Operating systems tested on:

Linux, Other

@gugupy gugupy added the type-bug An unexpected behavior, bug, or error label Jan 8, 2024
@gugupy gugupy changed the title socket.getfqdn() return hostname with leading . (dot) in WSL socket.getfqdn() return hostname with trailing . (dot) in WSL Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant