Repository: bottlepy/bottle

Issue:
Update comment for inclusive language 
Hi there,

I would like to suggest the updating of bottle.py for inclusive language. It's one small word in one comment here:

https://github.com/bottlepy/bottle/blob/71bb933649ba009cd537c2e973519d6e024c02a2/bottle.py#L1658

At Artsy, we're updating our repositories and dependencies here per this RFC artsy/README#427. For such a change we are adopting 'denylist' over 'blacklist.'

For such a small change I would normally just open a PR, but I want to respect community norms and am new here. 
Thanks. KT

Discussion:

Patch:
diff --git a/LICENSE b/LICENSE
index 952e6c3..a4ea15f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009-2018, Marcel Hellkamp.
+Copyright (c) 2009-2022, Marcel Hellkamp.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/bottle.py b/bottle.py
index be42bcb..d94721f 100755
--- a/bottle.py
+++ b/bottle.py
@@ -1363,7 +1363,7 @@ class BaseRequest(object):
 
     def _get_body_string(self, maxread):
         """ Read body into a string. Raise HTTPError(413) on requests that are
-            to large. """
+            too large. """
         if self.content_length > maxread:
             raise HTTPError(413, 'Request entity too large')
         data = self.body.read(maxread + 1)
@@ -1594,7 +1594,7 @@ class BaseRequest(object):
     def __setattr__(self, name, value):
         if name == 'environ': return object.__setattr__(self, name, value)
         key = 'bottle.request.ext.%s' % name
-        if key in self.environ:
+        if hasattr(self, name):
             raise AttributeError("Attribute already defined: %s" % name)
         self.environ[key] = value
 
@@ -1655,7 +1655,7 @@ class BaseResponse(object):
     default_status = 200
     default_content_type = 'text/html; charset=UTF-8'
 
-    # Header blacklist for specific response codes
+    # Header denylist for specific response codes
     # (rfc2616 section 10.2.3 and 10.3.5)
     bad_headers = {
         204: frozenset(('Content-Type', 'Content-Length')),


Test patch:
diff --git a/test/test_environ.py b/test/test_environ.py
index 908b9d8..d367448 100755
--- a/test/test_environ.py
+++ b/test/test_environ.py
@@ -462,6 +462,9 @@ class TestRequest(unittest.TestCase):
             # Attributes are read-only once set.
             self.assertRaises(AttributeError, setattr, r, 'foo', 'x')
 
+            # Properties raise AttributeError.
+            self.assertRaises(AttributeError, setattr, r, 'body', 'x')
+
             # Unknown attributes raise AttributeError.
             self.assertRaises(AttributeError, getattr, r, 'somevalue')