Search code examples
pythonexit-code

What does exit code 77 mean in Python?


Does anyone know what does exit code 77 mean? I am using Python 3.7 with Pycharm as an IDE. Whenever I attempt to run any program, the output ends after a few seconds saying

Process finished with exit code 77

This did not happen before at any time, but started happening a few months back, and I simply ignored it, but it didn't get better with time. I think this error also happens with the prompt, as the prompt just suddenly exits after a while.

How do I fix this?


Solution

  • On all Unix operating systems, every time a process exits, it returns an exit status that tells the operating system whether the process ran successfully or encountered some sort of failure mode.

    Knowing whether a tool is successful or not is important, but providing more information to the rest of the system has many advantages. Unfortunately, there are no universal standards for exit codes that go beyond the standard failure code.

    The closest there is to an official extended standard comes from the BSD family of operating systems. The header file sysexits.h defines 15 new error statuses in the range of 64 to 78. These include options for returning based on both system errors and user errors. Unlike with C, sysexits.h does not declare 1 as the generic failure exit status, but instead covers most needs under the new statuses. The exit statuses provided by sysexits.h are as follows:

    64 - Command line usage error
    65 - Data format error
    66 - Input is not openable
    67 - Addressee unknown
    68 - Unknown host name
    69 - Service unavailable
    70 - Internal software error
    71 - System error
    72 - Critical OS file missing
    73 - Can no create output file
    74 - I/O error
    75 - Temporary failure
    76 - Remote error in protocol
    77 - Permission denied
    78 - Configuration error
    

    check this link