Skip to content

Commit

Permalink
slapdtest: Open slapd config file in text mode when writing it
Browse files Browse the repository at this point in the history
  • Loading branch information
pyldap contributors authored and Petr Viktorin committed Nov 24, 2017
1 parent f605dbf commit b2c2b5c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Lib/slapdtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,8 @@ def _ln_schema_files(self, file_names, source_dir):
def _write_config(self):
"""Writes the slapd.conf file out, and returns the path to it."""
self._log.debug('Writing config to %s', self._slapd_conf)
config_file = file(self._slapd_conf, 'wb')
config_file.write(self.gen_config())
config_file.close()
with open(self._slapd_conf, 'w') as config_file:
config_file.write(self.gen_config())
self._log.info('Wrote config to %s', self._slapd_conf)

def _test_config(self):
Expand Down

0 comments on commit b2c2b5c

Please sign in to comment.