+ If the value has a 'name' attribute, it is returned to unmodified. Otherwise the name and the value with any linesep characters removed are passed to the header_factory method, and the resulting custom header object is returned. Any surrogateescaped bytes get turne
(self, name, value)
| 148 | return (name, self.header_factory(name, value)) |
| 149 | |
| 150 | def header_fetch_parse(self, name, value): |
| 151 | """+ |
| 152 | If the value has a 'name' attribute, it is returned to unmodified. |
| 153 | Otherwise the name and the value with any linesep characters removed |
| 154 | are passed to the header_factory method, and the resulting custom |
| 155 | header object is returned. Any surrogateescaped bytes get turned |
| 156 | into the unicode unknown-character glyph. |
| 157 | |
| 158 | """ |
| 159 | if hasattr(value, 'name'): |
| 160 | return value |
| 161 | # We can't use splitlines here because it splits on more than \r and \n. |
| 162 | value = ''.join(linesep_splitter.split(value)) |
| 163 | return self.header_factory(name, value) |
| 164 | |
| 165 | def fold(self, name, value): |
| 166 | """+ |