Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some filenames are mistakingly assumed to be URLs #5

Open
thbar opened this issue Aug 19, 2021 · 0 comments
Open

Some filenames are mistakingly assumed to be URLs #5

thbar opened this issue Aug 19, 2021 · 0 comments

Comments

@thbar
Copy link
Contributor

thbar commented Aug 19, 2021

A corollary of #4 is that if you generate a filename from a url, replacing all non-word characters by a - (e.g. Regex.replace(~r/\W/, url, "-")), you will get this filename (a common technique to generate local filesystem cache of remote files):

https---opendata-lillemetropole-fr-api-datasets-1-0-transport_arret_transpole-point-alternative_exports-gtfs_zip

Feeding it as the --input to gtfs-geojson gives the following error:

RUST_BACKTRACE=1 ../gtfs-to-geojson/target/release/gtfs-geojson --input https---opendata-lillemetropole-fr-api-datasets-1-0-transport_arret_transpole-point-alternative_exports-gtfs_zip
thread 'main' panicked at 'The GTFS file is not well formated.: Fetch(reqwest::Error { kind: Builder, source: RelativeUrlWithoutBase })', src/main.rs:40:6
stack backtrace:
   0: rust_begin_unwind
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:92:14
   2: core::result::unwrap_failed
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/result.rs:1355:5
   3: gtfs_geojson::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

The feature at https://github.com/rust-transit/gtfs-structure#feature-read-url kicks in an reqwest attempts to download from what it believes to be a broken url.

Nothing critical at this point, I'm just opening the ticket in case a user later wonders about the behaviour, and maybe I'll come back to fix it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant