diff --git a/.changes/next-release/bugfix-Stubber-96340.json b/.changes/next-release/bugfix-Stubber-96340.json
new file mode 100644
index 000000000..4e3897ebf
--- /dev/null
+++ b/.changes/next-release/bugfix-Stubber-96340.json
@@ -0,0 +1,5 @@
+{
+  "type": "bugfix",
+  "category": "Stubber",
+  "description": "fixes `#1884 <https://github.com/boto/botocore/issues/1884>`__"
+}
diff --git a/botocore/handlers.py b/botocore/handlers.py
index daa228866..a312f5c20 100644
--- a/botocore/handlers.py
+++ b/botocore/handlers.py
@@ -484,8 +484,7 @@ def parse_get_bucket_location(parsed, http_response, **kwargs):
     # The "parsed" passed in only has the ResponseMetadata
     # filled out.  This handler will fill in the LocationConstraint
     # value.
-    if 'LocationConstraint' in parsed:
-        # Response already set - a stub?
+    if http_response.raw is None:
         return
     response_body = http_response.content
     parser = xml.etree.cElementTree.XMLParser(

get_bucket_location returns NoneType error when client error is added
## Problem

When adding a client error through `get_bucket_location`, rather than raise a `ClientError` (or the specified Service Error Code, we instead receive;

 `AttributeError: 'NoneType' object has no attribute 'stream'`

## Working Example (with `get_bucket_logging`)

```
import boto3
from botocore.stub import Stubber

client = boto3.client('s3')
stubber = Stubber(client)
stubber.add_client_error('get_bucket_logging', 'NoSuchBucket')
stubber.activate()

# Raises botocore.errorfactory.NoSuchBucket
client.get_bucket_logging(Bucket="meh")
```
## Non-working Example (with `get_bucket_location`)

```
import boto3
from botocore.stub import Stubber

client = boto3.client('s3')
stubber = Stubber(client)
stubber.add_client_error('get_bucket_location', 'NoSuchBucket')
stubber.activate()

# Raises an AttributeError from within awsrequest.py
client.get_bucket_location(Bucket="meh")
```
The full stack response from this error is;
```
Traceback (most recent call last):
  File "untitled.py", line 24, in <module>
    client.get_bucket_location(Bucket="meh")
  File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 655, in _make_api_call
    model=operation_model, context=request_context
  File "/usr/local/lib/python3.7/site-packages/botocore/hooks.py", line 356, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "/usr/local/lib/python3.7/site-packages/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/botocore/handlers.py", line 485, in parse_get_bucket_location
    response_body = http_response.content
  File "/usr/local/lib/python3.7/site-packages/botocore/awsrequest.py", line 587, in content
    self._content = bytes().join(self.raw.stream()) or bytes()
AttributeError: 'NoneType' object has no attribute 'stream'
```
## Summary

I've tried searching open/closed issues but can't find something similar, nor a working example online using `get_bucket_location`. I fear this might be a bug within `botocore.stub` itself. Any help would be greatly appreciated! Thanks.



diff --git a/tests/functional/test_stub.py b/tests/functional/test_stub.py
index f44b722b4..752ba2249 100644
--- a/tests/functional/test_stub.py
+++ b/tests/functional/test_stub.py
@@ -313,3 +313,21 @@ class TestStubber(unittest.TestCase):
             actual_response = self.client.list_objects(**expected_params)
             self.assertEqual(desired_response, actual_response)
         self.stubber.assert_no_pending_responses()
+
+    def test_parse_get_bucket_location(self):
+        error_code = "NoSuchBucket"
+        error_message = "The specified bucket does not exist"
+        self.stubber.add_client_error(
+            'get_bucket_location', error_code, error_message)
+        self.stubber.activate()
+
+        with self.assertRaises(ClientError):
+            self.client.get_bucket_location(Bucket='foo')
+
+    def test_parse_get_bucket_location_returns_response(self):
+        service_response = {"LocationConstraint": "us-west-2"}
+        self.stubber.add_response('get_bucket_location',service_response)
+        self.stubber.activate()
+        response = self.client.get_bucket_location(Bucket='foo')
+        self.assertEqual(response, service_response)
+
diff --git a/tests/unit/test_handlers.py b/tests/unit/test_handlers.py
index 551d18f5d..a41bacb29 100644
--- a/tests/unit/test_handlers.py
+++ b/tests/unit/test_handlers.py
@@ -921,13 +921,6 @@ class TestHandlers(BaseSessionTest):
         self.assertEqual(parsed['CommonPrefixes'][0]['Prefix'],
                          u'\xe7\xf6s% asd\x08 c')
 
-    def test_get_bucket_location_optional(self):
-        # This handler should no-op if another hook (i.e. stubber) has already
-        # filled in response
-        response = {"LocationConstraint": "eu-west-1"}
-        handlers.parse_get_bucket_location(response, None),
-        self.assertEqual(response["LocationConstraint"], "eu-west-1")
-
     def test_set_operation_specific_signer_no_auth_type(self):
         signing_name = 'myservice'
         context = {'auth_type': None}

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.8
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
behave==1.2.5
-e git+https://github.com/boto/botocore.git@94127c6a89918ec039389291933a7372916cff28#egg=botocore
coverage==7.6.1
distlib==0.3.9
docutils==0.15.2
exceptiongroup==1.2.2
execnet==2.1.1
filelock==3.16.1
iniconfig==2.1.0
jmespath==0.10.0
jsonschema==2.5.1
mock==1.3.0
nose==1.3.7
packaging==24.2
parse==1.20.2
parse_type==0.6.4
pbr==6.1.1
platformdirs==4.3.6
pluggy==1.5.0
py==1.11.0
pytest==8.3.5
pytest-asyncio==0.24.0
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
six==1.17.0
tomli==2.2.1
tox==2.9.1
urllib3==1.25.11
virtualenv==20.29.3

name: botocore
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=24.2=py38h06a4308_0
  - python=3.8.20=he870216_0
  - readline=8.2=h5eee18b_0
  - setuptools=75.1.0=py38h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - behave==1.2.5
      - coverage==7.6.1
      - distlib==0.3.9
      - docutils==0.15.2
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - filelock==3.16.1
      - iniconfig==2.1.0
      - jmespath==0.10.0
      - jsonschema==2.5.1
      - mock==1.3.0
      - nose==1.3.7
      - packaging==24.2
      - parse==1.20.2
      - parse-type==0.6.4
      - pbr==6.1.1
      - platformdirs==4.3.6
      - pluggy==1.5.0
      - py==1.11.0
      - pytest==8.3.5
      - pytest-asyncio==0.24.0
      - pytest-cov==5.0.0
      - pytest-mock==3.14.0
      - pytest-xdist==3.6.1
      - python-dateutil==2.9.0.post0
      - six==1.17.0
      - tomli==2.2.1
      - tox==2.9.1
      - urllib3==1.25.11
      - virtualenv==20.29.3
      - wheel==0.24.0
prefix: /opt/conda/envs/botocore

tests/functional/test_stub.py::TestStubber::test_parse_get_bucket_location
tests/functional/test_stub.py::TestStubber::test_ANY_repr tests/functional/test_stub.py::TestStubber::test_activated_stubber_errors_with_no_registered_stubs tests/functional/test_stub.py::TestStubber::test_any_ignores_param_for_validation tests/functional/test_stub.py::TestStubber::test_can_add_expected_params_to_client_error tests/functional/test_stub.py::TestStubber::test_can_continue_to_call_after_expected_params_fail tests/functional/test_stub.py::TestStubber::test_can_expected_param_fails_in_client_error tests/functional/test_stub.py::TestStubber::test_can_stub_with_presign_url_mixed_in tests/functional/test_stub.py::TestStubber::test_client_error_response tests/functional/test_stub.py::TestStubber::test_context_manager_returns_response tests/functional/test_stub.py::TestStubber::test_expected_params_fail tests/functional/test_stub.py::TestStubber::test_expected_params_mixed_with_errors_responses tests/functional/test_stub.py::TestStubber::test_expected_params_success tests/functional/test_stub.py::TestStubber::test_many_expected_params tests/functional/test_stub.py::TestStubber::test_mixed_any_and_concrete_params tests/functional/test_stub.py::TestStubber::test_nested_any_param tests/functional/test_stub.py::TestStubber::test_no_stub_for_presign_url tests/functional/test_stub.py::TestStubber::test_none_param tests/functional/test_stub.py::TestStubber::test_parse_get_bucket_location_returns_response tests/functional/test_stub.py::TestStubber::test_still_relies_on_param_validation_with_expected_params tests/functional/test_stub.py::TestStubber::test_stubber_errors_when_stubs_are_used_up tests/functional/test_stub.py::TestStubber::test_stubber_returns_response tests/unit/test_handlers.py::TestHandlers::test_200_response_with_no_error_left_untouched tests/unit/test_handlers.py::TestHandlers::test_500_response_can_be_none tests/unit/test_handlers.py::TestHandlers::test_500_status_code_set_for_200_response tests/unit/test_handlers.py::TestHandlers::test_accept_header_not_added_if_present tests/unit/test_handlers.py::TestHandlers::test_account_id_not_added_if_present tests/unit/test_handlers.py::TestHandlers::test_application_json_header_added tests/unit/test_handlers.py::TestHandlers::test_bucket_too_long_raises_exception tests/unit/test_handlers.py::TestHandlers::test_cant_decode_quoted_jsondoc tests/unit/test_handlers.py::TestHandlers::test_checksum_added_only_if_not_exists tests/unit/test_handlers.py::TestHandlers::test_copy_source_has_validation_failure tests/unit/test_handlers.py::TestHandlers::test_copy_source_ignored_if_not_dict tests/unit/test_handlers.py::TestHandlers::test_copy_source_supports_dict tests/unit/test_handlers.py::TestHandlers::test_copy_source_supports_optional_version_id tests/unit/test_handlers.py::TestHandlers::test_copy_source_with_multiple_questions tests/unit/test_handlers.py::TestHandlers::test_decode_json_policy tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_does_not_decode_without_context tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_v2 tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_v2_does_not_decode_continuationtoken tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_v2_does_not_decode_without_context tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_v2_with_common_prefixes tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_v2_with_delimiter tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_v2_with_prefix tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_v2_with_startafter tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_with_common_prefixes tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_with_delimiter tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_with_marker tests/unit/test_handlers.py::TestHandlers::test_decode_list_objects_with_nextmarker tests/unit/test_handlers.py::TestHandlers::test_decode_quoted_jsondoc tests/unit/test_handlers.py::TestHandlers::test_dest_region_removed tests/unit/test_handlers.py::TestHandlers::test_destination_region_always_changed tests/unit/test_handlers.py::TestHandlers::test_disable_signing tests/unit/test_handlers.py::TestHandlers::test_does_decode_template_body_in_order tests/unit/test_handlers.py::TestHandlers::test_get_console_output tests/unit/test_handlers.py::TestHandlers::test_get_console_output_bad_unicode_errors tests/unit/test_handlers.py::TestHandlers::test_get_console_output_cant_be_decoded tests/unit/test_handlers.py::TestHandlers::test_get_template_has_error_response tests/unit/test_handlers.py::TestHandlers::test_glacier_checksums_added tests/unit/test_handlers.py::TestHandlers::test_glacier_checksums_support_raw_bytes tests/unit/test_handlers.py::TestHandlers::test_glacier_version_header_added tests/unit/test_handlers.py::TestHandlers::test_inject_account_id tests/unit/test_handlers.py::TestHandlers::test_inject_presigned_url_ec2 tests/unit/test_handlers.py::TestHandlers::test_inject_presigned_url_rds tests/unit/test_handlers.py::TestHandlers::test_invalid_char_in_bucket_raises_exception tests/unit/test_handlers.py::TestHandlers::test_noop_if_output_key_does_not_exist tests/unit/test_handlers.py::TestHandlers::test_not_dns_compat_but_still_valid_bucket_name tests/unit/test_handlers.py::TestHandlers::test_only_quote_url_path_not_version_id tests/unit/test_handlers.py::TestHandlers::test_only_version_id_is_special_cased tests/unit/test_handlers.py::TestHandlers::test_presigned_url_already_present_ec2 tests/unit/test_handlers.py::TestHandlers::test_presigned_url_already_present_for_rds tests/unit/test_handlers.py::TestHandlers::test_presigned_url_already_present_rds tests/unit/test_handlers.py::TestHandlers::test_presigned_url_casing_changed_for_rds tests/unit/test_handlers.py::TestHandlers::test_presigned_url_with_source_region_ec2 tests/unit/test_handlers.py::TestHandlers::test_presigned_url_with_source_region_rds tests/unit/test_handlers.py::TestHandlers::test_quote_source_header_needs_no_changes tests/unit/test_handlers.py::TestHandlers::test_route53_resource_id tests/unit/test_handlers.py::TestHandlers::test_route53_resource_id_missing_input_shape tests/unit/test_handlers.py::TestHandlers::test_run_instances_userdata tests/unit/test_handlers.py::TestHandlers::test_run_instances_userdata_blob tests/unit/test_handlers.py::TestHandlers::test_set_encoding_type tests/unit/test_handlers.py::TestHandlers::test_set_operation_specific_signer_no_auth_type tests/unit/test_handlers.py::TestHandlers::test_set_operation_specific_signer_s3v4 tests/unit/test_handlers.py::TestHandlers::test_set_operation_specific_signer_s3v4_unsigned_payload tests/unit/test_handlers.py::TestHandlers::test_set_operation_specific_signer_unsigned tests/unit/test_handlers.py::TestHandlers::test_set_operation_specific_signer_v4 tests/unit/test_handlers.py::TestHandlers::test_set_operation_specific_signer_v4_unsinged_payload tests/unit/test_handlers.py::TestHandlers::test_source_region_removed tests/unit/test_handlers.py::TestHandlers::test_source_region_removed_when_presigned_url_provided_for_rds tests/unit/test_handlers.py::TestHandlers::test_switch_host_with_param tests/unit/test_handlers.py::TestHandlers::test_tree_hash_added_only_if_not_exists tests/unit/test_handlers.py::TestHandlers::test_use_event_operation_name tests/unit/test_handlers.py::TestHandlers::test_valid_bucket_name_hyphen tests/unit/test_handlers.py::TestHandlers::test_valid_bucket_name_period tests/unit/test_handlers.py::TestHandlers::test_valid_bucket_name_underscore tests/unit/test_handlers.py::TestHandlers::test_validate_non_ascii_metadata_keys tests/unit/test_handlers.py::TestHandlers::test_validate_non_ascii_metadata_values tests/unit/test_handlers.py::TestHandlers::test_validate_non_triggered_when_no_md_specified tests/unit/test_handlers.py::TestHandlers::test_validation_is_global_s3_bucket_arn tests/unit/test_handlers.py::TestHandlers::test_validation_is_noop_if_no_bucket_param_exists tests/unit/test_handlers.py::TestHandlers::test_validation_is_other_service_arn tests/unit/test_handlers.py::TestHandlers::test_validation_is_s3_accesspoint_arn tests/unit/test_handlers.py::TestHandlers::test_validation_passes_when_all_ascii_chars tests/unit/test_handlers.py::TestConvertStringBodyToFileLikeObject::test_binary tests/unit/test_handlers.py::TestConvertStringBodyToFileLikeObject::test_file tests/unit/test_handlers.py::TestConvertStringBodyToFileLikeObject::test_non_ascii_characters tests/unit/test_handlers.py::TestConvertStringBodyToFileLikeObject::test_string tests/unit/test_handlers.py::TestConvertStringBodyToFileLikeObject::test_unicode tests/unit/test_handlers.py::TestRetryHandlerOrder::test_s3_special_case_is_before_other_retry tests/unit/test_handlers.py::TestSSEMD5::test_copy_source_sse_params tests/unit/test_handlers.py::TestSSEMD5::test_copy_source_sse_params_as_str tests/unit/test_handlers.py::TestSSEMD5::test_raises_error_when_md5_unavailable tests/unit/test_handlers.py::TestSSEMD5::test_sse_params tests/unit/test_handlers.py::TestSSEMD5::test_sse_params_as_str tests/unit/test_handlers.py::TestAddMD5::test_add_md5_raises_error_when_md5_unavailable tests/unit/test_handlers.py::TestAddMD5::test_add_md5_with_bytearray_object tests/unit/test_handlers.py::TestAddMD5::test_add_md5_with_bytes_object tests/unit/test_handlers.py::TestAddMD5::test_add_md5_with_file_like_body tests/unit/test_handlers.py::TestAddMD5::test_adds_md5_when_s3v2 tests/unit/test_handlers.py::TestAddMD5::test_adds_md5_when_s3v4 tests/unit/test_handlers.py::TestAddMD5::test_adds_md5_when_v4 tests/unit/test_handlers.py::TestAddMD5::test_conditional_does_not_add_when_md5_unavailable tests/unit/test_handlers.py::TestParameterAlias::test_alias_parameter_and_original_in_call tests/unit/test_handlers.py::TestParameterAlias::test_alias_parameter_in_call tests/unit/test_handlers.py::TestParameterAlias::test_alias_parameter_in_call_does_not_touch_original tests/unit/test_handlers.py::TestParameterAlias::test_alias_parameter_in_documentation_request_example tests/unit/test_handlers.py::TestParameterAlias::test_alias_parameter_in_documentation_request_params tests/unit/test_handlers.py::TestParameterAlias::test_does_not_alias_parameter_for_no_input_shape tests/unit/test_handlers.py::TestParameterAlias::test_does_not_alias_parameter_for_not_modeled_member tests/unit/test_handlers.py::TestCommandAlias::test_command_alias tests/unit/test_handlers.py::TestPrependToHost::test_does_prepend_to_host tests/unit/test_handlers.py::TestPrependToHost::test_does_prepend_to_host_with_http tests/unit/test_handlers.py::TestPrependToHost::test_does_prepend_to_host_with_more_components tests/unit/test_handlers.py::TestPrependToHost::test_does_prepend_to_host_with_path tests/unit/test_handlers.py::TestPrependToHost::test_does_validate_host_with_illegal_char tests/unit/test_handlers.py::TestPrependToHost::test_does_validate_long_host
botocore/handlers.py .changes/next-release/bugfix-Stubber-96340.json
botocore/handlers.py .changes/next-release/bugfix-Stubber-96340.json