Code duplication in check_latest_version

Bug #1410693 reported by Phill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Confirmed
Wishlist
Unassigned

Bug Description

check_latest_version in core.utils.__init__.py duplicates code to download and retry on failure of the version check file. This code is similar to the code in get_webpage. We could reduce duplication by using get_webpage

Duplicate code:

        retries = 0
        while True:
            try:
                remote_version = str(urllib.request.urlopen(req, None,
                                                            timeout=CONNECTION_TIMEOUT).read().decode()).strip()
            except ConnectionException:
                if retries > CONNECTION_RETRIES:
                    log.exception('Failed to download the latest OpenLP version file')
                else:
                    retries += 1
                    time.sleep(0.1)
                    continue
            break

Phill (phill-ridout)
Changed in openlp:
importance: Undecided → Wishlist
Revision history for this message
Ken Roberts (alisonken1) wrote :

Working on network stack refactoring. Will be fixed then.

Phill (phill-ridout)
Changed in openlp:
assignee: nobody → Ken Roberts (alisonken1)
status: New → In Progress
Ken Roberts (alisonken1)
Changed in openlp:
importance: Wishlist → Medium
Phill (phill-ridout)
Changed in openlp:
milestone: none → 2.3.0
Tim Bentley (trb143)
Changed in openlp:
milestone: 2.3.0 → none
Tim Bentley (trb143)
Changed in openlp:
assignee: Ken Roberts (alisonken1) → nobody
Tim Bentley (trb143)
Changed in openlp:
status: In Progress → Confirmed
Revision history for this message
Phill (phill-ridout) wrote :

Changed to wishlist as this isnt really a bug

Changed in openlp:
importance: Medium → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.