Skip to content

Catch urllib.request.urlopen and response.read() errors better #48706

@haampie

Description

@haampie

#45683 improved dealing with TimeoutError in various places

  • No support for Python < 3.10 where socket.timeout is not an alias for TimeoutError. Both TimeoutError and old socket.timeout inherit from OSError, so better to catch that generic exception.
  • Not all read() calls were wrapped in try-except blocks, only urlopen().
  • Code related to CDash doesn't use any try-except blocks, but incorrectly looks at getcode().

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions