diff --git a/docs/en_US/release_notes_4_21.rst b/docs/en_US/release_notes_4_21.rst index ec2a2c82c..b8b49a643 100644 --- a/docs/en_US/release_notes_4_21.rst +++ b/docs/en_US/release_notes_4_21.rst @@ -26,6 +26,7 @@ Bug fixes ********* | `Issue #2813 `_ - Ensure that the password prompt should not be visible if the database server is in trust authentication mode. +| `Issue #3495 `_ - Fixed an issue where the query tool unable to load the file which contains the BOM marker. | `Issue #3523 `_ - Fixed an issue where right-clicking a browser object does not apply to the object on which right-click was fired. | `Issue #3645 `_ - Ensure that the start and end date should be deleted when clear the selection for pgAgent Job. | `Issue #3947 `_ - Fixed copy-paste row issues in View/Edit Data. diff --git a/web/pgadmin/misc/file_manager/__init__.py b/web/pgadmin/misc/file_manager/__init__.py index 5311034f4..39aa39315 100644 --- a/web/pgadmin/misc/file_manager/__init__.py +++ b/web/pgadmin/misc/file_manager/__init__.py @@ -1089,8 +1089,11 @@ class Filemanager(object): is_startswith_bom = True enc = encoding - # Check if string is binary - is_binary = is_binary_string(file_data) + # No need to check for binary file, a BOM marker already + # indicates that text stream afterwards + if not is_startswith_bom: + # Check if string is binary + is_binary = is_binary_string(file_data) except IOError as ex: status = False