You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "bschoening (via GitHub)" <gi...@apache.org> on 2025/04/10 14:46:34 UTC

[PR] CASSANDRA-20478: added handler for AttributeError exception [cassandra]

bschoening opened a new pull request, #4076:
URL: https://github.com/apache/cassandra/pull/4076

   Thanks for sending a pull request! Here are some tips if you're new here:
    
    * Ensure you have added or run the [appropriate tests](https://cassandra.apache.org/_/development/testing.html) for your PR.
    * Be sure to keep the PR description updated to reflect all changes.
    * Write your PR title to summarize what this PR proposes.
    * If possible, provide a concise example to reproduce the issue for a faster review.
    * Read our [contributor guidelines](https://cassandra.apache.org/_/development/index.html)
    * If you're making a documentation change, see our [guide to documentation contribution](https://cassandra.apache.org/_/development/documentation.html)
    
   Commit messages should follow the following format:
   
   ```
   <One sentence description, usually Jira title or CHANGES.txt summary>
   
   <Optional lengthier description (context on patch)>
   
   patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####
   
   Co-authored-by: Name1 <email1>
   Co-authored-by: Name2 <email2>
   
   ```
   
   The [Cassandra Jira](https://issues.apache.org/jira/projects/CASSANDRA/issues/)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-20478: added handler for AttributeError exception [cassandra]

Posted by "bschoening (via GitHub)" <gi...@apache.org>.
bschoening commented on code in PR #4076:
URL: https://github.com/apache/cassandra/pull/4076#discussion_r2038643601


##########
pylib/cqlshlib/util.py:
##########
@@ -74,12 +74,15 @@ def identity(x):
 def is_file_secure(filename):
     try:
         st = os.stat(filename)
+        uid = os.getuid()
     except OSError as e:
         if e.errno != errno.ENOENT:
             raise
         # the file doesn't exist, the security of it is irrelevant
         return True
-    uid = os.getuid()
+    except AttributeError as e:

Review Comment:
   Yes, I thought that too, but when I tried it, accessing **e.errno** threw a second exception, because that also requires Unix.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-20478: added handler for AttributeError exception [cassandra]

Posted by "driftx (via GitHub)" <gi...@apache.org>.
driftx commented on code in PR #4076:
URL: https://github.com/apache/cassandra/pull/4076#discussion_r2038086411


##########
pylib/cqlshlib/util.py:
##########
@@ -74,12 +74,15 @@ def identity(x):
 def is_file_secure(filename):
     try:
         st = os.stat(filename)
+        uid = os.getuid()
     except OSError as e:
         if e.errno != errno.ENOENT:
             raise
         # the file doesn't exist, the security of it is irrelevant
         return True
-    uid = os.getuid()
+    except AttributeError as e:

Review Comment:
   This could be added to the except block above to cover both cases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-20478: added handler for AttributeError exception [cassandra]

Posted by "bschoening (via GitHub)" <gi...@apache.org>.
bschoening closed pull request #4076: CASSANDRA-20478: added handler for AttributeError exception
URL: https://github.com/apache/cassandra/pull/4076


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org