debian-forge/sources
Ondřej Budai 7b0db90c76 sources/files: do not pass floats to --max-time
curl uses strtod from the C standard library to convert the --max-time's value
from string to double. However, this is what strtod expects:

nonempty sequence of decimal digits optionally containing decimal-point
character (as determined by the current C locale)

Yeah, unfortunately, the decimal-point character is determined by the current
C locale. For example, Czech and German locale uses a comma as the
decimal-point character.

For reasons I don't fully understand, Python thinks it's running on en_US
locale, even though LC_NUMERIC is set to cs_CZ, so it uses a full stop as the
decimal-point character when converting float to string. However, as written
before, curl fails to parse this because it expects comma.

The fix I chose is simple: Use math.ceil, so only an integer can be passed to
curl. Why ceil? Because --max-time == 0 sounds fishy. math.ceil should return
an integer (and it does in Python 3.8) but the documentation is not 100% clear
on this topic, so let's be paranoid and also convert it to int after the
ceiling.
2020-06-25 21:25:17 +02:00
..
org.osbuild.dnf sources/dnf: add documentation and schema 2020-06-02 09:50:14 +02:00
org.osbuild.files sources/files: do not pass floats to --max-time 2020-06-25 21:25:17 +02:00
org.osbuild.ostree sources/ostree: add documentation and schema 2020-06-02 09:50:14 +02:00