You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried PlutoPlotly, Error was occured like next.
julia>using PlutoPlotly
Precompiling PlutoPlotly
Info Given PlutoPlotly was explicitly requested, output will be shown live
ERROR: LoadError: InitError: StringIndexError: invalid index [41], valid nearby indices [39]=>'プ', [42]=>'\"'
Stacktrace:
[1] string_index_err(s::String, i::Int64)
@ Base ./strings/string.jl:12
[2] SubString{String}(s::String, i::Int64, j::Int64)
@ Base ./strings/substring.jl:35
[3] SubString
@ ./strings/substring.jl:41 [inlined]
[4] SubString
@ ./strings/substring.jl:47 [inlined]
[5] SubString
@ ./strings/substring.jl:43 [inlined]
[6] getindex
@ ./strings/substring.jl:292 [inlined]
[7] parseuserdirs(configdir::String)
@ BaseDirs ~/.julia/packages/BaseDirs/tgw06/src/unix.jl:23
[8] reload()
@ BaseDirs ~/.julia/packages/BaseDirs/tgw06/src/unix.jl:56
[9] __init__()
@ BaseDirs ~/.julia/packages/BaseDirs/tgw06/src/BaseDirs.jl:38
I found the error unix.jl:23 of BaseDirs.jl.
I am using Ubuntu 23.10 installed with Japanese locale.
Default ~/.config/user-dirs.dirs is like next at Japanese locale.
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/デスクトップ"
XDG_DOWNLOAD_DIR="$HOME/ダウンロード"
XDG_TEMPLATES_DIR="$HOME/テンプレート"
XDG_PUBLICSHARE_DIR="$HOME/公開"
XDG_DOCUMENTS_DIR="$HOME/ドキュメント"
XDG_MUSIC_DIR="$HOME/ミュージック"
XDG_PICTURES_DIR="$HOME/ピクチャ"
XDG_VIDEOS_DIR="$HOME/ビデオ"
The cause of the error is the value[2:end-1] part.
I tried to reproduce the error with REPL, next.
Thanks for both raising this issue ujimushi and doing such a thorough investigation into the root cause, this is tremendously helpful! 😀
I've just fixed this, and gone a step further and looked for any other instances of offset-based string indexing like this that could cause a similar problem. I've found a few others, and fixed them too. I've also added a new testset based on the details you've so kindly provided here. See 742caa3.
I'll release a patch version (probably v1.2.3) shortly 🙂.
When I tried
PlutoPlotly
, Error was occured like next.I found the error
unix.jl:23
ofBaseDirs.jl
.I am using Ubuntu 23.10 installed with Japanese locale.
Default
~/.config/user-dirs.dirs
is like next at Japanese locale.The cause of the error is the
value[2:end-1]
part.I tried to reproduce the error with REPL, next.
An error occurs when accessing the second and subsequent bytes of a multibyte character using index.
The fixes I can think of are
replace(value, r"^\"" => "", r"\"$" =>"")
or
strip(value, '"')
.In environments without Japanese fonts, the characters may not be visible. Sorry.
The text was updated successfully, but these errors were encountered: