mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-25 14:10:05 -05:00
Ensure that the original file format should be retained when saving the same file in SQL editor. Fixes #3767
This commit is contained in:
1 parent
87d08de3a0
commit
43e127de31
3 files changed
+19
-1
No files matched your search
@@ -313,6 +313,9 @@ def save_show_hidden_file_option(trans_id):
|
||||
class Filemanager(object):
|
||||
"""FileManager Class."""
|
||||
|
||||
# Stores list of dict for filename & its encoding
|
||||
loaded_file_encoding_list = []
|
||||
|
||||
def __init__(self, trans_id):
|
||||
self.trans_id = trans_id
|
||||
self.patherror = encode_json(
|
||||
@@ -1088,6 +1091,10 @@ class Filemanager(object):
|
||||
# Check if string is binary
|
||||
is_binary = is_binary_string(file_data)
|
||||
|
||||
# Store encoding for future use
|
||||
Filemanager.loaded_file_encoding_list.\
|
||||
append({os.path.basename(filename): enc})
|
||||
|
||||
except IOError as ex:
|
||||
status = False
|
||||
# we don't want to expose real path of file
|
||||
|
||||
Reference in new issue
Block a user