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

to_excel close #300

Closed
byersiiasa opened this issue Dec 5, 2019 · 1 comment · Fixed by #301
Closed

to_excel close #300

byersiiasa opened this issue Dec 5, 2019 · 1 comment · Fixed by #301
Assignees
Labels

Comments

@byersiiasa
Copy link
Collaborator

When writing out recently, error on df.to_excel()

Traceback (most recent call last):

  File "<ipython-input-35-1d4bbdcc4679>", line 1, in <module>
    pdf.to_excel(excel_writer=writer)

  File "C:\Users\byers\AppData\Local\Continuum\anaconda3\envs\EB_Py3_light\lib\site-packages\pyam\core.py", line 1174, in to_excel
    if close:

UnboundLocalError: local variable 'close' referenced before assignment

I resolved this in the function by removing the if, but not sure if that is safe:

#        if close:
        excel_writer.close()
@byersiiasa byersiiasa added the bug label Dec 5, 2019
@danielhuppmann
Copy link
Member

I apologise for the inconvenience...

@danielhuppmann danielhuppmann self-assigned this Dec 5, 2019
danielhuppmann added a commit to danielhuppmann/pyam that referenced this issue Dec 5, 2019
byersiiasa pushed a commit that referenced this issue Dec 7, 2019
* add unit test for bug #300

* insert bugfix

* add to release notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants