From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 03 15:01:01 2023 Received: (at submit) by debbugs.gnu.org; 3 Jan 2023 20:01:01 +0000 Received: from localhost ([127.0.0.1]:46735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCnT2-00082P-5O for submit@debbugs.gnu.org; Tue, 03 Jan 2023 15:01:01 -0500 Received: from lists.gnu.org ([209.51.188.17]:34776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCnSw-00082D-5b for submit@debbugs.gnu.org; Tue, 03 Jan 2023 15:00:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCnSv-0003Hq-Sb for bug-guile@gnu.org; Tue, 03 Jan 2023 15:00:53 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCnSt-0005tU-9b for bug-guile@gnu.org; Tue, 03 Jan 2023 15:00:52 -0500 Received: by mail-wr1-x443.google.com with SMTP id co23so30843082wrb.4 for ; Tue, 03 Jan 2023 12:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:from:to:cc:subject:date:message-id:reply-to; bh=gQK19gVFGTRHQz0XCS/cz33bxlIqCTFmTWPmbriS/6o=; b=HeQxgN5Z06U0H07R+ivfnpdbwqITIu7GvmmRRanYebyakELQE6HSeAMPEPSYC96WMl 4N2taXQdqZvyqBWkdguowCJ9B6UrfHEOhoiEVu8zzpb3O7MvJMCT3LySMOjI+sFuwc25 zfSqF/UlGY3EZg+gu9Hh1wXLQsJl3w7EJ1oDISmW+V3zE/E9v0Nd1RzVJCRDGXbL2vmD vfAO6BFAt73Vm3u9En7gvJEAmvJakhsfKmrsQKspJZ56YV+6h235L84A/ZZWDwLeKrWI jDw1gVfmXtDXIDmdr+qCv+hXLi626y9QYG1insTvF32uHKkrfq4Q98q2WNBU4U2kDyoh YJZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gQK19gVFGTRHQz0XCS/cz33bxlIqCTFmTWPmbriS/6o=; b=DUfNKSmnXYtwd+tDrV6A0qNTkAeXYF9X2oNmVV+HJsxTJMjr650iAV0b+y2lKYlpoX YAhpjRdivmXqJKDwSooKM/eXPEWMdp19qHMjtffLDjzOArxsW6q47w0sVd96PNbECRcZ Z4GL8YMLrmVBeMbKW9m+MlJEkLIIgNaZAS252eMyBn+2iehAOEzFZ6CY1R67PIhNAJQe Kcsr5H79iBwDOnemfZ4GaOxd9OwQt6wylIHhao/C+jZuY9M0sJXaohe2ETKeU0hNR32T ytw/EOLrMJrlYpXeK/ikYcmivWhAtv5+8wYlYXzfe3hsQTP8AKhS7oXC14UvS2Ba4RjB vccw== X-Gm-Message-State: AFqh2kr/L+/8FC2hkISIxVE2nyqlSY9PfJzWvilaN+g5GpL5sYKP/OdI 2Ji+ZmB2E0f49bUH6mZcsfhZnAobHtQ= X-Google-Smtp-Source: AMrXdXuGvyAaUeYDzhpG584O/v0/BWQZWL5ZvC1j2MAi8V1u/F7my6pVGoIlfhMzDXPk0+KAwRsHmg== X-Received: by 2002:a5d:44ca:0:b0:242:1926:782c with SMTP id z10-20020a5d44ca000000b002421926782cmr29297158wrr.43.1672776049296; Tue, 03 Jan 2023 12:00:49 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id m16-20020adffe50000000b00241bd7a7165sm35751607wrs.82.2023.01.03.12.00.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 12:00:48 -0800 (PST) Message-ID: <4d95ebf7d53d8604fef2ffc8a4ff60dae8ead27f.camel@gmail.com> Subject: uri->string swallows mandatory slashes From: Liliana Marie Prikler To: bug-guile@gnu.org Date: Tue, 03 Jan 2023 21:00:48 +0100 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=liliana.prikler@gmail.com; helo=mail-wr1-x443.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi folks, Below some unexpected behaviour observed in Guile 3.0.8, but it also dates back to 2.2.7 and possibly earlier versions. scheme@(guile-user)> ,use (web uri) scheme@(guile-user)> (string->uri "file:///home")=20 $1 =3D #< scheme: file userinfo: #f host: #f port: #f path: "/home" query: #f fragment: #f> scheme@(guile-user)> (uri->string $1) $2 =3D "file:/home" scheme@(guile-user)> (uri->string (build-uri 'file #:host "" #:path "/home"))=20 ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `uri-error' with args `("Expected valid host: ~s" (""))'. Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. Cheers From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 04 03:11:18 2023 Received: (at submit) by debbugs.gnu.org; 4 Jan 2023 08:11:18 +0000 Received: from localhost ([127.0.0.1]:47586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCyrl-0001eS-Sz for submit@debbugs.gnu.org; Wed, 04 Jan 2023 03:11:18 -0500 Received: from lists.gnu.org ([209.51.188.17]:57932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCyrj-0001eI-2e for submit@debbugs.gnu.org; Wed, 04 Jan 2023 03:11:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCyri-0005tT-LQ for bug-guile@gnu.org; Wed, 04 Jan 2023 03:11:14 -0500 Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCyrg-00088u-T2 for bug-guile@gnu.org; Wed, 04 Jan 2023 03:11:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=L9fnEVNT3zGYaqTr+/M06kq2BMvccqWAiIiuOUHI9F4=; b=BJvYVXXmBfvAZcU/sQL93IBHX2 4M4JtuiZxDTJNCAGFpHD7m2JKCU9HXu+1lLDrgMcclmCFVW9br6vi3OJCXu7+5nHHYcMkgAJnLOWp Ndzlci8PzO6+8YilyZoA0oo3JZ8J1DM+avShT7JTu5UW/NM65UzdpkH1LtNYLQGzFkcNBH16OWkP8 2KpdvlM95HwWYh5OTWu8QnWMdqZqFpMYJrIzG9ZfD0zTNk+BnlxGtxBn1xk81Y/33Tml7prmhHugx ICU2q/qH5es2Rk7E7+R3b0WjT76+04O0T+EPeQ8qbbLaPfPT34mx6Hv+m2TaqUX+2D1HCKzar6Fg+ tzJj0A2A==; Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1pCyre-0001sV-9M for bug-guile@gnu.org; Wed, 04 Jan 2023 09:11:10 +0100 Date: Wed, 4 Jan 2023 09:11:10 +0100 To: bug-guile@gnu.org Subject: Re: bug#60528: uri->string swallows mandatory slashes Message-ID: References: <4d95ebf7d53d8604fef2ffc8a4ff60dae8ead27f.camel@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4D7VMrfEqeax59bN" Content-Disposition: inline In-Reply-To: <4d95ebf7d53d8604fef2ffc8a4ff60dae8ead27f.camel@gmail.com> From: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --4D7VMrfEqeax59bN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 03, 2023 at 09:00:48PM +0100, Liliana Marie Prikler wrote: > Hi folks, >=20 > Below some unexpected behaviour observed in Guile 3.0.8, but it also > dates back to 2.2.7 and possibly earlier versions. >=20 > scheme@(guile-user)> ,use (web uri) > scheme@(guile-user)> (string->uri "file:///home")=20 > $1 =3D #< scheme: file userinfo: #f host: #f port: #f path: "/home" > query: #f fragment: #f> > scheme@(guile-user)> (uri->string $1) > $2 =3D "file:/home" This looks strange, but not necessarily wrong. "file:///home" means "empty authority", equivalent to "localhost" whereas "file:/home" means "no authority". I'd expect the library to keep those two separate. =20 > scheme@(guile-user)> (uri->string (build-uri 'file #:host "" #:path > "/home"))=20 > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > Throw to key `uri-error' with args `("Expected valid host: ~s" (""))'. Note that "no host" is not the empty string, but #f: > scheme@(guile-user)> (uri->string (build-uri 'file #:host "" #:path > "/home"))=20 scheme@(guile-user)> (uri->string (build-uri 'file #:host #f #:path "/hom= e")) $6 =3D "file:/home" So it is consistent, albeit (to me) surprising. I'd have expect your `$2' above to be "file:///home", with three slashes. Cheers --=20 t --4D7VMrfEqeax59bN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY7U0lgAKCRAFyCz1etHa RqqhAJsH7LGGB2VsUPQNQC+x0cFBlGOSYACfTdumx/6k/kLE3ppjzPBn0XcrgNU= =+GQQ -----END PGP SIGNATURE----- --4D7VMrfEqeax59bN--