IOError: [Errno 2] Error

Source: Internet
Author: User

To do python development, you frequently encounter the following errors when manipulating files under Windows:


IOError: [Errno N]


n is the error number, as frequently encountered IOError: [Errno 2], ioerror: [Errno 5], ioerror: [Errno 13] ...

Here is a look at the common errors under Windows, here are summarized as follows:

url:http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382 (v=vs.85). aspx

System Error codes (0-499) error_success 0 (0x0)

The operation completed successfully. error_invalid_function 1 (0x1)

Incorrect function. error_file_not_found 2 (0x2)

The system cannot find the file specified. error_path_not_found 3 (0x3)

The system cannot find the path specified. error_too_many_open_files 4 (0x4)

The system cannot open the file. error_access_denied 5 (0x5)

Access is denied. error_invalid_handle 6 (0x6)

The handle is invalid. error_arena_trashed 7 (0x7)

The storage control blocks were destroyed. error_not_enough_memory 8 (0x8)

Not enough storage are available to process this command. error_invalid_block 9 (0x9)

The storage Control blocks address is invalid. error_bad_environment (0xA)

The environment is incorrect. Error_bad_format (0xB)

An attempt is made to load a and incorrect format. error_invalid_access (0xC)

The access code is invalid. error_invalid_data (0xD)

The data is invalid. error_outofmemory (0xE)

Not enough storage are available to complete this operation. error_invalid_drive (0xF)

The system cannot find the drive specified. error_current_directory (0x10)

The directory cannot be removed. error_not_same_device (0x11)

The system cannot move the file to a different disk drive. error_no_more_files (0x12)

There are no more files. error_write_protect (0x13)

The media is write protected. error_bad_unit (0x14)

The system cannot find the device specified. error_not_ready (0x15)

The device is not ready. Error_bad_command (0x16)

The device does not recognize the command. ERROR_CRC (0x17)

Data Error (cyclic redundancy check). error_bad_length (0x18)

The program issued a command but the command length is incorrect. Error_seek (0x19)

The drive cannot locate a specific area or track on the disk. error_not_dos_disk (0x1A)

The specified disk or diskette cannot be accessed. error_sector_not_found (0x1b)

The drive cannot find the sector requested. error_out_of_paper (0x1c)

The printer is out of paper. error_write_fault (0x1d)

The system cannot write to the specified device. error_read_fault (0x1E)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.