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

Saving an existing workbook under a new name should default to Python cwd and rel. dirs should be supported #185

Closed
fzumstein opened this Issue Apr 23, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@fzumstein
Member

fzumstein commented Apr 23, 2015

to align it with saving a new file. currently, it defaults to the Excel's default directory.

@ankostis

This comment has been minimized.

ankostis commented Aug 14, 2016

Also I confirm the same problem in v0.9.x under Windows: Book.save() does not respect cwd for relative paths, and they are saved instead into e.g. %HOMEPATH%\Documents. But when reading, the same behavior is not observed.

Here it is some rough code to reproduce it:

>>> import xlwings as xw, os.path as osp

>>> cd
D:\Work

>>> fpath = r'.\foo-book.xlsx'  ## RELATIVE filepath
>>> bk = xw.Book()
>>> bk.save(fpath); bk.close()
>>> osp.isfile(fpath)
False

>>> xw.Book(fpath)
Could not connect to workbook ''.\foo-book.xlsx''
>>> osp.isfile(osp.join(r'C:\Users\user\Documents', fpath))
True


>>> fpath = r'D:\Work\foo-book.xlsx'  ## ABSOLUTE filepath
>>> bk = xw.Book()
>>> bk.save(fpath); bk.close()
>>> osp.isfile(fpath)
True
>>> xw.Book(fpath)
 <Book [foo-book.xlsx]>
'''

The same behavior applies when using UNIX-like paths.

@fzumstein fzumstein added this to the short list milestone Aug 15, 2016

@fzumstein fzumstein modified the milestones: v0.9.3, short list Aug 22, 2016

@fzumstein fzumstein closed this Aug 22, 2016

@fzumstein fzumstein changed the title from Saving an existing workbook under a new name should default to Python cwd to Saving an existing workbook under a new name should default to Python cwd and rel. dirs should be supported Aug 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment