Validating destination file paths

13-Oct-2020 05:36

ERROR_INVALID_NAME = 123 ''' Windows-specific error code indicating an invalid pathname.

See Also ---------- listing of all such codes.

validating destination file paths-39

greek dating in australia

''' # If this pathname is either not a string or is but is empty, this pathname # is invalid.Unless this # is the case, this exception implies an ignorable kernel or # filesystem complaint (e.g., path not found or inaccessible).# # Only the following exceptions indicate invalid pathnames: # # * Instances of the Windows-specific "Windows Error" class # defining the "winerror" attribute whose value is # "ERROR_INVALID_NAME".Malicious users may attempt to repeatedly validate pathnames residing on filesystems known to be stale or otherwise slow (e.g., NFS Samba shares); in that case, blindly statting incoming pathnames is liable to either eventually fail with connection timeouts or consume more time and resources than your feeble capacity to withstand unemployment.

import errno, os # Sadly, Python fails to provide the following magic number for us.

This function is guaranteed to _never_ raise exceptions.