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

macOS fullname prints in weird formatting #1390

Closed
fzumstein opened this issue Aug 19, 2020 · 2 comments
Closed

macOS fullname prints in weird formatting #1390

fzumstein opened this issue Aug 19, 2020 · 2 comments

Comments

@fzumstein
Copy link
Member

>>> xw.books[0].fullname
'/:Users:fz:Desktop:Book1.xlsx'
@lewis-jeffery
Copy link

I think the behaviour below may be related. The occurs when the excel file is referenced by a "path+filename" string AND the file is already open. Executing the script first time, before file is open is fine.

Observed in 0.20.4. Rolling back to 0.19.5 brings this back to normal.

Regards,
Lewis


FileNotFoundError Traceback (most recent call last)
in
9
10 if 'csv' not in filename:
---> 11 wb = xw.Book(data_path+filename)
12 raw_data = wb.sheets[sheetname].range(data_rangename).options(expand='table').value
13 print('Using PVGIS format')

~/opt/anaconda3/lib/python3.7/site-packages/xlwings/main.py in init(self, fullname, update_links, read_only, format, password, write_res_password, ignore_read_only_recommended, origin, delimiter, editable, notify, converter, add_to_mru, local, corrupt_load, impl)
541 impl = app.books.open(fullname, update_links, read_only, format, password, write_res_password,
542 ignore_read_only_recommended, origin, delimiter, editable, notify, converter,
--> 543 add_to_mru, local, corrupt_load).impl
544 elif len(candidates) > 1:
545 raise Exception("Workbook '%s' is open in more than one Excel instance." % fullname)

~/opt/anaconda3/lib/python3.7/site-packages/xlwings/main.py in open(self, fullname, update_links, read_only, format, password, write_res_password, ignore_read_only_recommended, origin, delimiter, editable, notify, converter, add_to_mru, local, corrupt_load)
2976 try:
2977 impl = self.impl(name)
-> 2978 if not os.path.samefile(impl.fullname, fullname):
2979 raise ValueError(
2980 "Cannot open two workbooks named '%s', even if they are saved in different locations." % name

~/opt/anaconda3/lib/python3.7/genericpath.py in samefile(f1, f2)
98 raises an exception if an os.stat() call on either pathname fails.
99 """
--> 100 s1 = os.stat(f1)
101 s2 = os.stat(f2)
102 return samestat(s1, s2)

FileNotFoundError: [Errno 2] No such file or directory: '/:Users:lewis:Google Drive:XXXXXXXXXXXX.xlsx'

@fzumstein
Copy link
Member Author

@lewis-jeffery , yes that's the same issue, will be fixed in 0.20.6

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