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

Error when loading notebook with unicode operator #397

Closed
garrison opened this issue Sep 9, 2020 · 4 comments
Closed

Error when loading notebook with unicode operator #397

garrison opened this issue Sep 9, 2020 · 4 comments
Labels
bug Something isn't working expression explorer Figuring out assignments and references in a cell

Comments

@garrison
Copy link

garrison commented Sep 9, 2020

The following notebook errors with StringIndexError("⊻=", 3) when starting up, and afterward fails to compute changes to that cell:

### A Pluto.jl notebook ###
# v0.11.13

using Markdown
using InteractiveUtils

# ╔═╡ 863ffa66-f2a9-11ea-3ab2-51408bcb2a92
function f(z)
	z = copy(z)
	z[end] ⊻= 1
	z
end

# ╔═╡ 9bac7cc6-f2a9-11ea-3289-b546aaf93586
f([1,2,3])

# ╔═╡ Cell order:
# ╠═863ffa66-f2a9-11ea-3ab2-51408bcb2a92
# ╠═9bac7cc6-f2a9-11ea-3289-b546aaf93586

This seems similar to #103.

@fonsp
Copy link
Owner

fonsp commented Sep 9, 2020

Can you post the entire stacktrace?

@garrison
Copy link
Author

garrison commented Sep 9, 2020

