Repository: obspy/obspy

Issue:
FDSNWS EIDA routing client broken when setting "debug=True"
### Avoid duplicates

- [X] I searched existing issues

### Bug Summary

Seems there is a problem in EIDAWS routing client. It seems it does not get any data back because `timeout` parameter is injected in the request and that is not expected. Looks like this was introduced by #3021 

EDIT: Actually this only affects the client with option `debug=True`. I ran into this looking into a different issue.

### Code to Reproduce

```python
from obspy.clients.fdsn import RoutingClient
client = RoutingClient("eida-routing", debug=True)
client.get_stations(station='B*', level='station', format='text')
```


### Error Traceback

```Python traceback
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [12], in <cell line: 1>()
----> 1 client.get_stations(station='B*', level='station', format='text')

File ~/miniconda3/envs/master/lib/python3.10/site-packages/decorator.py:232, in decorate.<locals>.fun(*args, **kw)
    230 if not kwsyntax:
    231     args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)

File ~/git/obspy/obspy/clients/fdsn/routing/routing_client.py:78, in _assert_filename_not_in_kwargs(f, *args, **kwargs)
     76 if "filename" in kwargs:
     77     raise ValueError("The `filename` argument is not supported")
---> 78 return f(*args, **kwargs)

File ~/git/obspy/obspy/clients/fdsn/routing/eidaws_routing_client.py:149, in EIDAWSRoutingClient.get_stations(self, **kwargs)
    125 @_assert_filename_not_in_kwargs
    126 def get_stations(self, **kwargs):
    127     """
    128     Get stations from multiple data centers.
    129 
   (...)
    147     for details.
    148     """
--> 149     return super(EIDAWSRoutingClient, self).get_stations(**kwargs)

File ~/miniconda3/envs/master/lib/python3.10/site-packages/decorator.py:232, in decorate.<locals>.fun(*args, **kw)
    230 if not kwsyntax:
    231     args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)

File ~/git/obspy/obspy/clients/fdsn/routing/routing_client.py:78, in _assert_filename_not_in_kwargs(f, *args, **kwargs)
     76 if "filename" in kwargs:
     77     raise ValueError("The `filename` argument is not supported")
---> 78 return f(*args, **kwargs)

File ~/git/obspy/obspy/clients/fdsn/routing/routing_client.py:367, in BaseRoutingClient.get_stations(self, **kwargs)
    363 # Just pass these to the bulk request.
    364 bulk = [kwargs.pop(key, '*') for key in (
    365         "network", "station", "location", "channel", "starttime",
    366         "endtime")]
--> 367 return self.get_stations_bulk([bulk], **kwargs)

File ~/miniconda3/envs/master/lib/python3.10/site-packages/decorator.py:232, in decorate.<locals>.fun(*args, **kw)
    230 if not kwsyntax:
    231     args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)

File ~/git/obspy/obspy/clients/fdsn/routing/routing_client.py:78, in _assert_filename_not_in_kwargs(f, *args, **kwargs)
     76 if "filename" in kwargs:
     77     raise ValueError("The `filename` argument is not supported")
---> 78 return f(*args, **kwargs)

File ~/git/obspy/obspy/clients/fdsn/routing/eidaws_routing_client.py:175, in EIDAWSRoutingClient.get_stations_bulk(self, bulk, **kwargs)
    173 arguments["alternative"] = "false"
    174 bulk_str = get_bulk_string(bulk, arguments)
--> 175 r = self._download(self._url + "/query", data=bulk_str,
    176                    content_type='text/plain')
    177 split = self._split_routing_response(
    178     r.content.decode() if hasattr(r.content, "decode") else r.content)
    179 return self._download_stations(split, **kwargs)

File ~/git/obspy/obspy/clients/base.py:215, in HTTPClient._download(self, url, params, filename, data, content_type)
    213 from requests import PreparedRequest  # noqa
    214 p = PreparedRequest()
--> 215 p.prepare(method="GET", **_request_args)
    216 print("Downloading %s ..." % p.url)
    217 if data is not None:

TypeError: PreparedRequest.prepare() got an unexpected keyword argument 'timeout'
```


### ObsPy Version?

current master

### Operating System?

_No response_

### Python Version?

3.10.5

### Installation Method?

conda


Discussion:

Resolving patch:
diff --git a/obspy/clients/base.py b/obspy/clients/base.py
--- a/obspy/clients/base.py
+++ b/obspy/clients/base.py
@@ -212,7 +212,12 @@ def _download(self, url, params=None, filename=None, data=None,
             # Construct the same URL requests would construct.
             from requests import PreparedRequest  # noqa
             p = PreparedRequest()
-            p.prepare(method="GET", **_request_args)
+            # request doesnt use timeout parameter, it's used when actually
+            # sending the request, but the request is never sent in this debug
+            # block anyway, it's just for printing info on what would be sent
+            p.prepare(
+                method="GET",
+                **{k: v for k, v in _request_args.items() if k != "timeout"})
             print("Downloading %s ..." % p.url)
             if data is not None:
                 print("Sending along the following payload:")


Test patch: