diff --git a/news/fix-deprecation.rst b/news/fix-deprecation.rst new file mode 100644 index 0000000..5be8370 --- /dev/null +++ b/news/fix-deprecation.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fix deprecation for open file for Python 3.14 + +**Security:** + +* diff --git a/src/diffpy/structure/structure.py b/src/diffpy/structure/structure.py index 012c167..3c7b725 100644 --- a/src/diffpy/structure/structure.py +++ b/src/diffpy/structure/structure.py @@ -14,7 +14,6 @@ ############################################################################## """This module defines class `Structure`.""" -import codecs import copy as copymod import numpy @@ -347,7 +346,7 @@ def write(self, filename, format): p = getParser(format) p.filename = filename s = p.tostring(self) - with codecs.open(filename, "w", encoding="UTF-8") as fp: + with open(filename, "w", encoding="utf-8", newline="") as fp: fp.write(s) return