Project

General

Profile

Task #2357

Story #2045: Get the DataONE CLI ready for public release

Tilde expansion (i.e. ~/filename) doesn't work

Added by Andrew Pippin almost 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
d1_client_cli
Start date:
2012-02-22
Due date:
% Done:

100%

Milestone:
CCI-1.0.0
Product Version:
*
Story Points:
Sprint:

Description

Using a tilde when loading a file doesn't work:

load ~/.d1client.conf
ERROR Unable to load session from file: ~/.d1client.conf
ERROR [Errno 2] No such file or directory: '~/.d1client.conf'
[DEV tsunami] tests> ls -l !$
ls -l /home/pippin/.d1client.conf
-rw-r--r-- 1 pippin pippin 1106 2012-02-21 15:46 /home/pippin/.d1client.conf

An exception is thrown when trying to save a configuration file using a tilde:

save ~/fred
Traceback (most recent call last):
File "/home/pippin/Source/DataONE/software/cicore/trunk/itk/d1_client_cli/src/d1_client_cli/dataone.py", line 1034, in
main()
File "/home/pippin/Source/DataONE/software/cicore/trunk/itk/d1_client_cli/src/d1_client_cli/dataone.py", line 1030, in main
cli.cmdloop()
File "/usr/lib/python2.6/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python2.6/cmd.py", line 219, in onecmd
return func(arg)
File "/home/pippin/Source/DataONE/software/cicore/trunk/itk/d1_client_cli/src/d1_client_cli/dataone.py", line 588, in do_save
self.d1.session_save(pickle_file_path=file)
File "/home/pippin/Source/DataONE/software/cicore/trunk/itk/d1_client_cli/src/d1_client_cli/dataone.py", line 460, in session_save
return self.session.save(pickle_file_path)
File "/home/pippin/Source/DataONE/software/cicore/trunk/itk/d1_client_cli/src/d1_client_cli/session.py", line 285, in save
if not suppress_error:
NameError: global name 'suppress_error' is not defined

History

#1 Updated by Roger Dahl almost 13 years ago

  • Parent task set to #2045

#2 Updated by Andrew Pippin over 12 years ago

  • Status changed from New to In Progress
  • Assignee changed from Andrew Pippin to Roger Dahl
  • % Done changed from 0 to 90

Expand all file paths with a method safely wrapping os.path.expanduser().

Roger, when you get a chance, could you look at this? Thanks. (SVN r7085)

#3 Updated by Andrew Pippin over 12 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

Closing.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)