@@ -48,7 +48,6 @@ def __init__(self, config: BaseConfig, arguments: CommitArgs) -> None:
4848 raise NotAGitProjectError ()
4949
5050 self .config : BaseConfig = config
51- self .encoding = config .settings ["encoding" ]
5251 self .cz = factory .committer_factory (self .config )
5352 self .arguments = arguments
5453 self .temp_file : str = get_backup_file_path ()
@@ -59,7 +58,7 @@ def _read_backup_message(self) -> str | None:
5958 return None
6059
6160 # Read commit message from backup
62- with open (self .temp_file , encoding = self .encoding ) as f :
61+ with open (self .temp_file , encoding = self .config . settings [ " encoding" ] ) as f :
6362 return f .read ().strip ()
6463
6564 def _prompt_commit_questions (self ) -> str :
@@ -146,7 +145,9 @@ def __call__(self) -> None:
146145 out .info (f"\n { m } \n " )
147146
148147 if write_message_to_file :
149- with smart_open (write_message_to_file , "w" , encoding = self .encoding ) as file :
148+ with smart_open (
149+ write_message_to_file , "w" , encoding = self .config .settings ["encoding" ]
150+ ) as file :
150151 file .write (m )
151152
152153 if dry_run :
@@ -160,7 +161,9 @@ def __call__(self) -> None:
160161 out .error (c .err )
161162
162163 # Create commit backup
163- with smart_open (self .temp_file , "w" , encoding = self .encoding ) as f :
164+ with smart_open (
165+ self .temp_file , "w" , encoding = self .config .settings ["encoding" ]
166+ ) as f :
164167 f .write (m )
165168
166169 raise CommitError ()
0 commit comments