question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Overwrite parameter in ascii writers

See original GitHub issue

This issue is a follow-up comment / question to #5007 for @taldcroft and @evertrol .

We use table.write(filename, format='ascii.ecsv') in several places in Gammapy. Now I’m getting the AstropyDeprecationWarning. I can’t add the overwrite=True in Gammapy, because we (obviously) still support Astropy 1.2.

Is there a way for us to write the code so that it works on Astropy 1.2 and 1.3 and doesn’t raise deprecation warnings on 1.3+ all the time?

If yes, could you please let me know and add that info to the changelog entry? If no, could you please be more specific in the changelog when you plan to raise an error here? (It currently says “In a future version this will be changed …”)

Just to be clear: I’m +1 for your change towards consistency in Astropy. Thank you for implementing it.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
cdeilcommented, Dec 5, 2016

@joleroi - This is expected, overwrite doesn’t exist in Astropy 1.2.

For now I suggest you put this as a workaround (suggested by @evertrol above):

try:
    table.write(filename, format='ascii.ecsv', overwrite=True)
except TypeError:
    table.write(filename, format='ascii.ecsv')

and then in a few weeks update to Astropy 1.3 when it comes out and remove that workaround.

0reactions
cdeilcommented, Jun 15, 2017

OK, closing this issue now. Thanks all for the help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing Tables — Astropy v5.2
The write() function accepts a number of parameters that specify the detailed output table format. Each of the Supported Formats is handled by...
Read more >
Unified file read/write interface — Astropy v0.4.2
To overwrite only a single table within an HDF5 file that has multiple datasets, use both the overwrite=True and append=True arguments.
Read more >
Rewrite unicode characters in file to escaped ascii decimal ...
To reiterate, I am trying to preprocess some source code using bash commands to convert all non-ascii (utf-8 encoded) characters into their ...
Read more >
Replace every character of string by character whose ASCII ...
Given string str consisting of lowercase letters only and an integer k, the task is to replace every character of the given string...
Read more >
buffer overflow - Control EIP with ASCII values
I can overwrite by using AAAA which will convert to 0x41414141. I have sixteen bytes available to write to. Is there any way...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found