diff --git a/.pycodestyle b/.pycodestyle index 376af57e948..8fb7461fcb3 100644 --- a/.pycodestyle +++ b/.pycodestyle @@ -1,5 +1,5 @@ [pycodestyle] -ignore = E402,W504,W605,E231,W605 +ignore = E402,W504,E231 max-line-length = 79 statistics = True show-source = False diff --git a/docs/en_US/release_notes_7_9.rst b/docs/en_US/release_notes_7_9.rst index aa22459798a..08afdcf09cd 100644 --- a/docs/en_US/release_notes_7_9.rst +++ b/docs/en_US/release_notes_7_9.rst @@ -27,12 +27,14 @@ New features Housekeeping ************ + | `Issue #6441 `_ - Update app bundle built to use notarytool instead of altool. | `Issue #6479 `_ - Replace the current layout library wcDocker with ReactJS based rc-dock. Bug fixes ********* | `Issue #2986 `_ - Fix an issue where the scroll position of panels was not remembered on Firefox. + | `Issue #5807 `_ - Fixed an issue where psql was not taking the role used to connect in server properties. | `Issue #6459 `_ - Fix the sorting of size on the statistics panel. | `Issue #6487 `_ - Fixed restoration of query tool database connection after dropping and re-creating the database with the same name. | `Issue #6602 `_ - Fix an issue where the default server-group is being deleted if the load-server json file contains no servers. diff --git a/tools/sql_keywords.py b/tools/sql_keywords.py index c69e2950a9f..a5e147cf466 100644 --- a/tools/sql_keywords.py +++ b/tools/sql_keywords.py @@ -21,7 +21,7 @@ "https://raw.githubusercontent.com/postgres/postgres/master/src/pl/" "plpgsql/src/pl_scanner.c", ] -PG_CODES_REGEX = "PG_KEYWORD\(\"([a-z]*)\"[A-Z_, ]*\)" +PG_CODES_REGEX = r"PG_KEYWORD\(\"([a-z]*)\"[A-Z_, ]*\)" PG_SQL_DOCS_URL = \ "https://www.postgresql.org/docs/current/sql-keywords-appendix.html" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_sql.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_sql.py index b15534af1b2..52cb352c9bc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_sql.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_sql.py @@ -100,7 +100,7 @@ def runTest(self): orig_sql = json.loads(get_response.data.decode('utf-8')) # Replace multiple spaces with one space and check the expected sql - sql = re.sub('\s+', ' ', orig_sql).strip() + sql = re.sub(r'\s+', ' ', orig_sql).strip() expected_sql = '-- DOMAIN: {0}.{1} -- DROP DOMAIN IF EXISTS ' \ '{0}.{1}; CREATE DOMAIN {0}.{1} {2} ' \ 'ALTER DOMAIN {0}.{1} OWNER' \ diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_procedure_exec_sql.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_procedure_exec_sql.py index ff65af98adc..2697c987859 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_procedure_exec_sql.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_procedure_exec_sql.py @@ -60,7 +60,7 @@ def runTest(self): exec_sql = json.loads(exec_response.data.decode('utf-8')) # Replace multiple spaces with one space and check the expected sql - sql = re.sub('\s+', ' ', exec_sql).strip() + sql = re.sub(r'\s+', ' ', exec_sql).strip() # Verify the expected EXEC SQL if self.server_type == "pg": diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/__init__.py index 9ef1d544425..c51795dda1b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/__init__.py @@ -582,7 +582,7 @@ def get_inner(sql): if sql is None: return None start = 0 - start_position = re.search("\s+[is|as]+\s+", sql, flags=re.I) + start_position = re.search(r"\s+[is|as]+\s+", sql, flags=re.I) if start_position: start = start_position.start() + 4 diff --git a/web/pgadmin/tools/psql/__init__.py b/web/pgadmin/tools/psql/__init__.py index ce723cb8fbc..9566f18606c 100644 --- a/web/pgadmin/tools/psql/__init__.py +++ b/web/pgadmin/tools/psql/__init__.py @@ -11,7 +11,11 @@ import select import struct import config -import subprocess +import sys +if sys.version_info >= (3, 12): + import subprocess +else: + from eventlet.green import subprocess import re from sys import platform as _platform from config import PG_DEFAULT_DRIVER @@ -391,8 +395,8 @@ def enter_key_press(data): """ user_input = data['input'] - if user_input == '\q' or user_input == 'q\\q' or user_input in\ - ['\quit', 'exit', 'exit;']: + if user_input == r'\q' or user_input == 'q\\q' or user_input in\ + [r'\quit', 'exit', 'exit;']: # If user enter \q to terminate the PSQL, emit the msg to # notify user connection is terminated. sio.emit('pty-output', @@ -553,7 +557,7 @@ def disconnect_socket(): process.terminate() del app.config['sessions'][request.sid] else: - os.write(app.config['sessions'][request.sid], '\q\n'.encode()) + os.write(app.config['sessions'][request.sid], r'\q\n'.encode()) sio.sleep(1) os.close(app.config['sessions'][request.sid]) os.close(cdata[request.sid]) diff --git a/web/pgadmin/tools/sqleditor/tests/test_sql_ascii_encoding.py b/web/pgadmin/tools/sqleditor/tests/test_sql_ascii_encoding.py index 2283ddf6d71..fe1bf3493a7 100644 --- a/web/pgadmin/tools/sqleditor/tests/test_sql_ascii_encoding.py +++ b/web/pgadmin/tools/sqleditor/tests/test_sql_ascii_encoding.py @@ -32,7 +32,7 @@ class TestSQLASCIIEncoding(BaseTestGenerator): table_name='test_sql_ascii', db_encoding='SQL_ASCII', lc_collate='C', - test_str='\\\\Four\\\Three\\Two\One' + test_str=r'\\\\Four\\\Three\\Two\One' )), ( 'Test SQL_ASCII data with file path', @@ -40,7 +40,7 @@ class TestSQLASCIIEncoding(BaseTestGenerator): table_name='test_sql_ascii', db_encoding='SQL_ASCII', lc_collate='C', - test_str='\\test\Documents\2017\12\19\AD93E646-' + test_str=r'\\test\Documents\2017\12\19\AD93E646-' 'E5FE-11E7-85AE-EB2E217F96F0.tif' )), ( diff --git a/web/regression/re_sql/tests/test_resql.py b/web/regression/re_sql/tests/test_resql.py index 3c3fd9d42c6..d37f706846c 100644 --- a/web/regression/re_sql/tests/test_resql.py +++ b/web/regression/re_sql/tests/test_resql.py @@ -765,7 +765,7 @@ def preprocess_expected_sql(self, scenario, sql, resp_sql, object_id): password = '' for line in resp_sql.split('\n'): if 'PASSWORD' in line: - found = re.search("'([\w\W]*)'", line) + found = re.search(r"'([\w\W]*)'", line) if found: password = found.groups(0)[0] break