Closed chrisfosterelli closed 10 years ago
Thanks for the report, Chris. I've tried to run that command but HTTPie is giving me a bit nicer, more specific error message:
$ http POST http://localhost:8000/email example=@./doesntexist.json
[…]
http: error: "example=@./doesntexist.json": [Errno 2] No such file or directory: './doesntexist.json'
So I guess it's another issue. Would you please run the following and post the output here as a comment?
$ http --debug POST http://localhost:8000/email example=@./doesntexist.json
@jakubroztocil Sure, here you go:
➜ ~ http --debug POST http://localhost:8000/email example=@./doesntexist.json
HTTPie 0.8.0
HTTPie data: /home/stealth/.httpie
Requests 2.2.1
Pygments 1.6
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] linux
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/httpie/input.py", line 609, in parse_items
with open(os.path.expanduser(value), 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: './doesntexist.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/http", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.4/dist-packages/httpie/core.py", line 84, in main
args = parser.parse_args(args=args, env=env)
File "/usr/local/lib/python3.4/dist-packages/httpie/input.py", line 135, in parse_args
self._parse_items()
File "/usr/local/lib/python3.4/dist-packages/httpie/input.py", line 325, in _parse_items
params=self.args.params)
File "/usr/local/lib/python3.4/dist-packages/httpie/input.py", line 612, in parse_items
raise ParseError('"%s": %s' % (item.orig, e))
httpie.input.ParseError: "example=@./doesntexist.json": [Errno 2] No such file or directory: './doesntexist.json'
➜ ~
Thanks. This is actually already fixed in master
.
Hey! Awesome app, thanks for all the hard work! I noticed that this error could possibly use some clarification:
The error is that
doesntexist.json
does not exist, but it can be confusing if you mistype and don't realize it. This also seems to occur when using:@=
. Since one of the goals of the project is the following:Could this error be improved?