From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.lisp.guile.bugs Subject: bug#60528: uri->string swallows mandatory slashes Date: Wed, 4 Jan 2023 09:11:10 +0100 Message-ID: References: <4d95ebf7d53d8604fef2ffc8a4ff60dae8ead27f.camel@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4D7VMrfEqeax59bN" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14447"; mail-complaints-to="usenet@ciao.gmane.io" To: 60528@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Jan 04 09:12:21 2023 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pCysm-0003QD-QB for guile-bugs@m.gmane-mx.org; Wed, 04 Jan 2023 09:12:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCysX-0005xF-5l; Wed, 04 Jan 2023 03:12:05 -0500 Original-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 1pCysU-0005x6-Eq for bug-guile@gnu.org; Wed, 04 Jan 2023 03:12:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCysU-0008EQ-6b for bug-guile@gnu.org; Wed, 04 Jan 2023 03:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCysT-0001fh-Uc for bug-guile@gnu.org; Wed, 04 Jan 2023 03:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 04 Jan 2023 08:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60528 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16728198786358 (code B ref -1); Wed, 04 Jan 2023 08:12:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jan 2023 08:11:18 +0000 Original-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 Original-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 Original-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 Original-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==; Original-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 Content-Disposition: inline In-Reply-To: <4d95ebf7d53d8604fef2ffc8a4ff60dae8ead27f.camel@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10500 Archived-At: --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--