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

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
Milestone

Comments

@fzumstein
Copy link
Member

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

@ankostis
Copy link

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 changed the title Saving an existing workbook under a new name should default to Python cwd 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
Projects
None yet
Development

No branches or pull requests

2 participants