Commit 3466ed4
committed
Python 3 preparation: HTTP headers handling in roundup_server.py.
HTTP headers are handled differently in Python 3 (where they use
email.message.Message) compared to Python 2 (where they use
mimetools.Message). In some places the code needs to check which
version of the interface is available. For the common case of getting
a single header, ".get" is available in both versions, and is an alias
of ".getheader" in Python 2. (Note that the Python 3 semantics of
".get" are slightly different from those in Python 2 if there is more
than one of a given header - it returns an arbitrary one, when in
Python 2 it's specified to return the last one. Hopefully the places
using this interface rather than explicitly allowing for multiple
headers with the same name are OK with that and it shouldn't actually
occur with well-behaved clients.)1 parent 411f1e9 commit 3466ed4
1 file changed
+19
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
379 | 383 | | |
380 | 384 | | |
| 385 | + | |
381 | 386 | | |
382 | | - | |
| 387 | + | |
383 | 388 | | |
384 | 389 | | |
385 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
386 | 397 | | |
387 | 398 | | |
388 | | - | |
| 399 | + | |
389 | 400 | | |
390 | 401 | | |
391 | 402 | | |
| |||
395 | 406 | | |
396 | 407 | | |
397 | 408 | | |
398 | | - | |
| 409 | + | |
399 | 410 | | |
400 | 411 | | |
401 | 412 | | |
402 | 413 | | |
403 | 414 | | |
404 | | - | |
| 415 | + | |
405 | 416 | | |
406 | 417 | | |
407 | 418 | | |
| |||
411 | 422 | | |
412 | 423 | | |
413 | 424 | | |
414 | | - | |
| 425 | + | |
415 | 426 | | |
416 | 427 | | |
417 | 428 | | |
| |||
437 | 448 | | |
438 | 449 | | |
439 | 450 | | |
440 | | - | |
| 451 | + | |
441 | 452 | | |
442 | 453 | | |
443 | 454 | | |
| |||
0 commit comments