Passed AP6 and failed last challenge EJ5

I’m stuck on Stage #AP6

I changed my code to pass stage #AP6 and in the test logs it shows I passed but it failed me in last stage #EJ5. No clue what broke it

Here are my logs:

And here’s a snippet of my main function:


def main():
    global file_directory
    if len(sys.argv) != 3 or sys.argv[1] != "--directory":
        print("Usage: ./ --directory <directory_path>")

    file_directory = sys.argv[2]
    server_socket = socket.create_server(("localhost", 4221))
    print("Server is running on port 4221...")

        while True:
            conn, addr = server_socket.accept()  # wait for client
            thread = threading.Thread(target=handle_client, args=(conn, addr))
    except KeyboardInterrupt:
        print("Server is shutting down...")

The output clearly states that the connection wss refused.

I think this is where the problem is, not all stages will include the --directory flag, so you’ll need to treat this as optional.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.