Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
2f448d97
Commit
2f448d97
authored
Oct 17, 2022
by
w-e-w
Committed by
AUTOMATIC1111
Oct 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
styles.csv encoding utf8 to utf-8-sig
utf-8-bom for better compatibility for some programs
parent
433a7525
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
modules/styles.py
modules/styles.py
+2
-2
No files found.
modules/styles.py
View file @
2f448d97
...
...
@@ -45,7 +45,7 @@ class StyleDatabase:
if
not
os
.
path
.
exists
(
path
):
return
with
open
(
path
,
"r"
,
encoding
=
"utf
8
"
,
newline
=
''
)
as
file
:
with
open
(
path
,
"r"
,
encoding
=
"utf
-8-sig
"
,
newline
=
''
)
as
file
:
reader
=
csv
.
DictReader
(
file
)
for
row
in
reader
:
# Support loading old CSV format with "name, text"-columns
...
...
@@ -79,7 +79,7 @@ class StyleDatabase:
def
save_styles
(
self
,
path
:
str
)
->
None
:
# Write to temporary file first, so we don't nuke the file if something goes wrong
fd
,
temp_path
=
tempfile
.
mkstemp
(
".csv"
)
with
os
.
fdopen
(
fd
,
"w"
,
encoding
=
"utf
8
"
,
newline
=
''
)
as
file
:
with
os
.
fdopen
(
fd
,
"w"
,
encoding
=
"utf
-8-sig
"
,
newline
=
''
)
as
file
:
# _fields is actually part of the public API: typing.NamedTuple is a replacement for collections.NamedTuple,
# and collections.NamedTuple has explicit documentation for accessing _fields. Same goes for _asdict()
writer
=
csv
.
DictWriter
(
file
,
fieldnames
=
PromptStyle
.
_fields
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment