FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: fix deprecation warning by stevenhua0320 · Pull Request #153 · diffpy/diffpy.structure · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
23 changes: 23 additions & 0 deletions news/fix-deprecation.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Fix deprecation for open file for Python 3.14

**Security:**

* <news item>
3 changes: 1 addition & 2 deletions src/diffpy/structure/structure.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
##############################################################################
"""This module defines class `Structure`."""

import codecs
import copy as copymod

import numpy
Expand Down Expand Up @@ -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

Expand Down
Loading

Back | FazBrowse Home | New Git URL