(self, files)
Delete is fast, no need to bother with threads or even status message
        But need to bother with encoding of error messages since they are vary,
        depending on OS and/or version of Python
Delete is fast, no need to bother with threads or even status message
        But need to bother with encoding of error messages since they are vary,
        depending on OS and/or version of Python
Delete is fast no need to bother with threads or even status message But need to bother with encoding of error messages since they are vary depending on OS and / or version of Python
def _delete(self, files):
        '''Delete is fast, no need to bother with threads or even status message
        But need to bother with encoding of error messages since they are vary,
        depending on OS and/or version of Python
        '''
        errors = []
        if ST3:
            fail = (PermissionError, FileNotFoundError)
        else:
            fail = OSError
            sys_enc = locale.getpreferredencoding(False)
        for filename in files:
            fqn = join(self.path, filename)
            try:
                if isdir(fqn):
                    shutil.rmtree(fqn)
                else:
                    os.remove(fqn)
            except fail as e:
                e = str(e).split(':')[0].replace('[Error 5] ', 'Access denied')
                if not ST3:
                    try:
                        e = str(e).decode(sys_enc)
                    except:  # failed getpreferredencoding
                        e = 'Unknown error'
                errors.append(u'{0}:\t{1}'.format(e, filename))
        self.view.run_command('dired_refresh')
        if errors:
            sublime.error_message(u'Some files couldn’t be deleted: \n\n' + '\n'.join(errors))
def _delete ( self , files ) : errors = [ ] if ST3 : fail = ( PermissionError , FileNotFoundError ) else : fail = OSError sys_enc = locale . getpreferredencoding ( False ) for filename in files : fqn = join ( self . path , filename ) try : if isdir ( fqn ) : shutil . rmtree ( fqn ) else : os . remove ( fqn ) except fail as e : e = str ( e ) . split ( ':' ) [ 0 ] . replace ( '[Error 5] ' , 'Access denied' ) if not ST3 : try : e = str ( e ) . decode ( sys_enc ) except : # failed getpreferredencoding e = 'Unknown error' errors . append ( u'{0}:\t{1}' . format ( e , filename ) ) self . view . run_command ( 'dired_refresh' ) if errors : sublime . error_message ( u'Some files couldn’t be deleted: \n\n' + ' n'.j o in(e r rors))