Skip to content

Commit

Permalink
Writing out static_index.html as binary file to prevent line-ending
Browse files Browse the repository at this point in the history
conversions on Windows. (similar behaviour as index.html)
  • Loading branch information
mescanne committed Sep 11, 2023
1 parent bab5dc2 commit e8c8eb2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/dbt/task/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import agate

from dbt.dataclass_schema import ValidationError
from dbt.clients.system import load_file_contents, write_file
from dbt.clients.system import load_file_contents

from .compile import CompileTask

Expand Down Expand Up @@ -282,7 +282,8 @@ def run(self) -> CatalogArtifact:

# Write out the new index file
static_index_path = os.path.join(self.config.project_target_path, "static_index.html")
write_file(static_index_path, index_data)
with open(static_index_path, "wb") as static_index_file:
static_index_file.write(bytes(index_data, "utf8"))

if exceptions:
fire_event(WriteCatalogFailure(num_exceptions=len(exceptions)))
Expand Down

0 comments on commit e8c8eb2

Please sign in to comment.