┌ Error: Expression explorer failed on: 
│   ex =
│    :($(Expr(:toplevel, :(#= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:1 =#), :(function f(z)
│          #= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:1 =#
│          #= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:2 =#
│          z = copy(z)
│          #= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:3 =#
│          z[end] ⊻= 1
│          #= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:4 =#
│          z
│      end))))
└ @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/lHgT4/src/analysis/ExpressionExplorer.jl:662
StringIndexError("⊻=", 3)
Stacktrace:
 [1] try_compute_symbolreferences(::Expr) at /home/garrison/.julia/packages/Pluto/lHgT4/src/analysis/ExpressionExplorer.jl:663
 [2] #41 at ./none:0 [inlined]
 [3] iterate at ./generator.jl:47 [inlined]
 [4] Dict{Pluto.Cell,Pluto.ExpressionExplorer.SymbolsState}(::Base.Generator{Array{Pluto.Cell,1},Pluto.var"#41#43"}) at ./dict.jl:102
 [5] dict_with_eltype at ./abstractdict.jl:531 [inlined]
 [6] dict_with_eltype at ./abstractdict.jl:538 [inlined]
 [7] Dict(::Base.Generator{Array{Pluto.Cell,1},Pluto.var"#41#43"}) at ./dict.jl:128
 [8] updated_topology(::Pluto.NotebookTopology, ::Pluto.Notebook, ::Array{Pluto.Cell,1}) at /home/garrison/.julia/packages/Pluto/lHgT4/src/evaluation/Update.jl:17
 [9] load_notebook(::String) at /home/garrison/.julia/packages/Pluto/lHgT4/src/notebook/Notebook.jl:183
 [10] open(::Pluto.ServerSession, ::String; run_async::Bool) at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/SessionActions.jl:21
 [11] open at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/SessionActions.jl:15 [inlined]
 [12] (::Pluto.var"#try_launch_notebook_response#101"{Pluto.var"#try_launch_notebook_response#90#102"{Pluto.ServerSession}})(::typeof(Pluto.SessionActions.open), ::String; title::String, advice::String, home_url::String) at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/Static.jl:63
 [13] (::Pluto.var"#serve_openfile#104"{Pluto.ServerSession,Pluto.ServerSecurity})(::HTTP.Messages.Request) at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/Static.jl:91
 [14] handle(::HTTP.Handlers.RequestHandlerFunction{Pluto.var"#serve_openfile#104"{Pluto.ServerSession,Pluto.ServerSecurity}}, ::HTTP.Messages.Request) at /home/garrison/.julia/packages/HTTP/atT5q/src/Handlers.jl:253
 [15] handle(::HTTP.Handlers.Router{Symbol("##253")}, ::HTTP.Messages.Request) at /home/garrison/.julia/packages/HTTP/atT5q/src/Handlers.jl:467
 [16] (::Pluto.var"#195#202"{Pluto.ServerSession,HTTP.Handlers.Router{Symbol("##253")},Base.RefValue{Function}})(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/WebServer.jl:133
 [17] handle at /home/garrison/.julia/packages/HTTP/atT5q/src/Handlers.jl:269 [inlined]
 [18] #4 at /home/garrison/.julia/packages/HTTP/atT5q/src/Handlers.jl:345 [inlined]
 [19] macro expansion at /home/garrison/.julia/packages/HTTP/atT5q/src/Servers.jl:367 [inlined]
 [20] (::HTTP.Servers.var"#13#14"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#195#202"{Pluto.ServerSession,HTTP.Handlers.Router{Symbol("##253")},Base.RefValue{Function}}}},HTTP.ConnectionPool.Transaction{Sockets.TCPSocket},HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})() at ./task.jl:356┌ Error: Expression explorer failed on: 
│   ex =
│    :($(Expr(:toplevel, :(#= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:1 =#), :(function f(z)
│          #= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:1 =#
│          #= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:2 =#
│          z = copy(z)
│          #= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:3 =#
│          z[end] ⊻= 1
│          #= /tmp/bug2.jl#==#863ffa66-f2a9-11ea-3ab2-51408bcb2a92:4 =#
│          z
│      end))))
└ @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/lHgT4/src/analysis/ExpressionExplorer.jl:662
StringIndexError("⊻=", 3)
Stacktrace:
 [1] try_compute_symbolreferences(::Expr) at /home/garrison/.julia/packages/Pluto/lHgT4/src/analysis/ExpressionExplorer.jl:663
 [2] #41 at ./none:0 [inlined]
 [3] iterate at ./generator.jl:47 [inlined]
 [4] Dict{Pluto.Cell,Pluto.ExpressionExplorer.SymbolsState}(::Base.Generator{Array{Pluto.Cell,1},Pluto.var"#41#43"}) at ./dict.jl:102
 [5] dict_with_eltype at ./abstractdict.jl:531 [inlined]
 [6] dict_with_eltype at ./abstractdict.jl:538 [inlined]
 [7] Dict(::Base.Generator{Array{Pluto.Cell,1},Pluto.var"#41#43"}) at ./dict.jl:128
 [8] updated_topology(::Pluto.NotebookTopology, ::Pluto.Notebook, ::Array{Pluto.Cell,1}) at /home/garrison/.julia/packages/Pluto/lHgT4/src/evaluation/Update.jl:17
 [9] update_save_run!(::Pluto.ServerSession, ::Pluto.Notebook, ::Array{Pluto.Cell,1}; save::Bool, run_async::Bool, prerender_text::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/garrison/.julia/packages/Pluto/lHgT4/src/evaluation/Run.jl:108
 [10] open(::Pluto.ServerSession, ::String; run_async::Bool) at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/SessionActions.jl:24
 [11] open at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/SessionActions.jl:15 [inlined]
 [12] (::Pluto.var"#try_launch_notebook_response#101"{Pluto.var"#try_launch_notebook_response#90#102"{Pluto.ServerSession}})(::typeof(Pluto.SessionActions.open), ::String; title::String, advice::String, home_url::String) at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/Static.jl:63
 [13] (::Pluto.var"#serve_openfile#104"{Pluto.ServerSession,Pluto.ServerSecurity})(::HTTP.Messages.Request) at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/Static.jl:91
 [14] handle(::HTTP.Handlers.RequestHandlerFunction{Pluto.var"#serve_openfile#104"{Pluto.ServerSession,Pluto.ServerSecurity}}, ::HTTP.Messages.Request) at /home/garrison/.julia/packages/HTTP/atT5q/src/Handlers.jl:253
 [15] handle(::HTTP.Handlers.Router{Symbol("##253")}, ::HTTP.Messages.Request) at /home/garrison/.julia/packages/HTTP/atT5q/src/Handlers.jl:467
 [16] (::Pluto.var"#195#202"{Pluto.ServerSession,HTTP.Handlers.Router{Symbol("##253")},Base.RefValue{Function}})(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at /home/garrison/.julia/packages/Pluto/lHgT4/src/webserver/WebServer.jl:133
 [17] handle at /home/garrison/.julia/packages/HTTP/atT5q/src/Handlers.jl:269 [inlined]
 [18] #4 at /home/garrison/.julia/packages/HTTP/atT5q/src/Handlers.jl:345 [inlined]
 [19] macro expansion at /home/garrison/.julia/packages/HTTP/atT5q/src/Servers.jl:367 [inlined]
 [20] (::HTTP.Servers.var"#13#14"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#195#202"{Pluto.ServerSession,HTTP.Handlers.Router{Symbol("##253")},Base.RefValue{Function}}}},HTTP.ConnectionPool.Transaction{Sockets.TCPSocket},HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})() at ./task.jl:356

@fonsp
Copy link
Owner

fonsp commented Sep 9, 2020

thanks!

@fonsp fonsp added bug Something isn't working expression explorer Figuring out assignments and references in a cell labels Sep 9, 2020
@fonsp fonsp closed this as completed in b53d282 Sep 9, 2020
@fonsp
Copy link
Owner

fonsp commented Sep 9, 2020

This is now a testset 🐻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working expression explorer Figuring out assignments and references in a cell
Projects
None yet
Development

No branches or pull requests

2 participants