Commit 06fb0d1
committed
Fix UnboundLocalError in push() and clonedb() when no remote auth configured
`headers` was only initialized inside the `if self._remote_auth_dict or
remote_auth:` block, but `headers.update(self._default_headers)` ran
unconditionally. When neither remote_auth parameter nor client-level
remote auth is set (the common case for local/unauthenticated connections),
this raises `UnboundLocalError: cannot access local variable 'headers'`.
Fix: initialize `headers = {}` before the conditional block so the
subsequent `.update()` always has a valid dict to work with.
Affected methods:
- `Client.push()`
- `Client.clonedb()`
Note: `Client.pull()` is not affected — it passes `self._default_headers`
directly without the conditional pattern.1 parent 82f0319 commit 06fb0d1
1 file changed
Lines changed: 12 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2083 | 2083 | | |
2084 | 2084 | | |
2085 | 2085 | | |
| 2086 | + | |
2086 | 2087 | | |
2087 | | - | |
2088 | | - | |
2089 | | - | |
2090 | | - | |
2091 | | - | |
2092 | | - | |
2093 | | - | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
2094 | 2093 | | |
2095 | 2094 | | |
2096 | 2095 | | |
| |||
2619 | 2618 | | |
2620 | 2619 | | |
2621 | 2620 | | |
| 2621 | + | |
2622 | 2622 | | |
2623 | | - | |
2624 | | - | |
2625 | | - | |
2626 | | - | |
2627 | | - | |
2628 | | - | |
2629 | | - | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
2630 | 2628 | | |
2631 | 2629 | | |
2632 | 2630 | | |
| |||
0 commit comments