Skip to content

--stderr does not direct all stderr writes to file #10491

Closed
@u20221022

Description

@u20221022

I did this

curl.exe -I --stderr err.txt --write-out "%{stderr}%{json}" "https://curl.se/" > Nul
{"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":null,"ftp_entry_path":null,"http_code":200,"http_connect":0,"http_version":"2","local_ip":"?.?.?.?","local_port":?,"method":"HEAD","num_connects":1,"num_headers":21,"num_redirects":0,"proxy_ssl_verify_result":0,"redirect_url":null,"referer":null,"remote_ip":"151.101.65.91","remote_port":443,"response_code":200,"scheme":"HTTPS","size_download":0,"size_header":845,"size_request":70,"size_upload":0,"speed_download":0,"speed_upload":0,"ssl_verify_result":0,"time_appconnect":1.604500,"time_connect":0.221004,"time_namelookup":0.019257,"time_pretransfer":1.384094,"time_redirect":0.000000,"time_starttransfer":1.469586,"time_total":1.470412,"url":"https://curl.se/","url_effective":"https://curl.se/","urlnum":0,"curl_version":"libcurl/7.87.0 OpenSSL/3.0.8 (Schannel) zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 WinIDN libssh2/1.10.0 nghttp2/1.51.0 ngtcp2/0.13.1 nghttp3/0.8.0 libgsasl/2.2.0"}
dir err.txt
Том в устройстве ? имеет метку ?
Серийный номер тома: ?

Содержимое папки ?:?\curl-7.87.0_7-win64-mingw\bin

13.02.2023 05:00 0 err.txt
1 файлов 0 байт
0 папок ? байт свободно
curl.exe -I --stderr err.txt --write-out "%{stderr}%{json}" "htps://curl.se/" > Nul
{"content_type":null,"errormsg":"Protocol "htps" not supported or disabled in libcurl","exitcode":1,"filename_effective":null,"ftp_entry_path":null,"http_code":0,"http_connect":0,"http_version":"0","local_ip":"","local_port":0,"method":"HEAD","num_connects":0,"num_headers":0,"num_redirects":0,"proxy_ssl_verify_result":0,"redirect_url":null,"referer":null,"remote_ip":"","remote_port":0,"response_code":0,"scheme":null,"size_download":0,"size_header":0,"size_request":0,"size_upload":0,"speed_download":0,"speed_upload":0,"ssl_verify_result":0,"time_appconnect":0.000000,"time_connect":0.000000,"time_namelookup":0.000000,"time_pretransfer":0.000000,"time_redirect":0.000000,"time_starttransfer":0.000000,"time_total":0.000000,"url":"htps://curl.se/","url_effective":"htps://curl.se/","urlnum":0,"curl_version":"libcurl/7.87.0 OpenSSL/3.0.8 (Schannel) zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 WinIDN libssh2/1.10.0 nghttp2/1.51.0 ngtcp2/0.13.1 nghttp3/0.8.0 libgsasl/2.2.0"}
type err.txt
curl: (1) Protocol "htps" not supported or disabled in libcurl

I expected the following

Какой-нибудь глюк типа «not-a-bug» (#10459 и другие). Иначе не стал бы время тратить на такую примитивную проверку.
«Верной дорогой идёте, товарищи!»©

curl/libcurl version

7.87.0
[curl -V output]
curl 7.87.0 (x86_64-w64-mingw32) libcurl/7.87.0 OpenSSL/3.0.8 (Schannel) zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 WinIDN libssh2/1.10.0 nghttp2/1.51.0 ngtcp2/0.13.1 nghttp3/0.8.0 libgsasl/2.2.0
Release-Date: 2022-12-21
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI threadsafe TLS-SRP UnixSockets zstd

operating system

MS Windows

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