def downloadLanguageGZ(self, name):
        err = None
        try:
            url = 'http://php.net/distributions/manual/php_manual_' + name + '.tar.gz'

            filename = getDocphpPath() + 'language/php_manual_' + name + '.tar.gz.downloading'

            response = urllib.request.urlopen(url)
            try:
                totalsize = int(response.headers['Content-Length'])  # assume correct header
            except NameError:
                totalsize = None
            except KeyError:
                totalsize = None

            outputfile = open(filename, 'wb')

            readsofar = 0
            chunksize = 8192
            try:
                self.downloading = name
                while(True):
                    # download chunk
                    data = response.read(chunksize)
                    if not data:  # finished downloading
                        break
                    readsofar += len(data)
                    outputfile.write(data)  # save to filename
                    if totalsize:
                        # report progress
                        percent = readsofar * 1e2 / totalsize  # assume totalsize > 0
                        sublime.status_message(package_name + ': %.0f%% checking out %s' % (percent, name,))
                    else:
                        kb = readsofar / 1024
                        sublime.status_message(package_name + (kb, name,) % ': %.0f KB checking out %s')
            finally:
                outputfile.close()
                self.downloading = False
                if totalsize and readsofar != totalsize:
                    os.unlink(filename)
                    err = 'Download failed'

        except (urllib.error.HTTPError) as e:
            err = '%s: HTTP error %s contacting API' % (__name__, str(e.code))
        except (urllib.error.URLError) as e:
            err = '%s: URL error %s contacting API' % (__name__, str(e.reason))
        except Exception as e:
            err = e.__class__.__name__

        if not err:
            if os.path.isdir(getI18nCachePath(name)):
                shutil.rmtree(getI18nCachePath(name))
            newname = getDocphpPath() + 'language/php_manual_' + name + '.tar.gz'
            if os.path.isfile(newname):
                os.unlink(newname)
            os.rename(filename, newname)
            return True

        print(err)
        sublime.message_dialog('Language ' + name + ' checkout failed. Please try again.')

        return False
dataset/ETHPy150Open acabin/docphp/docphp.py/DocphpCheckoutLanguageCommand.downloadLanguageGZ/swapped operands of `%`