@staticmethod
def _handle_progress(progress_callback):
    """Calls the callback with the current progress and total bytes written/received.

        Parameters
        ----------
        progress_callback : function
            Callback method that accepts ``filename``, ``bytes_written``, and ``total_bytes``; total_bytes will be -1 for file-like
            objects.

        """
    current = 0
    while True:
        current += yield
        try:
            progress_callback(current)
        except Exception:
            continue
