mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-02 06:19:10 -07:00
Move a path being passed around as a byte string to being passed around as a text string. (#17190)
This is enough to get minimal copy module working on python3 We have t omodify dataloader's path_dwim_relative_stack and everything that calls it to use text paths instead of byte string paths
This commit is contained in:
parent
20bde8f549
commit
313d4b2c9e
12 changed files with 94 additions and 58 deletions
|
@ -58,13 +58,13 @@ class LookupModule(LookupBase):
|
|||
|
||||
def read_properties(self, filename, key, dflt, is_regexp):
|
||||
config = StringIO()
|
||||
config.write(u'[java_properties]\n' + open(filename).read())
|
||||
config.write(u'[java_properties]\n' + open(to_bytes(filename, errors='strict')).read())
|
||||
config.seek(0, os.SEEK_SET)
|
||||
self.cp.readfp(config)
|
||||
return self.get_value(key, 'java_properties', dflt, is_regexp)
|
||||
|
||||
def read_ini(self, filename, key, section, dflt, is_regexp):
|
||||
self.cp.readfp(open(filename))
|
||||
self.cp.readfp(open(to_bytes(filename, errors='strict')))
|
||||
return self.get_value(key, section, dflt, is_regexp)
|
||||
|
||||
def get_value(self, key, section, dflt, is_regexp):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue