Skip to content

curl respects the locale's number format setting for parsing fractional seconds, it does not enforce dot #9969

@danielfaust

Description

@danielfaust

I did this

In bash and zsh: curl --connect-timeout 3.14 https://example.com

I expected the following

The following printed out to stdout:

<!doctype html>
<html>
<head>
    <title>Example Domain</title>

...

</html>

The actual result was

curl: option --connect-timeout: expected a proper numerical parameter

curl/libcurl version

curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13
Release-Date: 2022-01-05

as well as

curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08

operating system

Ubuntu 22.04 LTS
Linux hostname 5.15.0-53-generic #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

With LC_NUMERIC="de_DE.UTF-8"

as well as

Ubuntu 20.04 LTS
Linux hostname 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

With LC_NUMERIC="de_DE.UTF-8"

workaround

Add export LC_NUMERIC="en_US.UTF-8" to environments requiring fractional seconds in the timeouts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions