Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python 3.14.0a2 should have raised exception when a socket is already in used, shouldn't it? #127319

Closed
Labels
3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@rayluo

Description

@rayluo

Bug report

Bug description:

In earlier versions of Python all the way to 3.13, it would not allow a server to listen on a port that has already been used, and rightfully so.

$ python -m http.server 8000Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...# Trying to start the second server on the same port$ python -m http.server 8000Traceback (most recent call last):  File"<frozen runpy>", line 198,in _run_module_as_main  File"<frozen runpy>", line 88,in _run_code  File"/usr/lib/python3.11/http/server.py", line 1309,in<module>    test(  File"/usr/lib/python3.11/http/server.py", line 1256,intest    with ServerClass(addr, HandlerClass) as httpd:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/usr/lib/python3.11/socketserver.py", line 456,in __init__self.server_bind()  File"/usr/lib/python3.11/http/server.py", line 1303,in server_bindreturnsuper().server_bind()           ^^^^^^^^^^^^^^^^^^^^^  File"/usr/lib/python3.11/http/server.py", line 136,in server_bind    socketserver.TCPServer.server_bind(self)  File"/usr/lib/python3.11/socketserver.py", line 472,in server_bind    self.socket.bind(self.server_address)OSError: [Errno 98] Address alreadyin use

But in Python 3.14.0a2, the second command would also start a server without exception. Is that expected?

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp