@@ -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 .backup_file_path = get_backup_file_path ()
@@ -59,7 +58,9 @@ def _read_backup_message(self) -> str | None:
5958 return None
6059
6160 # Read commit message from backup
62- with open (self .backup_file_path , encoding = self .encoding ) as f :
61+ with open (
62+ self .backup_file_path , encoding = self .config .settings ["encoding" ]
63+ ) as f :
6364 return f .read ().strip ()
6465
6566 def _prompt_commit_questions (self ) -> str :
@@ -146,7 +147,9 @@ def __call__(self) -> None:
146147 out .info (f"\n { commit_message } \n " )
147148
148149 if write_message_to_file :
149- with smart_open (write_message_to_file , "w" , encoding = self .encoding ) as file :
150+ with smart_open (
151+ write_message_to_file , "w" , encoding = self .config .settings ["encoding" ]
152+ ) as file :
150153 file .write (commit_message )
151154
152155 if dry_run :
@@ -160,7 +163,9 @@ def __call__(self) -> None:
160163 out .error (c .err )
161164
162165 # Create commit backup
163- with smart_open (self .backup_file_path , "w" , encoding = self .encoding ) as f :
166+ with smart_open (
167+ self .backup_file_path , "w" , encoding = self .config .settings ["encoding" ]
168+ ) as f :
164169 f .write (commit_message )
165170
166171 raise CommitError ()
0 commit comments