question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

regression: event header can't be copied with normal Python syntax.

See original GitHub issue

I have been using h11 for a while now. In my code, I made a copy of the headers like this:

headers = ev.headers[:]

That is the normal way to copy a list (headers was a list).

Now, after an update, it does this: ValueError: too many values to unpack (expected 3)

in debugger, the same: 1:Debug:1/2> ev.headers[:] *** ValueError: too many values to unpack (expected 3)

Something changed in the headers attrbibute. It also does not have a copy method. 1:Debug:1/2> ev.headers.copy() *** AttributeError: ‘Headers’ object has no attribute ‘copy’

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tomchristiecommented, Oct 13, 2020

Right, so the intent was not to cause any regressions in how we approached #104, but that’s obviously not quite been the case here, since you’ve found a wrinkle.

The change here is that the requirement in #104, of “allow h11 to expose the original header casing” meant that we’ve needed to change headers from a list to a sequence-like interface in the 0.11 release.

There’s two options for us here:

Of those two I’d probably tend towards the first.

From a user POV that’d mean using the following if you want a list-copy of the structure…

headers = list(ev.headers)
0reactions
pgjonescommented, Dec 27, 2020

Does #125 help this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linear Regression in Python - Real Python
In this step-by-step tutorial, you'll get started with linear regression in Python. Linear regression is one of the fundamental statistical ...
Read more >
test — Regression tests package for Python — Python 3.11.1 ...
Test for syntax errors in statement by attempting to compile statement. testcase is the unittest instance for the test. errtext is the regular...
Read more >
Python Logistic Regression Tutorial with Sklearn & Scikit
In this tutorial, you'll learn about Logistic Regression in Python, its basic properties, and build a machine learning model on a real-world application....
Read more >
A Beginner's Guide to Linear Regression in Python with Scikit ...
In this article, we will briefly study what linear regression is and how it can be implemented for both two variables and multiple...
Read more >
Chapter 4. Visualization with Matplotlib - O'Reilly
Matplotlib is a multiplatform data visualization library built on NumPy arrays, … ... We won't delve into the details of Gaussian process regression...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found