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

Parsing failure with as_symbols=true and commands_are_required=false #100

Closed
alhirzel opened this issue Oct 16, 2020 · 3 comments · Fixed by #102
Closed

Parsing failure with as_symbols=true and commands_are_required=false #100

alhirzel opened this issue Oct 16, 2020 · 3 comments · Fixed by #102

Comments

@alhirzel
Copy link

Encountered what appears to be a corner case with symbols and commands.

using ArgParse, Test

s = ArgParseSettings()
s.commands_are_required = false

@add_arg_table! s begin
	"foobar"
		action = :command
end

@test isnothing(parse_args([], s)["%COMMAND%"])
@test isnothing(parse_args([], s; as_symbols=true)[:_COMMAND_])
Error During Test at /tmp/interesting.jl:12
  Test threw exception
  Expression: isnothing((parse_args([], s; as_symbols = true))[:_COMMAND_])
  KeyError: key nothing not found
  Stacktrace:
   [1] getindex(::Dict{String,Any}, ::Nothing) at ./dict.jl:467
   [2] convert_to_symbols(::Dict{String,Any}) at /home/alhirzel/.julia/packages/ArgParse/WUIf8/src/parsing.jl:934
   [3] parse_args(::Array{T,1} where T, ::ArgParseSettings; as_symbols::Bool) at /home/alhirzel/.julia/packages/ArgParse/WUIf8/src/parsing.jl:474
   [4] top-level scope at /tmp/interesting.jl:12
   [5] include(::Function, ::Module, ::String) at ./Base.jl:380
   [6] include(::Module, ::String) at ./Base.jl:368
   [7] exec_options(::Base.JLOptions) at ./client.jl:296
   [8] _start() at ./client.jl:506
  
ERROR: LoadError: There was an error during testing
in expression starting at /tmp/interesting.jl:12

new_parsed_args[scmd] = convert_to_symbols(parsed_args[cmd])

@RoyiAvital
Copy link

RoyiAvital commented Dec 5, 2020

I also gets this error on Windows:

image

using ArgParse
[ Info: Precompiling ArgParse [c7e460c6-2fb9-53a9-8c5b-16f535851c63]
ERROR: IOError: unlink: permission denied (EACCES)
Stacktrace:
 [1] uv_error at .\libuv.jl:97 [inlined]
 [2] unlink(::String) at .\file.jl:918
 [3] rm(::String; force::Bool, recursive::Bool) at .\file.jl:268
 [4] compilecache(::Base.PkgId, ::String) at .\loading.jl:1300
 [5] _require(::Base.PkgId) at .\loading.jl:1030
 [6] require(::Base.PkgId) at .\loading.jl:928
 [7] require(::Module, ::Symbol) at .\loading.jl:923
caused by [exception 1]
IOError: unlink: permission denied (EACCES)
Stacktrace:
 [1] uv_error at .\libuv.jl:97 [inlined]
 [2] unlink(::String) at .\file.jl:918
 [3] rm(::String; force::Bool, recursive::Bool) at .\file.jl:268
 [4] rename(::String, ::String; force::Bool) at .\file.jl:928
 [5] compilecache(::Base.PkgId, ::String) at .\loading.jl:1296
 [6] _require(::Base.PkgId) at .\loading.jl:1030
 [7] require(::Base.PkgId) at .\loading.jl:928
 [8] require(::Module, ::Symbol) at .\loading.jl:923

Any idea?

@RoyiAvital
Copy link

@carlobaldassi, Will it solve the issue I raised?

@carlobaldassi
Copy link
Owner

@RoyiAvital no, your issue seems to be unrelated. It looks like you are getting a complaint about the permissions fr deleting files. It looks like an issue with the julia installation or the packages directory.

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

Successfully merging a pull request may close this issue.

3 participants