instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uptrace__bun__635 | uptrace/bun | 635 | defect | 1517410ecb56fd54f29faf51c4b45ec59449fab1 | b92a2014bdbcefe3dd2599db84df81af1d5d025a | feat(pgdriver): Implement database/sql/driver.SessionResetter | This pull request implements the [`SessionResetter` interface](https://pkg.go.dev/database/sql/driver#SessionResetter) on `pgdriver.Conn`.
The `SessionResetter` can be useful to detect a closed or bad connection _before_ we're trying to run queries on it. To make this work, we'd need some way to get the underlying `... | diff --git a/driver/pgdriver/config.go b/driver/pgdriver/config.go
index 6b2217848..ffc18d90e 100644
--- a/driver/pgdriver/config.go
+++ b/driver/pgdriver/config.go
@@ -42,6 +42,9 @@ type Config struct {
ReadTimeout time.Duration
// Timeout for socket writes. If reached, commands fail with a timeout instead of bloc... | 3 | 2 | 0 | [{"id": "G0", "claim": "ResetSessionFunc could have been named SessionResetter for consistency with Dialer, and the author asks the maintainer which name he prefers.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Add a compile-time check that *Conn impleme... | null |
uptrace__bun__904 | uptrace/bun | 904 | defect | 2dee174bc4d09a45caeeede2885306e5fd10002d | 1e9ccf6a016d6674179454b511ca92821f0e2631 | feat: bunslog.QueryHook for Bun logging using `log/slog` | ## Description
This PR implements a new package called bunslog to support enhanced logging functionalities for the Bun using `log/slog`.
ref #903
## Features
- Supports setting a `*slog.Logger` instance or uses the global logger if not set.
- Logs general SQL queries with configurable log levels.
- Logs slow... | diff --git a/extra/bunslog/README.md b/extra/bunslog/README.md
new file mode 100644
index 000000000..6f0c228b5
--- /dev/null
+++ b/extra/bunslog/README.md
@@ -0,0 +1,44 @@
+# bunslog
+
+bunslog is a logging package for Bun that uses slog.
+This package enables SQL queries executed by Bun to be logged and displayed us... | 4 | 4 | 3 | [{"id": "G0", "claim": "AfterQuery should use structured logging (e.g. slog.String(\"query\", event.Query)) instead of embedding the query in a formatted msg string.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "A go.mod file should be added for the bun... | null |
uptrace__bun__941 | uptrace/bun | 941 | defect | 8a4383505d7e954897b23811a412b9cdafaf41eb | 1656366d09f5ff1511851d1dfded741b84f460a0 | CreateTableQuery: Small cleanups for foreign key handling | These are just some cosmetic changes I've stumbled upon while working on another ticket:
- swapped `HasOneRelation` and `BelongsToRelation` places, so that the type is set correctly. That did not affect the functionality, but could prevent some obscure bugs in the future.
- added a `References() bool` method to `Rela... | diff --git a/query_table_create.go b/query_table_create.go
index 518dbfd1c..eec523673 100644
--- a/query_table_create.go
+++ b/query_table_create.go
@@ -19,6 +19,7 @@ type CreateTableQuery struct {
temp bool
ifNotExists bool
+ autoFKs bool // Create foreign keys captured in table's relations.
// va... | 1 | 1 | 1 | [{"id": "G0", "claim": "As written, the query will be broken if it is appended multiple times (e.g. calling String() twice), because createRelationFKs adds the FK constraints via q.ForeignKey instead of generating the query by appending to b, so it should probably be rewritten to append to b.", "category": "correctness... | null |
upyun__upx__71 | upyun/upx | 71 | defect | a9049ac1e2638997767ec9a236004d3f5b402a1a | 469ed96bd4e4a7ff6bafde6b3ac24e95cc214964 | 支持指定文件或目录名 ListStart 和 ListEnd, 把指定文件夹内相关区间文件下载到本地 | …y name ListStart and Listend, download the relevant interval files in the specified folder to the local area | diff --git a/commands.go b/commands.go
index a6b53b62..7ac502d7 100644
--- a/commands.go
+++ b/commands.go
@@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"fmt"
+ "log"
"os"
"path"
"path/filepath"
@@ -270,19 +271,32 @@ func NewGetCommand() cli.Command {
if strings.Contains(base, "*") {
mc.Wild... | 3 | 3 | 0 | [{"id": "G0", "claim": "Remove the overly abstract debug prints (\"SE\"/\"NOSE\") from the get command's range-download branch.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Close objectsConfig.QuitChan instead of sending false to it, since the... | null |
urfave__cli__1257 | urfave/cli | 1,257 | defect | 31c5137f2e1dfe1d415433b817a9ce5f108a443c | 17fc4c659201a99134da895f4691461e0d29e130 | Add count option for bool flags | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
- feature
## What this ... | diff --git a/cmd/urfave-cli-genflags/generated.gotmpl b/cmd/urfave-cli-genflags/generated.gotmpl
index 8b82ccfb1d3..ed58b4f0422 100644
--- a/cmd/urfave-cli-genflags/generated.gotmpl
+++ b/cmd/urfave-cli-genflags/generated.gotmpl
@@ -23,7 +23,7 @@ type {{.TypeName}} struct {
EnvVars []string
{{range .StructField... | 4 | 4 | 2 | [{"id": "G0", "claim": "The genflags code-generation workflow is blocked by a circular dependency: go generate will not run because it cannot build the current code, and the current code will not build until the new spec has been generated.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "pre... | null |
urfave__cli__1442 | urfave/cli | 1,442 | defect | c8147a48450b8842fce36b9d8a565149a14b1c51 | 341be3b6b2cbf956d181e57212f4eab81446202b | Configure GenericFlag's Destination type as struct not pointer | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
- bug
## What this PR d... | diff --git a/flag-spec.yaml b/flag-spec.yaml
index 45f054d6e51..ffa893e97e5 100644
--- a/flag-spec.yaml
+++ b/flag-spec.yaml
@@ -12,35 +12,41 @@ flag_types:
uint: {}
string:
+ destination_pointer: true
struct_fields:
- { name: TakesFile, type: bool }
Generic:
struct_fields:
- { nam... | 4 | 1 | 0 | [{"id": "G0", "claim": "Changing GenericFlag's Destination field from *Generic to Generic is technically a breaking change for existing v2 users, which should be weighed before merging into v2.", "category": "design", "verdict": "opposed", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "With the PR as ... | null |
urfave__cli__1454 | urfave/cli | 1,454 | defect | 0c9527f4b7f5618832c90d8b6c1ead4b7b1e2a80 | 1ddcd17f11806e87b14bb6e2d063d32cbc1b9033 | issue_62: Make slice options more posix like | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
Rearranges stringify slice... | diff --git a/flag.go b/flag.go
index dbed577cdc6..175d9556507 100644
--- a/flag.go
+++ b/flag.go
@@ -7,7 +7,6 @@ import (
"io/ioutil"
"regexp"
"runtime"
- "strconv"
"strings"
"syscall"
"time"
@@ -318,53 +317,6 @@ func stringifyFlag(f Flag) string {
fmt.Sprintf("%s\t%s", prefixedNames(df.Names(), placehol... | 1 | 1 | 0 | [{"id": "G0", "claim": "Remove the commented-out multiInputString block left inside stringifySliceFlag in flag.go.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
urfave__cli__1456 | urfave/cli | 1,456 | defect | 7357e1016036048a2bf17e6e7c5db2b16810c246 | f394c3779d49afc01311dde81b3f11407c0ebe4f | Fix:(issue_1455) Allow bool flags from input altsrc | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
<!--
Delete any of th... | diff --git a/altsrc/flag.go b/altsrc/flag.go
index db959493bc..606b57cec7 100644
--- a/altsrc/flag.go
+++ b/altsrc/flag.go
@@ -124,13 +124,14 @@ func (f *BoolFlag) ApplyInputSourceValue(cCtx *cli.Context, isc InputSourceConte
if f.set != nil && !cCtx.IsSet(f.Name) && !isEnvVarSet(f.EnvVars) && isc.isSet(f.BoolFlag.Na... | 2 | 1 | 1 | [{"id": "G0", "claim": "Asks whether printing is required in BoolFlag.ApplyInputSourceValue's error path — the fmt.Println(err) added there is a debug print that should not be in library code.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "StringFlag.App... | null |
urfave__cli__1460 | urfave/cli | 1,460 | defect | 7357e1016036048a2bf17e6e7c5db2b16810c246 | 3fdf0e5d03ddc65bf642976a3b855bddc664d176 | Fix:(issue_1293) Wrap usage text for commands | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
_(REQUIRED)_
<!--
De... | diff --git a/help_test.go b/help_test.go
index 4feb7f05a0..c3451d9f6b 100644
--- a/help_test.go
+++ b/help_test.go
@@ -895,6 +895,35 @@ App UsageText`,
}
}
+func TestShowAppHelp_CommandMultiLine_UsageText(t *testing.T) {
+ app := &App{
+ UsageText: `This is a
+multi
+line
+App UsageText`,
+ Commands: []*Command{... | 3 | 2 | 1 | [{"id": "G0", "claim": "The wrapped multi-line command usage output is indented inconsistently with the other command rows; it should align as in the layout the reporter shows.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The test should specify t... | null |
urfave__cli__1643 | urfave/cli | 1,643 | defect | 25897ce4ddf1b405b1e420372bdd1d0216fa4b57 | 01839eba254925c96dcfecb2cc58956619382462 | Create an inverseBoolFlag | ## What type of PR is this?
This is a new feature for handling IsSet of a BoolFlag by introducing an inverseFlag alongside it.
- feature
## What this PR does / why we need it:
I made it here when trying to implement flags where the following commands are valid with a flag `--local`
`$ tau` local is no... | diff --git a/flag_bool_with_inverse.go b/flag_bool_with_inverse.go
new file mode 100644
index 0000000000..3ee5d9cba6
--- /dev/null
+++ b/flag_bool_with_inverse.go
@@ -0,0 +1,165 @@
+package cli
+
+import (
+ "flag"
+ "fmt"
+)
+
+type BoolWithInverseFlag interface {
+ fmt.Stringer
+
+ // Apply Flag settings to the given... | 3 | 2 | 0 | [{"id": "G0", "claim": "The BoolWithInverseFlag interface is not needed and should be removed.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "More tests should be added to exercise the new flag functionality.", "category": "testing", "verdict": "supporte... | null |
urfave__cli__1671 | urfave/cli | 1,671 | defect | a6b3713d9c24086e467efa6a96585ca84fb09613 | b42de53f677f24594bf1bdf5eec3f33bdc57887c | flag: remove dependencies on shared variables | ## What type of PR is this?
<!--
Delete any of the following that do not apply:
-->
- bug fix
## What this PR does / why we need it:
Remove the dependencies of shared variable from slice type flags parsing, and instead use a `separatorSpec` for parsing. This should not fail downstream dependencies that... | diff --git a/app.go b/app.go
index 10198f43323..a44f76fb398 100644
--- a/app.go
+++ b/app.go
@@ -121,7 +121,8 @@ type App struct {
// Treat all flags as normal arguments if true
SkipFlagParsing bool
- didSetup bool
+ didSetup bool
+ separator separatorSpec
rootCommand *Command
}
@@ -216,6 +217,16 @@ func (a... | 3 | 3 | 0 | [{"id": "G0", "claim": "Pass a.separator directly to the flagSet call instead of threading a separatorSpec parameter through newFlagSet.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Use c.separator instead of threading a separatorSpec parameter through... | null |
urfave__cli__1694 | urfave/cli | 1,694 | defect | 3b1034a4d6591f29a2d429ec47adba535fed067c | d86d88e0529d0271dbdaba4889008928c590d7e6 | Fix linting issues | ## What type of PR is this?
- cleanup
## What this PR does / why we need it:
Fixes 100% of `golangci-lint` linting issues
## Which issue(s) this PR fixes:
Partially fixes #1663
## Testing
https://asciinema.org/a/ucDYTAfRZzASFpkmpfdrTxQHJ
ran make
## Release Notes
```release-note
Update to ... | diff --git a/app_test.go b/app_test.go
index 66e0f662b5..e5d227ff22 100644
--- a/app_test.go
+++ b/app_test.go
@@ -49,7 +49,10 @@ func ExampleApp_Run() {
Authors: []any{&mail.Address{Name: "Oliver Allen", Address: "oliver@toyshop.example.com"}, "gruffalo@soup-world.example.org"},
}
- app.Run(os.Args)
+ err := ... | 6 | 2 | 0 | [{"id": "G0", "claim": "Making the completion command exit non-zero when the writer write fails is a behavioral change that is arguably a bugfix warranting a patch release or a backwards-incompatible change warranting a major release, and the reviewer would prefer reverting to ignoring the return values.", "category": ... | null |
urfave__cli__1696 | urfave/cli | 1,696 | defect | ce617c1af0effcbc314c5631b21d75c6dd67898c | f942d3a81cec088938415e19f0c44e422efed1f8 | Fix linting issues | ## What type of PR is this?
- cleanup
## What this PR does / why we need it:
Fixes 100% of `golangci-lint` linting issues
## Which issue(s) this PR fixes:
Partially fixes #1663
## Testing
Run linter: https://asciinema.org/a/dK8y5ptbzIA9raNJpT1UPIsuY
Ran make
## Release Notes
```release-no... | diff --git a/altsrc/flag.go b/altsrc/flag.go
index 084ba3f9e1b..d7c4eb2f8e8 100644
--- a/altsrc/flag.go
+++ b/altsrc/flag.go
@@ -109,10 +109,10 @@ func (f *StringSliceFlag) ApplyInputSourceValue(cCtx *cli.Context, isc InputSour
continue
}
underlyingFlag.Value = &sliceValue
- f.set.Set(n, sliceValue.Seria... | 4 | 4 | 2 | [{"id": "G0", "claim": "The error return of fl.Apply(tfs) in TestStringFlagHelpOutput should be checked (e.g. with t.Error) instead of being discarded with _.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The ignored errors from f.set.Set(n, sliceValue... | null |
urfave__cli__1722 | urfave/cli | 1,722 | defect | 62d51b1928af0bf18c1062c78f097d7b99eb8d5b | d36393b2a514e6358a9ee700520aa23300c9e058 | Feat: Added tabular markdown writer | ## What type of PR is this?
- feature
## What this PR does / why we need it:
This PR allows to render of CLI usage docs in tabular markdown (`App.ToTabularMarkdown("app_name")`), with is pretty cool to use in the readme files.
> Tip: You can watch the "tabular markdown" file by the [following link](https://... | diff --git a/docs.go b/docs.go
index 45a0bc314d..a99fe1bac9 100644
--- a/docs.go
+++ b/docs.go
@@ -7,13 +7,94 @@ import (
"bytes"
"fmt"
"io"
+ "os"
+ "regexp"
"sort"
+ "strconv"
"strings"
"text/template"
+ "unicode/utf8"
"github.com/cpuguy83/go-md2man/v2/md2man"
)
+// ToTabularMarkdown creates a tabu... | 3 | 3 | 0 | [{"id": "G0", "claim": "Add a test case that passes an empty string to ToTabularMarkdown.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add a test case where the template execution returns an error.", "category": "testing", "verdict": "supported", "pri... | null |
urfave__cli__1949 | urfave/cli | 1,949 | defect | 6d6416e1c313e906a82935257a45537eb2993dd9 | 69753e839fb34a09d787167b4ff8a882e17466c8 | feat(command): show global options in command help | If there are persistent flags, they should also be displayed in the command.
## What type of PR is this?
- feature
## What this PR does / why we need it:
If there is a persistent flag named foo and `Required: true`, the user will not see this flag when executing `cmd subCommand --help`, but an error will be... | diff --git a/command.go b/command.go
index 75d8b7ec33..efbcfeed20 100644
--- a/command.go
+++ b/command.go
@@ -868,6 +868,18 @@ func (cmd *Command) appendFlag(fl Flag) {
}
}
+func (cmd *Command) VisiblePersistentFlags() []Flag {
+ var flags []Flag
+ for _, fl := range cmd.Root().Flags {
+ pfl, ok := fl.(Persisten... | 2 | 2 | 1 | [{"id": "G0", "claim": "Add a doc comment to the new exported VisiblePersistentFlags method, as in the supplied suggestion.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "After the doc comment is added, run `make generate` so godoc-current.txt is ... | null |
urfave__cli__1988 | urfave/cli | 1,988 | defect | 5053ec708a44d766e62f7e33baae742b6e2c003c | be9fe831e3d143c93719a218d268e8e1f7548e14 | Fix: Increase test coverage | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
_(REQUIRED)_
<!--
De... | diff --git a/args.go b/args.go
index 682eb497da..b9c746be72 100644
--- a/args.go
+++ b/args.go
@@ -98,11 +98,11 @@ func (a *ArgumentBase[T, C, VC]) Usage() string {
func (a *ArgumentBase[T, C, VC]) Parse(s []string) ([]string, error) {
tracef("calling arg%[1] parse with args %[2]", &a.Name, s)
if a.Max == 0 {
- f... | 2 | 2 | 1 | [{"id": "G0", "claim": "Removing FlagsByName from flag.go breaks the documented v3 flags example that uses cli.FlagsByName (CI failure), so it should be kept.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Removing GetValue() broke the cli-docs pack... | null |
urfave__cli__2043 | urfave/cli | 2,043 | defect | 55c2d912de921e2218f137a19b1636aadf9a2b60 | bb55e833cb12caef758fcae87c400ad808efc54e | while print flag , the placeholder if need but not set. | ## What type of PR is this?
- feature
## What this PR does / why we need it:
Change like this:
OPTIONS:
--bar value
--help, -h show help
OPTIONS:
--bar string
--help, -h show help
## Special notes for your reviewer:
This is a feature that I like because having a placeholder ... | diff --git a/flag.go b/flag.go
index 20d47c1e66b..959b905513d 100644
--- a/flag.go
+++ b/flag.go
@@ -180,6 +180,12 @@ type LocalFlag interface {
IsLocal() bool
}
+// FlagType is an interface to enable detection of the type of a flag
+// for the purpose of determining if a flag is a string, bool, etc.
+type FlagTyp... | 8 | 8 | 2 | [{"id": "G0", "claim": "Either the bare-Usage or the backquoted-Usage help case could be changed so that the placeholder is overwritten without setting a usage.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The two-line FlagType doc comment shoul... | null |
urfave__cli__2083 | urfave/cli | 2,083 | defect | fe6ff489b7722c3c1e91cc81971c581f347b3250 | 0aa0c602cfe7749e972aba4357f66235d8662a7d | chore: Bump golangci-lint to v2 | ## What type of PR is this?
- cleanup
## What this PR does / why we need it:
Bumps to golangci-lint v2.
## Which issue(s) this PR fixes:
None
<!--
If this PR fixes one of more issues, list them here.
One line each, like so:
Fixes #123
Fixes #39
-->
## Special notes for your reviewer:
_(fil... | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 880792927c..8cf5bb8e48 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -34,23 +34,6 @@ jobs:
echo "$non_formatted_files"
test -z "$non_formatted_files"
- staticcheck:
- runs-on: ubuntu-late... | 2 | 1 | 0 | [{"id": "G0", "claim": "Removing the standalone staticcheck CI job may lose staticcheck coverage, and the reviewer asks whether the new golangci-lint v2 actually includes staticcheck.", "category": "correctness", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The exclusion paths ... | null |
urfave__cli__2108 | urfave/cli | 2,108 | defect | 65c6366e4295e29b56d4824b3866800b8cb2d910 | 547c9145a719406787cc08c8ff894ad19c72fb6b | use correct context in After function with subcommand | ## What type of PR is this?
bugfix
## What this PR does / why we need it:
Fixes #2098
## Special notes for your reviewer:
This still passes with the new test from #2107.
Instead of returning the context we could also use a pointer to a context, but that looks very strange.
## Testing
Added unit t... | diff --git a/command_run.go b/command_run.go
index fb40a7c47a..c1d450cf32 100644
--- a/command_run.go
+++ b/command_run.go
@@ -91,6 +91,11 @@ outer:
// arguments are parsed according to the Flag and Command
// definitions and the matching Action functions are run.
func (cmd *Command) Run(ctx context.Context, osArgs ... | 3 | 2 | 0 | [{"id": "G0", "claim": "Add test coverage for the full sequence (main run/Before, subcommand run, subcommand Before adding a key, subcommand Action and After seeing it) so it is settled whether the main command's After also has the key.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introd... | null |
urfave__cli__2112 | urfave/cli | 2,112 | defect | c6c5804ca57ab98c6c209098df309403edd3c33a | f1a2e850ad34e5e54d2d5440d78a4a524d522843 | feat: adds support for explicit `float32` and `float64` | ## What type of PR is this?
- feature
## What this PR does / why we need it:
Adds support for explicit `float32` and `float64`.
## Which issue(s) this PR fixes:
NA
## Special notes for your reviewer:
Same idea as https://github.com/urfave/cli/pull/2094
## Testing
Added tests.
## Release No... | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 65a9683c30..df83344481 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -14,26 +14,6 @@ permissions:
contents: read
jobs:
- format:
- runs-on: ubuntu-latest
- steps:
- - name: Clone repository
- ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The float-slice lookup helper should probably be combined with getIntSlice into one generic getSlice[T float32 | float64 | int ...] helper instead of duplicating the code.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The author ... | null |
urfave__cli__2215 | urfave/cli | 2,215 | defect | 495e1d30c76923fbefbc095c0b01f9398529bb67 | 53ab291ec74f7e2148033773a5104b7140eb6766 | support parallel running of commands | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
Fix to allow running comma... | diff --git a/command.go b/command.go
index 3eebbaff76..33104a1968 100644
--- a/command.go
+++ b/command.go
@@ -101,6 +101,8 @@ type Command struct {
SliceFlagSeparator string `json:"sliceFlagSeparator"`
// DisableSliceFlagSeparator is used to disable SliceFlagSeparator, the default is false
DisableSliceFlagSepara... | 5 | 3 | 1 | [{"id": "G0", "claim": "The manual clone of the global VersionFlag by copying selected fields into a new BoolFlag should be replaced with a plain struct copy (`flag := *globalVersionFlag; localVersionFlag = &flag`).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G... | null |
urfave__cli__2221 | urfave/cli | 2,221 | defect | 46345bb3890625a76221e1d4ddc8d43aeb430b87 | e188e9f54cc6e98cd085b71e4a298afbc0aeea15 | Call actions on flags set from env | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
- bug
## What this PR d... | diff --git a/command.go b/command.go
index 2572c363746..7cb671dff69 100644
--- a/command.go
+++ b/command.go
@@ -583,7 +583,7 @@ func (cmd *Command) NArg() int {
}
func (cmd *Command) runFlagActions(ctx context.Context) error {
- tracef("runFlagActions")
+ tracef("runFlagActions len(cmd.setFlags) = %v", len(cmd.set... | 1 | 1 | 1 | [{"id": "G0", "claim": "Avoid changing the PostParse() method signature and all the associated changes; instead capture whether the flag was set before PostParse and add env-set flags to cmd.setFlags there, per the suggested block.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}... | null |
urfave__cli__2256 | urfave/cli | 2,256 | defect | fd14621cbcd644aa35483480d40f7cdf7b69f4c0 | 5dcc605b7f0c1de6d1790074f66a34610643be1a | feat: ShellComplete for fish | <!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->
## What type of PR is this?
<!--
Delete any of the following... | diff --git a/fish.go b/fish.go
index 1607f55b13c..52b2f2db0c3 100644
--- a/fish.go
+++ b/fish.go
@@ -34,6 +34,17 @@ func (cmd *Command) writeFishCompletionTemplate(w io.Writer) error {
// Add global flags
completions := prepareFishFlags(cmd.Name, cmd)
+ if cmd.ShellComplete != nil {
+ var completion strings.Buil... | 2 | 2 | 2 | [{"id": "G0", "claim": "In fish.go the ShellComplete Fprintf format strings hardcode `--generate-shell-completion` instead of using the completionFlag variable, for both the main command and subcommands.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim":... | null |
urfave__cli__2286 | urfave/cli | 2,286 | defect | a107ee4e9d5ada60a8f10292a045e9a4cbae1450 | 1fd608c29b8f1ee0a0804ab2c38d1c8da899da63 | Fix:(issue_2285): correct function and variable naming in fish completion script | This pull request updates the Fish shell autocomplete script to fix formatting and variable substitution issues, ensuring correct function naming and output formatting for command completions.
Improvements to autocomplete script:
* Renamed function and completion commands to use `%[1]s` instead of `%[1]`, ensurin... | diff --git a/autocomplete/fish_autocomplete b/autocomplete/fish_autocomplete
index 7aa7d0a8ba8..6714f75e0b0 100644
--- a/autocomplete/fish_autocomplete
+++ b/autocomplete/fish_autocomplete
@@ -1,6 +1,6 @@
# This is a shell completion script auto-generated by https://github.com/urfave/cli for fish.
-function __%[1]_p... | 1 | 1 | 1 | [{"id": "G0", "claim": "Add the regression test the PR description mentions (TestCompletionFishFormat): render the fish completion template via shellCompletions[\"fish\"] and assert the output contains __<app>_perform_completion and complete -c <app> and no fmt error markers like %! or (string=, so the fish completion ... | null |
urfave__cli__2296 | urfave/cli | 2,296 | defect | a107ee4e9d5ada60a8f10292a045e9a4cbae1450 | 1dff1f36d109491f6ab087e70d0da4cf7ac4e85d | Fix:(issue_2292) Empty positional args no longer break parse loop | ## What type of PR is this?
* bug
## What this PR does / why we need it:
Empty or whitespace-only positional arguments cause `parseFlags()` to `break` out of the parse loop, silently dropping them and all subsequent arguments.
`break` → `append` + `continue` so empty args are collected as positional argumen... | diff --git a/command_parse.go b/command_parse.go
index f8103d12f23..644bba98754 100644
--- a/command_parse.go
+++ b/command_parse.go
@@ -80,7 +80,8 @@ func (cmd *Command) parseFlags(args Args) (Args, error) {
firstArg := strings.TrimSpace(rargs[0])
if len(firstArg) == 0 {
- break
+ posArgs = append(posArgs,... | 1 | 1 | 0 | [{"id": "G0", "claim": "Combine the three t.Run sub-tests in TestEmptyPositionalArgs into a single loop over a table-driven testCases slice.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
urfave__cli__2297 | urfave/cli | 2,297 | defect | a107ee4e9d5ada60a8f10292a045e9a4cbae1450 | f4698c7bc6c53b444ec57571c0948b735127655a | Fix:(issue_2293) --flag="" no longer rejected as missing argument | ## What type of PR is this?
* bug
## What this PR does / why we need it:
`--flag=` (explicit empty value via `=`) is rejected with "flag needs an argument" instead of setting the flag to an empty string. This is a side effect of #2223 where the `valFromEqual` guard was made slightly too broad.
Tightened the... | diff --git a/command_parse.go b/command_parse.go
index f8103d12f23..1913c82fefd 100644
--- a/command_parse.go
+++ b/command_parse.go
@@ -163,8 +163,8 @@ func (cmd *Command) parseFlags(args Args) (Args, error) {
tracef("processing non bool flag (fName=%[1]q)", flagName)
// not a bool flag so need to get the ne... | 1 | 1 | 0 | [{"id": "G0", "claim": "The Flag Action in TestFlagEqualsEmptyValue is not needed to set val since Destination already points at it, so the redundant Action closure should be removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
urfave__cli__977 | urfave/cli | 977 | defect | 72c7fac92a8b089e0fb650125a57b2059b4a77f7 | 58b52b6653554ea6315cc3d38976f10f8b0c4c48 | Add suggestions support | ## Motivation
The new option `app.Suggest` enables command and flag suggestions via the jaro-winkler distance algorithm. Flags are scoped to their appropriate commands whereas command suggestions are scoped to the current command level.
Closes #895
## Release Notes
Add "Did you mean" suggestion support ... | diff --git a/app.go b/app.go
index a62aa237f17..5b3729d4e8c 100644
--- a/app.go
+++ b/app.go
@@ -88,6 +88,8 @@ type App struct {
// single-character bool arguments into one
// i.e. foobar -o -v -> foobar -ov
UseShortOptionHandling bool
+ // Enable suggestions for commands and flags
+ Suggest bool
didSetup boo... | 8 | 4 | 0 | [{"id": "G0", "claim": "Asks how the new flag-provided-but-not-defined error handling behaves for flags prefixed with two hyphens, questioning whether the constant-based parsing covers that case.", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Requests... | null |
urfave__negroni__175 | urfave/negroni | 175 | defect | c0db5feaa33826cd5117930c8f4ee5c0f565eec6 | 4d2b96c19cf50bb771bebe6f04cb787f75c1a124 | Add detection of the address. | It's quite common in the world of HTTP server
to have the following scenarios:
- Using the 8080 port as default
- If a "PORT" environment variable is set, we use this one
- Set the address directly in the code
By using ellipsis, it is possible to use one scenario from the three without
breaking the backwards ... | diff --git a/README.md b/README.md
index 2c71295..341d1cf 100644
--- a/README.md
+++ b/README.md
@@ -190,6 +190,9 @@ func main() {
n.Run(":8080")
}
```
+If no address is provided, the `PORT` environment variable is used instead.
+If this latest is not defined, the default address will be used.
+See [Run](https://... | 3 | 3 | 1 | [{"id": "G0", "claim": "The documentation should be updated to reflect the new variadic Run interface.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The word `latest` in the Run doc comment is unclear; the sentence should say the PORT value is us... | null |
urfave__negroni__198 | urfave/negroni | 198 | defect | 7d565e6970efbea855b6e9fb37d58f1e05be2fea | e5fdbfb48a9b8f010aecf450f99281283bab22af | Custom recovery output and HTML pretty print | Largely based on this [work](https://github.com/go-martini/martini/pull/156/commits),
this PR extends the `Recovery` struct with a `formatter` property that allows to customize the output process.
I also added a `HTMLPanicFormatter` class that output the stack trace inside one HTML page.
As I am not so skilled in... | diff --git a/README.md b/README.md
index 5faa7ca..8781da9 100644
--- a/README.md
+++ b/README.md
@@ -407,6 +407,35 @@ func reportToSentry(error interface{}) {
}
```
+The middleware simply output the informations on STDOUT by default.
+You can customize the output process by using the `SetFormatter()` function.
+
+Y... | 9 | 6 | 3 | [{"id": "G0", "claim": "The README example should reference the formatter as `negroni.HTMLPanicFormatter` instead of the unqualified `HTMLPanicFormatter`, which cannot be resolved outside the package.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": ... | null |
urfave__negroni__206 | urfave/negroni | 206 | defect | 079cf0c7a6b0145ebcf4103ec90380370cd89917 | bec94ba3b469e4be6886bfcbdf77554e5df810a2 | Send stack and Request to Recovery middleware callback | When integrating Recovery middleware with an exception notifier (Airbrake -
https://github.com/airbrake/gobrake), I found that having just the error in `ErrorHandlerFunc` is too limiting in tracking the cause (i.e. http.Request) of the exception.
This PR keeps the current `ErrorHandlerFunc` API for backward compat... | diff --git a/recovery.go b/recovery.go
index 1a6570e..9638be6 100644
--- a/recovery.go
+++ b/recovery.go
@@ -129,6 +129,7 @@ func (t *HTMLPanicFormatter) FormatPanicError(rw http.ResponseWriter, r *http.Re
type Recovery struct {
Logger ALogger
PrintStack bool
+ PanicHandlerFunc func(*PanicInformati... | 1 | 1 | 0 | [{"id": "G0", "claim": "Since the new `PanicHandlerFunc` is a superset of `ErrorHandlerFunc`, the PR should annotate the handler with a deprecation note and update the README examples to use `PanicHandlerFunc`.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
urfave__negroni__277 | urfave/negroni | 277 | defect | 1447d858d0ecb1c309050e37304c8e4f2a67453d | 68130a0ac8eb3c6fb1c8f8891774dc2b5785acb5 | Fix issue resulting in HTTP 200 being returned for request/responses using 100-continue that should actually return 201, 400, 500, etc. | HTTP 1xx's are interim status codes to be followed up by another. Prior to this change, if a response code for 100 Continue was written, any follow up call to WriteHeader was a no-op, and resulted in responses always receiving a 200 OK, even if WriteHeader was a 201, 404, 500, etc.
This fixes the issue seen in https... | diff --git a/response_writer.go b/response_writer.go
index 0ef098d..49e5f93 100644
--- a/response_writer.go
+++ b/response_writer.go
@@ -102,7 +102,7 @@ func (rw *responseWriter) Size() int {
}
func (rw *responseWriter) Written() bool {
- return rw.status != 0
+ return rw.status >= http.StatusOK // don't treat 1xx ... | 1 | 1 | 1 | [{"id": "G0", "claim": "The PR should treat HTTP 101 (Switching Protocols) responses as terminal/Written, matching net/http behavior.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
uriparser__uriparser__47 | uriparser/uriparser | 47 | defect | f8ccdfd76b2d46b7162c17e01baee4de402947b5 | 69c63d3375784724e25b5c987d555b504f9b4610 | Replace GNU Autotools build system by CMake >=3 | There are multiple W.I.P. migrations to CMake around. I figured, if CMake is going to be the main and only build system for uriparser at some point, I need to learn CMake myself anyway. Also, since I'm rather picky at code review, we can maybe turn things around: Now you get to be as picky as you like and I'll be the o... | diff --git a/.travis.yml b/.travis.yml
index 980e1682..f4ecbf4d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,10 +12,9 @@ addons:
- ubuntu-toolchain-r-test
packages:
- clang-7
+ - cmake
- doxygen
- graphviz
- # For building gtest:
- - cmake
script:
- set -e
@@ -27... | 10 | 7 | 3 | [{"id": "G0", "claim": "Add an option (e.g. URIPARSER_WITH_TESTS) so building the tests, and with it the hard GTest 1.8.1 dependency, is optional.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Use the PROJECT_VERSION/uriparser_VERSION variables that pro... | null |
urlaubsverwaltung__urlaubsverwaltung__3847 | urlaubsverwaltung/urlaubsverwaltung | 3,847 | defect | 7f5d0f2b501b4a07e587b4d5b54e97179fe11373 | e638acdf6e4696e733a17fca5e35840d1aa17e85 | enable/disable e-mail notifications globally or for departments | closes #3830
| diff --git a/src/main/java/org/synyx/urlaubsverwaltung/person/web/PersonNotificationsDto.java b/src/main/java/org/synyx/urlaubsverwaltung/person/web/PersonNotificationsDto.java
index 75cc503a874..fb127421237 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/person/web/PersonNotificationsDto.java
+++ b/src/main/jav... | 3 | 3 | 3 | [{"id": "G0", "claim": "The controller must not perform redirects based on user-controlled data (the Referer header is used as the redirect target), so change this code to not perform redirects based on user-controlled input.", "category": "security", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"... | null |
urlaubsverwaltung__urlaubsverwaltung__3911 | urlaubsverwaltung/urlaubsverwaltung | 3,911 | defect | 9545fce7c93873fd30ad520826e89c13c2c51de2 | c77e507aa9a2a5b35ca8ecfa09993b3e9ed2c4dd | Add E-Mail notification for sick note created by management | closes #3904
- [x] created
- [x] edited
- [x] cancelled | diff --git a/src/main/java/org/synyx/urlaubsverwaltung/person/MailNotification.java b/src/main/java/org/synyx/urlaubsverwaltung/person/MailNotification.java
index b71c62ae2e2..819b2ee2278 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/person/MailNotification.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/... | 4 | 3 | 0 | [{"id": "G0", "claim": "The new mail method name sendCreatedToApplicant should be reworded (e.g. sendCreatedToSickPerson), since the recipient is the sick person, not an applicant.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The sick-note not... | null |
urlaubsverwaltung__urlaubsverwaltung__5016 | urlaubsverwaltung/urlaubsverwaltung | 5,016 | defect | dfcbd3ab49da982b507fa489a02da4255b423eff | f8e381b7d0c3f81b29ee2276c57239defc851f50 | Enhance the overtime reduction api for multi-day applications | Diese PR behebt #4931 durch das Erweitern des `/api/persons/{personId}/absences/{applicationId}/overtime` Endpunktes. (Eingeführt mit #4858)
Der Endpunkt stellt jetzt zusätzlich eine Liste von tupeln aus `date` und `durationShare` zur Verfügung.
Hier eine Beispielausgabe:
```
{
"id": 3,
"duration": "PT9H",
... | diff --git a/src/main/java/org/synyx/urlaubsverwaltung/absence/DatedDurationShareDto.java b/src/main/java/org/synyx/urlaubsverwaltung/absence/DatedDurationShareDto.java
new file mode 100644
index 00000000000..e2f6cb73be3
--- /dev/null
+++ b/src/main/java/org/synyx/urlaubsverwaltung/absence/DatedDurationShareDto.java
@@... | 4 | 4 | 1 | [{"id": "G0", "claim": "getOvertimeReductionShareFor(DateRange) (and likewise getHoursByYear) should signal the non-overtime case with a clearly defined value such as Optional or Duration.ZERO instead of throwing an IllegalArgumentException, so the API is clearly defined and callers need no internal knowledge before ca... | null |
urlaubsverwaltung__urlaubsverwaltung__5028 | urlaubsverwaltung/urlaubsverwaltung | 5,028 | defect | eb032a21d0796a1e7f3141e582ed0ab8514dbff4 | 335220b5fb80e363e60f6eb4cbc43214e7990385 | 🎁 feat: Allow retrieving all users via API | Changes:
- Calls to `/api/persons` and `/api/persons?active=true` will return only active users, to remain backwards compatible
- Calls to `/api/persons?active=false` will return all users, including inactive ones.
closes #5125 | diff --git a/src/main/java/org/synyx/urlaubsverwaltung/person/PersonService.java b/src/main/java/org/synyx/urlaubsverwaltung/person/PersonService.java
index af414165b2e..387718e3576 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/person/PersonService.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/person/Pe... | 3 | 3 | 3 | [{"id": "G0", "claim": "A query parameter taking an enum named \"scope\" is questionable API design for expressing an active/inactive filter, and the reviewers asked to discuss or reconsider it (query parameter vs. separate endpoint, and whether \"scope\" is the right term at all).", "category": "design", "verdict": "s... | null |
urlaubsverwaltung__urlaubsverwaltung__5185 | urlaubsverwaltung/urlaubsverwaltung | 5,185 | defect | 117c4c64186884e86b8a4408e8a68508ca94f861 | 1d77f99a270d30925f573b00c7110c813944ed89 | Provide start and end working hours in UTC, based on the configured time zone. | ...we want to use UTC where we have a api to another system. That also means via ical.
closes #5175
<!--
Thanks for contributing to the Urlaubsverwaltung.
Please review the following notes before submitting you pull request.
Please look for other issues or pull requests which already work on this topic. Is... | diff --git a/src/main/java/org/synyx/urlaubsverwaltung/application/comment/ApplicationCommentEntity.java b/src/main/java/org/synyx/urlaubsverwaltung/application/comment/ApplicationCommentEntity.java
index 36220b62f2..07cd3d3c41 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/application/comment/ApplicationCommen... | 3 | 2 | 0 | [{"id": "G0", "claim": "Using \"Europe/Berlin\" for all ICalService tests while the iCal contains Zulu time (UTC) makes them harder to read; UTC should be used for most tests with only a few cases (FULL, MORNING, NOON) explicitly testing the timezone conversion with \"Europe/Berlin\".", "category": "maintainability", "... | null |
urllib3__urllib3__1013 | urllib3/urllib3 | 1,013 | defect | 056045a062478e3c3afc2402ec81680d53490876 | d3fa937937465567482b704a8b103f7d09d53322 | Introduce IPv6 zone identifier support. | In addition to stripping IPv6 address literals in connection pools, process IPv6 address literals which might have URI encoded zone identifiers specified in RFC-6874.
See also kennethreitz/requests#1985
| diff --git a/test/test_connectionpool.py b/test/test_connectionpool.py
index 2fab0c6b21f..74a0d7a98c5 100644
--- a/test/test_connectionpool.py
+++ b/test/test_connectionpool.py
@@ -49,6 +49,7 @@ def test_same_host(self):
('http://google.com/', 'http://google.com:80/abracadabra'),
('https://goo... | 5 | 5 | 3 | [{"id": "G0", "claim": "The pull request should definitely have at least one test covering the new IPv6 zone-identifier handling, including a test that exercises the is_same_host change.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The bracket-handlin... | null |
urllib3__urllib3__1028 | urllib3/urllib3 | 1,028 | defect | 2398290c337096c75808ddbb268339afe45912f3 | abfa7bd4ebc08e49d373fc11956553f3904369b1 | Update RECENT_DATE to 2016 | This PR resolves #1005 by adding a unit test to allow `RECENT_DATE` to have a maximum of two years of difference between the current date and it's last value. I also updated `RECENT_DATE` to January 1st, 2016 to refresh the value to a more recent date.
My rationale for these changes are:
- When `RECENT_DATE` was a... | diff --git a/test/test_connection.py b/test/test_connection.py
index 376c315561..66c1060395 100644
--- a/test/test_connection.py
+++ b/test/test_connection.py
@@ -1,4 +1,9 @@
-import unittest
+import datetime
+import sys
+if sys.version_info > (2, 6):
+ import unittest
+else:
+ import unittest2 as unittest
imp... | 3 | 3 | 1 | [{"id": "G0", "claim": "Add a comment above RECENT_DATE explaining the 'two-year' rule and what the latest and earliest acceptable values are.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add a comment in test_recent_date expressly saying what h... | null |
urllib3__urllib3__1036 | urllib3/urllib3 | 1,036 | defect | ee28622d7b7abf5877fa076ab0b34845c3ff387f | 76d65b088adee909d3dea21f35450e707ff5e03c | Differentiate socks5h from socks5 and socks4a from socks4 | In the proxy string, socks5h:// and socks4a:// mean that the hostname is
to be resolved by the socks server. socks5:// and socks4:// mean the
hostname is to be resolved locally.
Fix #1035
| diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 0692df9cf0..2bf43b112c 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -215,5 +215,8 @@ In chronological order:
* Seth Michael Larson <sethmichaellarson@protonmail.com>
* Created selectors backport that supports PEP 475.
+* Tom White <s6yg1ez3@mail2to... | 2 | 1 | 1 | [{"id": "G0", "claim": "The pull request should add tests for the two other SOCKS proxy protocols (socks5:// and socks4:// with local DNS resolution) that it just re-pointed at socks5h/socks4a.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The change m... | null |
urllib3__urllib3__1039 | urllib3/urllib3 | 1,039 | defect | ed7b0f0a77b43562fd58c31813ed38580dc454bc | acdfa552c272b83307e73afa6ad40af6af562527 | Rewind Seekable Body on Retry/Redirect | This is picking up where #459 left off. There are two commits in the first pass on this PR, one (40a110c) with a bare bones (unsafe) fix for the issue that @joneskoo was hitting, and another (ae7d799) with a fuller port of Requests implementation.
I'm on the fence about whether the second is overkill. If we decide t... | diff --git a/test/test_util.py b/test/test_util.py
index 23a9fe26d8a..a97a4f60a18 100644
--- a/test/test_util.py
+++ b/test/test_util.py
@@ -1,6 +1,7 @@
import hashlib
import warnings
import logging
+import io
import unittest
import ssl
import socket
@@ -9,7 +10,7 @@
from mock import patch, Mock
from urllib3 ... | 15 | 13 | 2 | [{"id": "G0", "claim": "The App Engine manager cannot send file-like bodies (urlfetch assumes the payload is a string), and it should probably explicitly raise an error for body types other than str/bytes.", "category": "correctness", "verdict": "uncertain", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "cla... | null |
urllib3__urllib3__1129 | urllib3/urllib3 | 1,129 | defect | d6bf2e32686954c7da7031647674ef38957f1520 | 9755e267d13d30d0ac412d44f66ad6922967d50b | Stop buffering entire deflate-encoded responses | Previously, if we received a deflate-encoded response that included the
zlib header, we would buffer the entire response in case decompressing
failed and we wanted to try interpretting the response as a raw deflate
stream.
Now, we commit to a single decoder as soon as we've decoded any data. As
a result, we can ... | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index ccf5d661588..b941439d820 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -224,5 +224,8 @@ In chronological order:
* Tom White <s6yg1ez3@mail2tor.com>
* Made SOCKS handler differentiate socks5h from socks5 and socks4a from socks4.
+* Tim Burke <tim.bur... | 2 | 2 | 2 | [{"id": "G0", "claim": "test_response.py uses assertIsNone/assertIsNotNone, which require unittest2 on Python 2.6, so add the unittest2 import dance at the top of the file as other tests do.", "category": "testing", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "Add a CHANGES.r... | null |
urllib3__urllib3__1148 | urllib3/urllib3 | 1,148 | defect | 1e7174b375546c1a51d3c045f91cc884627a2bf8 | f5e9c6066ea4971eaa67a7d1ade7779140b36250 | Add 'status' counter for 'status_forcelist' | To tackle https://github.com/shazow/urllib3/issues/1147.
Not sure about naming, but `status` property name follows naming convention of other counters... | diff --git a/CHANGES.rst b/CHANGES.rst
index e5423ed2e37..ae17a112fa7 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -6,7 +6,7 @@ dev (master)
* Improved performance of certain selector system calls on Python 3.5 and
later. (Pull #1095)
-
+
* Resolved issue where the PyOpenSSL backend would not wrap SysCallErro... | 2 | 2 | 2 | [{"id": "G0", "claim": "The new CHANGES.rst entry misspells the option name and should read ``status_forcelist`` instead of ``force_statuslist``.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "In test_status_counter, the two increment calls that a... | null |
urllib3__urllib3__1255 | urllib3/urllib3 | 1,255 | defect | 5206734fda1f2365afc49a070efa46c9ba68372e | 58e22b4ba24ad2d93b388e090fd70c700737f9de | Use FQDN only for DNS and drop trailing dot for other operations | Fixes #1254. | diff --git a/_travis/install.sh b/_travis/install.sh
index 430dbeaa807..ebaad21fed6 100755
--- a/_travis/install.sh
+++ b/_travis/install.sh
@@ -53,7 +53,7 @@ else
pip install virtualenv
fi
-pip install tox
+pip install tox==2.1.1
if [[ "${TOXENV}" == "gae" ]]; then
pip install gcp-devrel-py-tools
diff ... | 11 | 6 | 0 | [{"id": "G0", "claim": "It would be nice to work out why tox is failing so the tox==2.1.1 pins can be removed.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The host setter's docstring should note the assumption that only urllib3 code ever sets... | null |
urllib3__urllib3__1345 | urllib3/urllib3 | 1,345 | defect | 69f16a0c555316f486f8d43d889edb1abae1e151 | 2328ab13671ff72ebb231b90aa4bed6384116bb8 | Closed HTTPResponse.read_chunked() returns no chunks instead of exception | Brings the behavior more in-line with `HTTPResponse.read()` and returns no chunks when the response object is already closed. Closes #1088. | diff --git a/CHANGES.rst b/CHANGES.rst
index 06e31e26ef..6555fa3e7e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -18,6 +18,8 @@ dev (master)
* Lazily load `uuid` to boost performance on imports (Pull #1270)
+* ``read_chunked()`` on a closed response returns no chunks. (Issue #1088)
+
* ... [Short description of ... | 1 | 1 | 0 | [{"id": "G0", "claim": "The reviewer questions the new test's coverage: whether it should validate that read_chunked() does not raise on a closed response, or whether an additional test should explicitly close the response and then try to read.", "category": "testing", "verdict": "supported", "priority": "P2", "scope":... | null |
urllib3__urllib3__1489 | urllib3/urllib3 | 1,489 | defect | f80ff34bffb2018528ccd2ccf82e533d321f2af8 | 67565047b065f7964eb5ddb888b05569cc5ecd05 | Add support for password-protected client keyfiles | The standard library supports passing text or binary passwords to `SSLContext` so we should also support that for `PyOpenSSLContext`/`SecureTransportContext` objects. This PR adds support for that and tests for all situations where this functionality is supported.
Currently the only way we support this is via creati... | diff --git a/CHANGES.rst b/CHANGES.rst
index 020c893e1a..2c19c5be2f 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,12 @@ dev (master)
* Upgraded ``urllib3.utils.parse_url()`` to be RFC 3986 compliant. (Issue #)
+* Added support for ``key_password`` for ``HTTPSConnectionPool`` to use
+ encrypted ``key_file`... | 1 | 1 | 0 | [{"id": "G0", "claim": "_is_key_file_encrypted should support passing the key data immediately (e.g. via a try/except or other means) instead of requiring an openable key file path, since callers who pass key contents rather than files trace back at this point.", "category": "design", "verdict": "supported", "priority"... | null |
urllib3__urllib3__1492 | urllib3/urllib3 | 1,492 | defect | cbe5732ab6d05915cb7c9580d505c36c83cc27c2 | ac01642dad3505315b65c7427669e7df1ae70af0 | Change fields.py to use HTML5 non-ASCII File Names by Default instead of RFC2231 for encoding | This is a re-open of #856 and basically just a merge of the work that Spryttan did with the current HEAD so that it can be tested and hopefully merged after review.
I haven't spent the time fully reading the different RFC's and protocol docs but just arrived at this because I realized a module I was writing was fail... | diff --git a/dummyserver/handlers.py b/dummyserver/handlers.py
index f570d8819f..84af18e61a 100644
--- a/dummyserver/handlers.py
+++ b/dummyserver/handlers.py
@@ -304,49 +304,3 @@ def redirect_after(self, request):
def shutdown(self, request):
sys.exit()
-
-
-# RFC2231-aware replacement of internal torn... | 13 | 9 | 5 | [{"id": "G0", "claim": "The tests still check the old RFC2231 encoding and need to be updated to test the new expected values.", "category": "testing", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "Make the multipart header encoding configurable in code (e.g. via a parameter s... | null |
urllib3__urllib3__1586 | urllib3/urllib3 | 1,586 | defect | dae790cc1f41a9a8014ccfe0dad06b94794c46be | 0afeabe062b53525125bfaa6251e2313b933d33f | Percent-encode invalid characters with request target | Closes #1585. cc @theacodes @sigmavirus24
| diff --git a/src/urllib3/util/url.py b/src/urllib3/util/url.py
index de3c4686ec..ccd2c4e9fb 100644
--- a/src/urllib3/util/url.py
+++ b/src/urllib3/util/url.py
@@ -206,11 +206,18 @@ def idna_encode(name):
validator = Validator()
try:
validator.check_validity_of(
- *validator.COMPONENT_NAMES... | 1 | 1 | 1 | [{"id": "G0", "claim": "Add specific tests covering the newly allowed path, query and fragment characters so the new behaviour does not regress.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
urllib3__urllib3__1607 | urllib3/urllib3 | 1,607 | defect | 7d813bce9b1e39e45678209ccca771e825bc9472 | 0e0c7ef8b09ea65a2894a86fc54ea4346e7bc613 | Improve implementation of respect_retry_after_header | `respect_retry_after_header` is accepted as an argument to `Retry`, but it isn't propagated on `Retry.new()`. This means that after the first retry is incremented, this setting will be lost.
Additionally, this setting isn't properly applied in cases where the `retry_after` header is present, but the intent is _not_ ... | diff --git a/src/urllib3/util/retry.py b/src/urllib3/util/retry.py
index 02429ee8e48..fe4006843f8 100644
--- a/src/urllib3/util/retry.py
+++ b/src/urllib3/util/retry.py
@@ -192,7 +192,8 @@ def new(self, **kw):
raise_on_redirect=self.raise_on_redirect,
raise_on_status=self.raise_on_status,
... | 5 | 5 | 3 | [{"id": "G0", "claim": "The new() method should pass respect_retry_after_header through to the constructed Retry instance so the setting propagates to subsequent retries.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The new self.respect_retry_afte... | null |
urllib3__urllib3__1725 | urllib3/urllib3 | 1,725 | defect | cf0eda9b45579376b121406bbea2e866f1a1c533 | 22da6fd11fd97bbff9c2002c93dae0aa40e1b203 | Generate client certs dynamically | Opening this pull request to get a review of the last commit: https://github.com/pquentin/urllib3/commit/22da6fd11fd97bbff9c2002c93dae0aa40e1b203
I'll rebase it if/when the other pull requests get merged. | diff --git a/dev-requirements.txt b/dev-requirements.txt
index 7e3b6515d38..9274233bf35 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -7,6 +7,7 @@ win-inet-pton==1.1.0
pytest==4.6.6
pytest-timeout==1.3.3
flaky==3.6.1
+trustme==0.5.3
# https://github.com/GoogleCloudPlatform/python-repo-tools/issu... | 2 | 1 | 0 | [{"id": "G0", "claim": "The session fixture name `generated_certs` should be renamed to something shorter such as `certs_dir`.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The hardcoded c_rehash-named copy of the CA in `test_ca_dir_verified` w... | null |
urllib3__urllib3__1806 | urllib3/urllib3 | 1,806 | defect | 459f6a803cd1ae63c21de607ff855e90a135c405 | 0185939b9f368dc9a1c949f363c4bab9f862a9c1 | Add support for TLS in TLS for HTTPS proxies. | This PR aims to add support for HTTPS proxies by adding a class to easily provide TLS in TLS support. TLS within TLS is not supported easily within the ssl library. The SSLSocket actually takes over the existing socket (https://github.com/python/cpython/blob/master/Lib/ssl.py#L999-L1006)
instead of wrapping it entire... | diff --git a/src/urllib3/connection.py b/src/urllib3/connection.py
index ce94b256407..42526c9e2b4 100644
--- a/src/urllib3/connection.py
+++ b/src/urllib3/connection.py
@@ -111,6 +111,11 @@ def __init__(self, *args, **kw):
#: The socket options provided by the user. If no options are
#: provided, we u... | 14 | 11 | 3 | [{"id": "G0", "claim": "Provide sample code or an integration with urllib3 so reviewers can play with the TLS-in-TLS feature.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "unclear"}, {"id": "G1", "claim": "When a user asks for TLS-in-TLS proxying the code should raise a proxy/connec... | null |
urllib3__urllib3__1812 | urllib3/urllib3 | 1,812 | defect | 8c7a43b4a4ca0c8d36d55f132daa2a43d06fe3c4 | 0f8c2f4dcbbbaa427d20da065805518ca1b12fba | Ensure load_verify_locations raises SSLError for all backends | This also adds TestSSL to the classes tested in SecureTransport and PyOpenSSL, since:
1. TestSSL was the most natural place for this test.
2. The test only makes sense when run against all SSL backends.
This is my take on #1517 from @pilou-: I've backported it to master, and made a few tweaks. In particular, we ... | diff --git a/src/urllib3/contrib/pyopenssl.py b/src/urllib3/contrib/pyopenssl.py
index 3051ef3af2..81a80651d4 100644
--- a/src/urllib3/contrib/pyopenssl.py
+++ b/src/urllib3/contrib/pyopenssl.py
@@ -450,9 +450,12 @@ def load_verify_locations(self, cafile=None, capath=None, cadata=None):
cafile = cafile.enc... | 2 | 1 | 0 | [{"id": "G0", "claim": "Use six.raise_from(..., None) when raising the SSLError so that the \"error raised while handling another exception\" chained-exception messaging is removed.", "category": "maintainability", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The `assert exc.ty... | null |
urllib3__urllib3__1819 | urllib3/urllib3 | 1,819 | defect | eee53a69e1af019da18635d6974f893308db0ada | 85f619d2046b989969665a6e1d2fd222c2e9cd79 | Ensure test host resolves to IPv6 in tests | Closes #1818 | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index f3fe3c46bf..b632da4027 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -284,7 +284,7 @@ In chronological order:
* Jorge Lopez Silva <https://github.com/jalopezsilva>
* Added support for forwarding requests through HTTPS proxies.
-
+
* Benno Rice <b... | 3 | 2 | 0 | [{"id": "G0", "claim": "The new helper should take `host` as a parameter instead of using the module-level global, and its docstring should say `host` rather than \"localhost\".", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Avoid the word 'sane' in the ... | null |
urllib3__urllib3__1867 | urllib3/urllib3 | 1,867 | defect | 46fc29d5108553a58cc14d28e73443e864be76c2 | fe83869c26fc417536b3eee1a22aaf9984d16c5b | Feature/support env var sslkeylogfile | Adds support for creating a session key logfile by specifying environment variable `SSLKEYLOGFILE`.
Depends on Python 3.8+, see https://bugs.python.org/issue34271
| diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index ef41e32b733..68caa5defe3 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -300,5 +300,8 @@ In chronological order:
* Chris Olufson <tycarac@gmail.com>
* Fix for connection not being released on HTTP redirect and response not preloaded
+* [Bastiaan Bakk... | 6 | 6 | 2 | [{"id": "G0", "claim": "Use pytest's monkeypatch.setenv fixture instead of manually setting and deleting os.environ[\"SSLKEYLOGFILE\"] in test_sslkeylogfile.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new test_sslkeylogfile test fails on Windows... | null |
urllib3__urllib3__2083 | urllib3/urllib3 | 2,083 | defect | 83ddac1622426f5847bc2cee95f66ec0cf367604 | e4fdaf2d8a590dcf1544ffd02fc096a1cc8283a7 | Add BaseHTTPResponse base class | - Adds the `BaseHTTPResponse` base type and moved many agnostic functions to the class
- Adds the `ContentDecoder` base type
- Changes the return type of `HTTPResponse.getheaders()` to a list of key-value pairs in line with `http.client.HTTPResponse`
Closes #1986
Closes #1543 | diff --git a/src/urllib3/connectionpool.py b/src/urllib3/connectionpool.py
index 2b943b353e8..55a632f63e3 100644
--- a/src/urllib3/connectionpool.py
+++ b/src/urllib3/connectionpool.py
@@ -35,7 +35,7 @@
from .packages import six
from .packages.ssl_match_hostname import CertificateError
from .request import RequestMe... | 4 | 2 | 2 | [{"id": "G0", "claim": "BaseHTTPResponse.__init__ should avoid mentioning default values that are likely to drift from HTTPResponse's, and should make its parameters keyword-only.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The initialization lines du... | null |
urllib3__urllib3__2162 | urllib3/urllib3 | 2,162 | defect | c67806d7ec7093111c4da18cd1cb4691d277c780 | a17758266aa61c95a0789f119ac4b4b08de916c5 | 1897 add type hints connection | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
Related to #1897
Added type hin... | diff --git a/noxfile.py b/noxfile.py
index 5107f605f9..8441cf1cfc 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -9,12 +9,14 @@
# ignored.
TYPED_FILES = {
"src/urllib3/contrib/__init__.py",
+ "src/urllib3/connection.py",
"src/urllib3/exceptions.py",
"src/urllib3/fields.py",
"src/urllib3/filepost.p... | 15 | 10 | 4 | [{"id": "G0", "claim": "NewConnectionError expects a ConnectionPool, so either it should be raised by ConnectionPool or the exception should be modified.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "pre_existing"}, {"id": "G1", "claim": "The stray '# What about HTTPHeaderDict?' comment le... | null |
urllib3__urllib3__2178 | urllib3/urllib3 | 2,178 | defect | 11fecfd738827ee1c520e1078c56919e9f94e3f8 | ba4d13fbef9821b5d3dc40b8b64a782fb8939a5b | Lean on SSLContext to verify hostnames when possible | Closes #517
There are four situations where we can't lean on SSLContext to verify certs for us:
* Python 3.6, where we need our custom code to reject commonName
* fingerprints *and* alternate hostnames, as those aren't supported by Python's `ssl`
* PyOpenSSL where there's no easy way to check for hostnames
... | diff --git a/src/urllib3/connection.py b/src/urllib3/connection.py
index 51de132feb..cd708b77bd 100644
--- a/src/urllib3/connection.py
+++ b/src/urllib3/connection.py
@@ -30,7 +30,7 @@ class BaseSSLError(BaseException):
SystemTimeWarning,
)
from .packages.ssl_match_hostname import CertificateError, match_hostnam... | 2 | 1 | 0 | [{"id": "G0", "claim": "The `# Python 3.7` comment should sit on the `if` line so it covers the whole `hasattr` branch rather than only the assignment it trails.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Asserting `pytest.raises(Exception)` i... | null |
urllib3__urllib3__2205 | urllib3/urllib3 | 2,205 | defect | ed23062eef4900f4d4c7540f51062c94bb9dcf07 | 147040996841ad8bf35e885f4277d50a8b6b508a | Modify string formatting to use f-strings | Some small changes related to #1988
`ResponseError.SPECIFIC_ERROR` from `exceptions` module is also used with `.format()` but I am not sure if it would make sense to, for example, refactor this to a method that accepts a `status_code` argument and returns an f-string formatted string?
<!---
Thanks for your contri... | diff --git a/setup.py b/setup.py
index 772ba0cc6f..e30269c198 100755
--- a/setup.py
+++ b/setup.py
@@ -13,12 +13,12 @@
# This check and everything above must remain compatible with Python 2.7.
if CURRENT_PYTHON < REQUIRED_PYTHON:
sys.stderr.write(
- """
+ f"""
==========================
Unsupport... | 1 | 1 | 0 | [{"id": "G0", "claim": "Most of the f-string conversions in this pull request make the code less readable — specifically the _LS32_PAT rewrite in src/urllib3/util/url.py and the _encode_chunk rewrite in test/test_response.py seem worse — and those changes should not be kept.", "category": "maintainability", "verdict": ... | null |
urllib3__urllib3__2220 | urllib3/urllib3 | 2,220 | defect | 84f184c348435e624659a0930f36bb4b43299361 | 7907e2ba61cd698d26780861b278b5bebbe7d2a6 | Start using SSLContext.minimum|maximum_version when available | Closes #2110
Closes https://github.com/urllib3/urllib3/issues/2373
- [x] Adding `minimum_version` and `maximum_version` converters to the PyOpenSSL and SecureTransport SSLContext implementations
- [x] ~Fixing the test suite for the new deprecation message~
- [x] Adding documentation about `ssl_minimum_version` an... | diff --git a/changelog/2110.feature.rst b/changelog/2110.feature.rst
new file mode 100644
index 00000000000..99b83436cca
--- /dev/null
+++ b/changelog/2110.feature.rst
@@ -0,0 +1,9 @@
+Added ``ssl_minimum_version`` and ``ssl_maximum_version`` options which set
+``SSLContext.minimum_version`` and ``SSLContext.maximum_ve... | 6 | 4 | 0 | [{"id": "G0", "claim": "The Python 3.6-specific code in the pull request can now be removed, since the project no longer supports 3.6.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The changelog sentence \"``SSLContext.minimum_version`` and ``S... | null |
urllib3__urllib3__2267 | urllib3/urllib3 | 2,267 | defect | 00d4acb8f880a1246149e470fff019bb610be4c6 | bd0621ca0fa6097217bd4b18f8a97b0137ba525a | Strict param | Closes #2263 | diff --git a/dev-requirements.txt b/dev-requirements.txt
index e92c530d1b7..d1719d8430d 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -9,3 +9,4 @@ trustme==0.7.0
cryptography==3.4.7
python-dateutil==2.8.1
typing-extensions==3.7.4.3
+requests
diff --git a/src/urllib3/poolmanager.py b/src/urllib3/poo... | 2 | 2 | 1 | [{"id": "G0", "claim": "Move the integration test under test/with_dummyserver and make both an http and an https request so the suite avoids a real network call.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "In test_connection_from_context_strict_param... | null |
urllib3__urllib3__2290 | urllib3/urllib3 | 2,290 | defect | 89ca490bfc15b7b4762676b5b51bf57e8912d80f | 9b61cc664a1c5d81a54734876e0e1d06dcb41d3a | [#2287] Fixes repeated `Transfer-Encoding` header issue. | This PR:
1. Fixes the repeated addition of `Transfer-Encoding` header while making chunked requests.
2. Adds 3 new tests to validate that we preserve the `User-Agent` and `Transfer-Encoding` headers when provided to us as part of the request, and add a default header of the above forms when no such header is provid... | diff --git a/src/urllib3/connection.py b/src/urllib3/connection.py
index c02650445b..59e93e2893 100644
--- a/src/urllib3/connection.py
+++ b/src/urllib3/connection.py
@@ -307,7 +307,7 @@ def request_chunked(
self.putheader("User-Agent", _get_default_user_agent())
for header, value in headers.items... | 2 | 2 | 0 | [{"id": "G0", "claim": "The new tests should pass the request body as the keyword argument `body=chunks` instead of passing it positionally to urlopen.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "test_preserve_transfer_encoding_header should ... | null |
urllib3__urllib3__2364 | urllib3/urllib3 | 2,364 | defect | 372b97e4968cdd154d7bffa2f0d8b2449b3b795d | d24cccac96320f18319ee460e88f4b55afafcc7f | Add type hints to test.tz_stub | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/noxfile.py b/noxfile.py
index bdf995b691e..c29a04e755e 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -158,6 +158,7 @@ def mypy(session: nox.Session) -> None:
session.install("tornado>=6.1")
session.install("pytest>=6.2")
session.install("nox")
+ session.run("mypy", "--install-types", "--non... | 2 | 1 | 0 | [{"id": "G0", "claim": "Add `assert old_tzname is not None` right after `old_tzname` is obtained, to clarify the assumption (assigning None to os.environ raises TypeError) and avoid the `# type: ignore[assignment]` on the os.environ assignment.", "category": "maintainability", "verdict": "supported", "priority": "P2", ... | null |
urllib3__urllib3__2374 | urllib3/urllib3 | 2,374 | defect | 25ed51f319a3c6920bb5bd959924ca80925ee120 | fd70050b05182b6d201ddde6cb090241e2b8701e | Add type hints to test.test_wait | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/noxfile.py b/noxfile.py
index 8fb6604ded6..adcf1e92552 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -176,6 +176,7 @@ def mypy(session: nox.Session) -> None:
"test/__init__.py",
"test/conftest.py",
"test/port_helpers.py",
+ "test/test_wait.py",
"test/tz_stub.py",
... | 1 | 1 | 0 | [{"id": "G0", "claim": "Since tests don't need to worry about privacy, the underscore prefix on the _TYPE_SOCKET_PAIR (and _TYPE_WAIT_FOR) test type aliases is not really necessary and should be dropped.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
urllib3__urllib3__2375 | urllib3/urllib3 | 2,375 | defect | 25ed51f319a3c6920bb5bd959924ca80925ee120 | ee763e58b6563562f8a1d8218c6e5559196d03d4 | Add type hints to test.test_retry | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/noxfile.py b/noxfile.py
index 8fb6604ded6..a3000b28baf 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -176,6 +176,7 @@ def mypy(session: nox.Session) -> None:
"test/__init__.py",
"test/conftest.py",
"test/port_helpers.py",
+ "test/test_retry.py",
"test/tz_stub.py",
... | 1 | 1 | 1 | [{"id": "G0", "claim": "The `pool` annotations in PoolError and RequestError should not be loosened to Optional[ConnectionPool]; instead the tests should pass a real pool object instead of None.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
urllib3__urllib3__2389 | urllib3/urllib3 | 2,389 | defect | d8eabf304190c62766e05c79ef44be7ff94cfbcb | 6e470630a76d9354cce91061803697a22b8f7c71 | Add type hints to test.test_poolmanager | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/noxfile.py b/noxfile.py
index 146096edda8..25e5626928a 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -171,6 +171,7 @@ def mypy(session: nox.Session) -> None:
"test/port_helpers.py",
"test/test_exceptions.py",
"test/test_fields.py",
+ "test/test_poolmanager.py",
"tes... | 4 | 4 | 1 | [{"id": "G0", "claim": "Mypy cannot see `assert_hostname`/`assert_fingerprint` on the pool returned by `connection_from_url`, so the test needs `# type: ignore[attr-defined]`; bluetech asks why, hramezani proposes changing the return type to `HTTPSConnectionPool`, and bluetech proposes replacing the ignores with an `as... | null |
urllib3__urllib3__2399 | urllib3/urllib3 | 2,399 | defect | 87a292aafa959059db885b7eed87eb7c7d8ebeb7 | c9399718f569b8d8e9b7796b588f1d14ea47899b | Add type hints to test.with_dummyserver.test_chunked_transfer | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/noxfile.py b/noxfile.py
index 2804a9ed715..62b480a6b88 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -167,6 +167,7 @@ def mypy(session: nox.Session) -> None:
"noxfile.py",
"src/urllib3",
"test/__init__.py",
+ "test/with_dummyserver/test_chunked_transfer.py",
"test/c... | 2 | 1 | 0 | [{"id": "G0", "claim": "The switch of test_chunks from str to bytes chunks is in tension with request_chunked's explicit str support, and it is unclear whether the type annotations should forbid str chunks or _TYPE_BODY should allow them.", "category": "design", "verdict": "opposed", "priority": "P1", "scope": "introdu... | null |
urllib3__urllib3__2436 | urllib3/urllib3 | 2,436 | defect | 25dc941d6d91e7d5c6d928db8713c13aa878cd93 | a72609a274121f942acc8dc60ebacd477dd4b702 | Add type hints to test.with_dummyserver.test_socketlevel | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/dummyserver/testcase.py b/dummyserver/testcase.py
index e53835853b3..6d4a63269bc 100644
--- a/dummyserver/testcase.py
+++ b/dummyserver/testcase.py
@@ -40,6 +40,13 @@ class SocketDummyServerTestCase:
server_thread: ClassVar[SocketServerThread]
port: ClassVar[int]
+ tmpdir: ClassVar[str]
+ ... | 1 | 1 | 1 | [{"id": "G0", "claim": "The type error is actually correct — `self.fail` is a leftover from a unittest-to-pytest migration and pytest doesn't support it, so the added `# type: ignore[attr-defined]` should be dropped and the call (and the other instance in the file) replaced with `pytest.fail` or `assert False`.", "cate... | null |
urllib3__urllib3__2443 | urllib3/urllib3 | 2,443 | defect | 7b0a367034f42b6100e5585a9049c4d9aeca23f9 | 65302dee8ecd2e9b767e9fb45f06b7e6172e98b2 | Add type hints to test.test_ssltransport | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/dummyserver/testcase.py b/dummyserver/testcase.py
index 6d4a63269bc..001ee158346 100644
--- a/dummyserver/testcase.py
+++ b/dummyserver/testcase.py
@@ -1,7 +1,8 @@
import socket
+import ssl
import threading
from contextlib import contextmanager
-from typing import Any, Callable, ClassVar, Dict, Generato... | 5 | 3 | 1 | [{"id": "G0", "claim": "The last (fallback) @overload of sample_response may be unnecessary since it might already be covered by the function definition itself.", "category": "maintainability", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "recv_into should not accept None for it... | null |
urllib3__urllib3__2458 | urllib3/urllib3 | 2,458 | defect | 74abd449be7925dfb5d19b74d609df70d3af6fc1 | 1339024392a57c6b79d84458e8c4b4dbb4e5b84d | Add type hints to test.test_response | There are mypy errors that I think we can ignore. Here is list of erros:
```
test/test_response.py:77: error: Argument 1 to "HTTPResponse" has incompatible type "None"; expected "Union[bytes, IO[Any], Iterable[bytes], str]" [arg-type]
test/test_response.py:323: error: Incompatible types in assignment (expression ha... | diff --git a/noxfile.py b/noxfile.py
index dc202553d40..3cb4eb5bacd 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -190,6 +190,7 @@ def mypy(session: nox.Session) -> None:
"test/test_poolmanager.py",
"test/test_proxymanager.py",
"test/test_queue_monkeypatch.py",
+ "test/test_response.py",... | 6 | 5 | 2 | [{"id": "G0", "claim": "The mock classes' `_encode_chunk()` methods should be returning `bytes`, not the `str` the pull request annotated and returned.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add `type: ignore` comments for the mypy complaint... | null |
urllib3__urllib3__2462 | urllib3/urllib3 | 2,462 | defect | 093ab6cc26b31fd1a36856e7130770d11f146e0e | ed2ed4369cdbb2da39585d0452b9fc157b33a284 | Add type hits to test.test_connectionpool | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/noxfile.py b/noxfile.py
index 3cb4eb5bac..ea529abc71 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -166,37 +166,7 @@ def mypy(session: nox.Session) -> None:
"dummyserver",
"noxfile.py",
"src/urllib3",
- "test/__init__.py",
- "test/with_dummyserver/test_connectionpool.... | 3 | 3 | 1 | [{"id": "G0", "claim": "With the mypy session now covering the whole test directory, the lint job still fails with other errors in the test files (assigning mocks etc) that would need to be fixed or ignored.", "category": "maintainability", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", ... | null |
urllib3__urllib3__2519 | urllib3/urllib3 | 2,519 | defect | fd2759aa16b12b33298900c77d29b3813c6582de | 2d7fd3a77a134d22f585aa52a62a51f09e367021 | Add sentinel type for _FAILEDTELL | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
Fixes #2512
Took the idea from ... | diff --git a/src/urllib3/connectionpool.py b/src/urllib3/connectionpool.py
index 4fabcb4a5a..8a7d517b7c 100644
--- a/src/urllib3/connectionpool.py
+++ b/src/urllib3/connectionpool.py
@@ -41,7 +41,7 @@
from .response import BaseHTTPResponse, HTTPResponse
from .util.connection import is_connection_dropped
from .util.p... | 6 | 4 | 4 | [{"id": "G0", "claim": "The test removed by this PR (rewind_body with a generic object() position raising ValueError) should be kept.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The PR should keep the Union (not bare sentinel type) for body_pos-relat... | null |
urllib3__urllib3__2520 | urllib3/urllib3 | 2,520 | defect | 726e295dfeacd4b5f1464b5ac53e277250951f0a | acffe087d83e46920a52d63b2530956c575fc4d6 | Add authority property to the Url class | This is a proposal for a new property on the `Url` class to expose the concept of "authority" as defined in [RFC 3986 § 3.2](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2). This comes from a recent discovery in Requests (psf/requests#6027) when swapping our use of [urllib.parse.urlparse](https://docs.python... | diff --git a/changelog/2520.feature.rst b/changelog/2520.feature.rst
new file mode 100644
index 00000000000..bae97a3a355
--- /dev/null
+++ b/changelog/2520.feature.rst
@@ -0,0 +1 @@
+Added the authority property to the Url class
diff --git a/src/urllib3/util/url.py b/src/urllib3/util/url.py
index b37ab37bd10..64d6c6b71... | 5 | 5 | 0 | [{"id": "G0", "claim": "The url_authority_map test data should cover single-label hostnames, multi-label hostnames, ipv4 and ipv6, each with and without a port.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Each test case whose URL starts with `http://... | null |
urllib3__urllib3__2529 | urllib3/urllib3 | 2,529 | defect | f070ec2e6f6c545f40d9196e5246df10c72e48e1 | 7912274fcf28b4b5ce44cb0ca4d3b33f43617f03 | Change proxy TLS flow to match destination TLS flow | Closes https://github.com/urllib3/urllib3/issues/2190 Part of https://github.com/urllib3/urllib3/issues/2530 | diff --git a/src/urllib3/connection.py b/src/urllib3/connection.py
index 6e52a1099e1..b547c0981e3 100644
--- a/src/urllib3/connection.py
+++ b/src/urllib3/connection.py
@@ -26,8 +26,8 @@
from typing_extensions import Literal
from .util.ssl_ import _TYPE_PEER_CERT_RET_DICT
+ from .util.ssltransport import... | 3 | 3 | 0 | [{"id": "G0", "claim": "The meaningless comment inside _ssl_wrap_socket_and_match_hostname should be removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The '# Works well on Windows.' comment should be removed since it is self-explanatory wi... | null |
urllib3__urllib3__2565 | urllib3/urllib3 | 2,565 | defect | 91d560b6f928595acb611579746906d6f0a54a84 | b9e7690193a279eb77e583a56e8b63ea7d8d4c57 | Create our own logic for chunking, content framing | - Changes `HTTPConnection.request_chunked()` into an alias for `HTTPConnection.request(..., chunked=True)`
- Adds a `chunked` parameter to `HTTPConnection.request()`
- Adds a new internal function `body_to_chunks()` which does discovery of Content-Length if applicable for the body/method and converts the body if any ... | diff --git a/changelog/2515.feature.rst b/changelog/2515.feature.rst
new file mode 100644
index 00000000000..d132840b6b0
--- /dev/null
+++ b/changelog/2515.feature.rst
@@ -0,0 +1,5 @@
+Added the ``chunked`` parameter to ``urllib3.connection.HTTPConnection.request()``.
+
+Changed ``urllib3.connection.HTTPConnection.requ... | 5 | 5 | 3 | [{"id": "G0", "claim": "The pull request's CI failures (the test_headers_http_header_dict assertion and the botocore 100-continue failures) need to be looked into and resolved.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The body duck-typing line... | null |
urllib3__urllib3__2627 | urllib3/urllib3 | 2,627 | defect | 9a640e275cb63f96755a504108fd6e9e27a0d8a7 | 01b00a1ec492b59cb20c270b066d4dcbcd8ce764 | Consistently wrap errors in load_cert_chain | This wraps OpenSSL.SSL.Error with ssl.SSLError in
PyOpenSSLContext.load_cert_chain, similar to the error handling in
other methods of PyOpenSSLContext.
| diff --git a/src/urllib3/contrib/pyopenssl.py b/src/urllib3/contrib/pyopenssl.py
index 848fa235923..79eb5052fc2 100644
--- a/src/urllib3/contrib/pyopenssl.py
+++ b/src/urllib3/contrib/pyopenssl.py
@@ -486,12 +486,15 @@ def load_cert_chain(
keyfile: Optional[str] = None,
password: Optional[str] = None,... | 3 | 3 | 1 | [{"id": "G0", "claim": "Add a changelog entry for the change, and backport it to the 1.26.x branch if it is needed there soon.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new test_load_invalid_cert_file consistently fails on macOS because n... | null |
urllib3__urllib3__2657 | urllib3/urllib3 | 2,657 | defect | 06b97c50d72869a3d955e13f3032a93589ae1675 | 5d500c47f86ef683a34bb9572fcd6f9d3459da3b | Fix `OverflowError` when SSL is used on some Python versions | Fixes #2513. | diff --git a/src/urllib3/response.py b/src/urllib3/response.py
index 8690d2d7a8..e5a21145b5 100644
--- a/src/urllib3/response.py
+++ b/src/urllib3/response.py
@@ -2,6 +2,7 @@
import json as _json
import logging
import re
+import sys
import zlib
from contextlib import contextmanager
from http.client import HTTPMes... | 6 | 4 | 1 | [{"id": "G0", "claim": "Do not gate the overflow workaround on unreleased versions of Python (drop the 3.10 pre-release range check).", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Update (or remove) the stale comment saying `cStringIO` doesn't like amt=... | null |
urllib3__urllib3__2669 | urllib3/urllib3 | 2,669 | defect | f9c7434090ce96ca93180137356531a9cfcce822 | 7ce4eaed72b7bf145fbbdbf8b6300624a8c0020f | Add support for configuring header merging when using HTTPHeaderDict | This is a second attempt to resolve #2242, as an alternative to #2652.
When passing in `combine=True` during calls to `add`, iteration over the `HTTPHeaderDict` will merge duplicate header values into one with a comma.
This also resolves an issue where GET requests and POST requests using the same `HTTPHeaderDi... | diff --git a/changelog/2242.feature.rst b/changelog/2242.feature.rst
new file mode 100644
index 00000000000..386bee3f064
--- /dev/null
+++ b/changelog/2242.feature.rst
@@ -0,0 +1,5 @@
+Added support for configuring header merging behavior with HTTPHeaderDict
+
+When using a ``HTTPHeaderDict`` to provide headers for a r... | 6 | 5 | 3 | [{"id": "G0", "claim": "A helper (e.g. simple_http_recv / _simple_read_http_request) that parses Content-Length and reads exactly the right amount would be very helpful for replacing the timeout-based body reads in this test file's socket handlers.", "category": "testing", "verdict": "opposed", "priority": "P2", "scope... | null |
urllib3__urllib3__2705 | urllib3/urllib3 | 2,705 | defect | ab64be1fa572360eb6c813f131dd0d98d51820c6 | c2b016c5895095ce6fcf26f83a1288d00e0fcd7c | Drop support for OpenSSL <1.1.1 | Closes https://github.com/urllib3/urllib3/issues/2168
From the original issue, decided to not to implement these:
- Didn't remove detection for SSLContext.minimum_version because it requires Python 3.8
- Didn't remove SSLKEYLOGFILE detection because it requires Python 3.8
- Didn't remove post_handshake_auth det... | diff --git a/.readthedocs.yml b/.readthedocs.yml
index b6224dcc84..78bd2064f6 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -1,5 +1,10 @@
version: 2
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3"
+
python:
install:
- requirements: docs/requirements.txt
diff --git a/changelog/2168.removal.r... | 9 | 5 | 0 | [{"id": "G0", "claim": "Remove the trailing comma after the last 1 in the OpenSSL version tuple in src/urllib3/__init__.py.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The defensive ssl.HAS_SNI import-time check is unneeded now that the PR re... | null |
urllib3__urllib3__2777 | urllib3/urllib3 | 2,777 | defect | b5d20d9a11e23d8b2c841c88d7ccfeddfbca721f | 7b7340539b59ba816913b298ae93421c55ad58d1 | Fix Tornado event_loop warning on Python 3.10 and later | Fixes #2772
<!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
| diff --git a/dummyserver/server.py b/dummyserver/server.py
index 8f2994fe490..0593a4bf106 100755
--- a/dummyserver/server.py
+++ b/dummyserver/server.py
@@ -4,6 +4,11 @@
Dummy server used for unit testing.
"""
+from __future__ import annotations
+
+import asyncio
+import concurrent.futures
+import contextlib
impor... | 4 | 3 | 3 | [{"id": "G0", "claim": "Use a pytest fixture instead of setup_class/teardown_class so run_loop_in_thread can be used as a normal context manager without ExitStack.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add `error:There is no current event loop:Dep... | null |
urllib3__urllib3__2806 | urllib3/urllib3 | 2,806 | defect | 1cf3a37bcf09d8b02db51f8dbef0724eb69ed0a2 | 1a96bf3fd1371a5998908699b048acc7bb495f5e | Strip leading zeros from ports | fixed parsing for ports with more than 5 ascii digits (i.e. lots of leading zeros). I've changed the regexp to strip leading zeros from the port in a non-capturing group.
Also added a test.
closes: #2804 | diff --git a/changelog/2804.bugfix.rst b/changelog/2804.bugfix.rst
new file mode 100644
index 0000000000..9927361374
--- /dev/null
+++ b/changelog/2804.bugfix.rst
@@ -0,0 +1,2 @@
+Fixed issue in parse_url that rejected ASCII digits with more than 5 characters
+(i.e. lots of leading zeros but still <= 65535).
diff --git... | 1 | 1 | 1 | [{"id": "G0", "claim": "The relaxed port pattern captures digit strings of unbounded length, so a port longer than Python's integer string conversion limit (~4300 digits) makes int() raise ValueError; the size must be restricted, e.g. by removing leading zeros (bound < 4300).", "category": "correctness", "verdict": "su... | null |
urllib3__urllib3__2817 | urllib3/urllib3 | 2,817 | defect | 806fdb7f0d64f02d034bf610d37eb2c143af4c05 | e3b06c1b17a63b0c52f1e04ebf6f495b0f572d49 | Prevent issue in HTTPResponse().read() when decoded_content is True, then False | Provided it has initialized an eligible decoder(decompressor) and did decode once.
Close #2800
| diff --git a/changelog/2800.bugfix.rst b/changelog/2800.bugfix.rst
new file mode 100644
index 0000000000..3791a72da7
--- /dev/null
+++ b/changelog/2800.bugfix.rst
@@ -0,0 +1,2 @@
+Fixed a potential data loss scenario when using ``HTTPResponse.read()`` with ``decode_content=True``
+and then subsequently calling the meth... | 2 | 2 | 0 | [{"id": "G0", "claim": "Use `data = zlib.compress(b\"foo\")` instead of the manual compressobj compress/flush sequence in this test and the one below.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The changelog entry should not say \"Fixed\" — ... | null |
urllib3__urllib3__2823 | urllib3/urllib3 | 2,823 | defect | b8c5d457fc42821b951ea58bec4ad685a0183c02 | 509f87ecb794a04669961151e4558bb38744bc99 | [1.26] Strip leading zeros from ports | Backports https://github.com/urllib3/urllib3/pull/2806 | diff --git a/src/urllib3/util/url.py b/src/urllib3/util/url.py
index b667c160a6..94f1b8d470 100644
--- a/src/urllib3/util/url.py
+++ b/src/urllib3/util/url.py
@@ -63,7 +63,7 @@
BRACELESS_IPV6_ADDRZ_RE = re.compile("^" + IPV6_ADDRZ_PAT[2:-2] + "$")
ZONE_ID_RE = re.compile("(" + ZONE_ID_PAT + r")\]$")
-_HOST_PORT_PAT... | 1 | 1 | 0 | [{"id": "G0", "claim": "Drop the `-> None` type annotation from the new test so it reads `def test_parse_url_remove_leading_zeros(self):`, matching the unannotated style of the surrounding tests.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
urllib3__urllib3__2860 | urllib3/urllib3 | 2,860 | defect | 5d93c9c6c01efc469200044027c21c6e661f2a99 | 903ac673c18903697984b82608ae00f131e13b21 | Send a clearer error message if response is truncated before a chunk | If a chunked response is truncated exactly before sending a new chunk
(that is, before the first byte of the chunk size), urllib3 throws
`InvalidChunkLength(got length b'\\n', 0 bytes read)`. This is
confusing as no chunk length was sent (a valid chunk length line would
also be \r\n-terminated and we didn't see tho... | diff --git a/changelog/2860.bugfix.rst b/changelog/2860.bugfix.rst
new file mode 100644
index 0000000000..60ee407d04
--- /dev/null
+++ b/changelog/2860.bugfix.rst
@@ -0,0 +1 @@
+Don't claim 'invalid chunk length' if response terminates before the chunk length is sent.
diff --git a/src/urllib3/response.py b/src/urllib3/... | 2 | 2 | 0 | [{"id": "G0", "claim": "The changelog line should be reworded to \"Use ProtocolError instead of InvalidChunkLength if response terminates before the chunk length is sent.\" instead of \"Don't claim 'invalid chunk length' if response terminates before the chunk length is sent.\"", "category": "documentation", "verdict":... | null |
urllib3__urllib3__2943 | urllib3/urllib3 | 2,943 | defect | 2b40cf2ef0d3cdb74a72e906ccc1e3cd8bf4b13c | adc2f099527b29faacf6c9990ed26ff0f13e4e07 | Added support for union operators to ``HTTPHeaderDict`` | This allows a simple way to merge headers provided in a request with the ``PoolManager`` headers, rather than replace them.
Related issue: https://github.com/urllib3/urllib3/issues/2254
I was inspired by Ran's example there:
```
pm.request('POST', 'https://foo.bar', headers={
**pm.headers,
'Content-... | diff --git a/changelog/2254.feature.rst b/changelog/2254.feature.rst
new file mode 100644
index 0000000000..3f189ff5f1
--- /dev/null
+++ b/changelog/2254.feature.rst
@@ -0,0 +1,3 @@
+Added support for union operators to ``HTTPHeaderDict``
+
+This allows a simple way to merge headers provided in a request with the ``Poo... | 3 | 3 | 1 | [{"id": "G0", "claim": "The pull request lost a line of coverage in the urllib3._collections module (line 462 per CI) and should restore it with a test, ignoring the missing line 177.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "mypy is unhappy with `... | null |
urllib3__urllib3__2950 | urllib3/urllib3 | 2,950 | defect | 969fdb9545caeb4e8141ea939231cf03a2db606f | abc4aab4b82c1b571dcdfe985da8c8772016af67 | Deprecate schemeless url, warn that the protocol must be explicitly given | ?answer to #2920
I drafted this PR for an initial deprecation when URLs are missing a scheme (post parsing).
It is probably wrong to say "unsupported in v2.1.0" as the original issue did not mention that was the target. Should I be vague instead?
As for the news fragment, by looking at another similar PR, it di... | diff --git a/docs/v2-migration-guide.rst b/docs/v2-migration-guide.rst
index 24263dc52f9..fdc43c4e3f5 100644
--- a/docs/v2-migration-guide.rst
+++ b/docs/v2-migration-guide.rst
@@ -51,6 +51,7 @@ Here's a short summary of which changes in urllib3 v2.0 are most important:
- Deprecated the ``urllib3[secure]`` extra, will... | 7 | 6 | 2 | [{"id": "G0", "claim": "The deprecation warning should be reworded to drop the hard-to-parse term \"Schemeless\" and instead say that URLs without a scheme (ie 'https://') are deprecated and begin raising an error in a future version of urllib3, how to avoid the DeprecationWarning, and a link to the issue.", "category"... | null |
urllib3__urllib3__2952 | urllib3/urllib3 | 2,952 | defect | 62ae1c81dd625d4dc788743aef638e64d26db0c4 | c9910c54640f7f678065e888557098adfd26f797 | Add backoff jitter to Retry | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
A nice-to-have, to enable the appro... | diff --git a/changelog/2952.feature.rst b/changelog/2952.feature.rst
new file mode 100644
index 0000000000..c750ccde53
--- /dev/null
+++ b/changelog/2952.feature.rst
@@ -0,0 +1 @@
+Added optional `backoff_jitter` parameter to ``Retry``.
diff --git a/src/urllib3/util/retry.py b/src/urllib3/util/retry.py
index 0e854a5424... | 3 | 2 | 0 | [{"id": "G0", "claim": "The changed docstring should document `backoff_jitter` with its own separate `:param float backoff_jitter:` entry instead of only describing it inside the `backoff_factor` description.", "category": "documentation", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "cl... | null |
urllib3__urllib3__3150 | urllib3/urllib3 | 3,150 | defect | 11f5f5e19bfaab9cdfa2ce9223e62b8f05dd2a99 | 89de7bc21a2d1742782ab52cd56d7b9eea1dd18d | Added ca cert data key support in ssl proxy content | Fixes #3065 | diff --git a/.gitignore b/.gitignore
index 0ff7ddb2a1..c7a53a1324 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
/build
/docs/_build
coverage.xml
+myenv
\ No newline at end of file
diff --git a/changelog/3065.bugfix.rst b/changelog/3065.bugfix.rst
new file mode 100644
index 0000000000..58400e1f39
--- /dev/... | 4 | 4 | 2 | [{"id": "G0", "claim": "The new test presumably fails in CI because it passes ca_cert_data the raw bytes of a PEM-encoded certificate (open(DEFAULT_CA, \"rb\").read()), while cadata must be an ASCII string of PEM certificates (bytes are only for DER).", "category": "correctness", "verdict": "supported", "priority": "P0... | null |
urllib3__urllib3__3169 | urllib3/urllib3 | 3,169 | defect | 7d0648b53cf4159e7f3ebb8353cb642942ec93e6 | 5739175c1cf42212000fea9451ffeb8e4571a66b | Fix lint on Python 3.12 | GitHub Actions now defaults to Python 3.12, which made flake8 6.0 report E231 errors because it was looking at f-strings incorrectly. Upgrading to 6.1 fixed the issue, but introduced E721 that I fixed too.
This commit also changes `nox -s lint` and `nox -s mypy` to use Python 3.12, allowing to remove one type ignore... | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6ffe5459e2..04e65f8cd4 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -17,7 +17,7 @@ repos:
- id: isort
- repo: https://github.com/PyCQA/flake8
- rev: 6.0.0
+ rev: 6.1.0
hooks:
- id: flake8
... | 1 | 1 | 1 | [{"id": "G0", "claim": "Changing these asserts from `type(x) == C` to `isinstance(x, C)` changes their meaning, since subclasses of the type would now pass too, and sethmlarson would prefer keeping the original checks as-is.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
urllib3__urllib3__3176 | urllib3/urllib3 | 3,176 | defect | 7d0648b53cf4159e7f3ebb8353cb642942ec93e6 | 64dc2edfaa9425b50c984cb76c481e5cbaa75826 | Treat x-gzip content encoding as gzip | According to RFC 9110, the "x-gzip" content coding should be treated as "gzip".
Fixes #3174
<!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means w... | diff --git a/changelog/3174.bugfix.rst b/changelog/3174.bugfix.rst
new file mode 100644
index 00000000000..cf3e458eb77
--- /dev/null
+++ b/changelog/3174.bugfix.rst
@@ -0,0 +1 @@
+Fixed decoding Gzip-encoded responses which specified ``x-gzip`` content-encoding.
diff --git a/src/urllib3/response.py b/src/urllib3/respon... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new test_decode_x_gzip test is identical to the test above it, so it should be parametrized instead of duplicated.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
urllib3__urllib3__3186 | urllib3/urllib3 | 3,186 | defect | f7cd7f3f632cf5224f627536f02c2abf7e4146d1 | db7d96b7cc2ddc184e459301956ff203ccd91ec6 | Support read1() method in HTTPResponse | Fix suggested in #2125 but I actually wanted to get #2123 fixed and this seems like a reasonable starting point.
Presumably needs more tests as I'm not doing much on that front at the moment. But didn't want to do too much before getting some feedback. | diff --git a/changelog/3186.feature.rst b/changelog/3186.feature.rst
new file mode 100644
index 00000000000..3a6507b49b2
--- /dev/null
+++ b/changelog/3186.feature.rst
@@ -0,0 +1 @@
+Added support for HTTPResponse.read1() method.
diff --git a/src/urllib3/response.py b/src/urllib3/response.py
index 37936f93975..dab4fd34... | 14 | 10 | 5 | [{"id": "G0", "claim": "When `self._decoded_buffer` is not empty, `read1` should make no `_raw_read` calls and serve the caller from the buffer - returning everything from it when `amt` is None - rather than making a raw read anyway (with a 32MiB default that decompressed SSL records can exceed).", "category": "correct... | null |
urllib3__urllib3__3190 | urllib3/urllib3 | 3,190 | defect | 052617c5da9b04bd8d14507f511a4bddba4caf55 | 5b514241ce208b695b3c8d396dcb9cfe44190847 | Run one test using Hypercorn | Closes https://github.com/urllib3/urllib3/issues/3038 | diff --git a/dev-requirements.txt b/dev-requirements.txt
index 845fc98f8a..266c1be646 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -10,3 +10,6 @@ cryptography==41.0.4
backports.zoneinfo==0.2.1;python_version<"3.9"
towncrier==23.6.0
pytest-memray==1.5.0;sys_platform!="win32" and implementation_name... | 4 | 3 | 1 | [{"id": "G0", "claim": "With Tornado the dummy server binds to port 0 to get a random port, but that does not seem to be possible with Hypercorn, so an issue should be opened on Hypercorn for this feature.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "T... | null |
urllib3__urllib3__3225 | urllib3/urllib3 | 3,225 | defect | 5d7979d3f03451c04c80995b8f35cb45ba37c003 | b9c0d4a1e5b8ab174f54de0db5fa7b2d125f74a4 | Turn proxy_app into a class to allow configuring it | This pull request makes no difference, but prepares the switch of `HTTPDummyProxyTestCase` to `Hypercorn`. | diff --git a/dummyserver/asgi_proxy.py b/dummyserver/asgi_proxy.py
index c6bb5162e4..9a3959d036 100755
--- a/dummyserver/asgi_proxy.py
+++ b/dummyserver/asgi_proxy.py
@@ -27,82 +27,83 @@ async def _read_body(receive: ASGIReceiveCallable) -> bytes:
return bytes(body)
-async def absolute_uri(
- scope: HTTPSco... | 1 | 1 | 0 | [{"id": "G0", "claim": "Remove the escaped debug print of scope in dummyserver/asgi_proxy.py.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
urllib3__urllib3__3266 | urllib3/urllib3 | 3,266 | defect | 2ac4efacfef5182aaef3e26a4f1e066ab228dfdd | 06e588f93aca65ad1d6ae1a259d8c7d73c6e4126 | Set proper `proxy_is_verified` value after connecting to proxy | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
closes #3130
(squashed the ~15... | diff --git a/changelog/3120.bugfix.rst b/changelog/3120.bugfix.rst
new file mode 100644
index 00000000000..4659dce55e7
--- /dev/null
+++ b/changelog/3120.bugfix.rst
@@ -0,0 +1,2 @@
+Modified/Extended code, thus HTTPConnection.proxy_is_verified is set to either
+True or False when connecting to a (tunneling or fowradin... | 8 | 7 | 1 | [{"id": "G0", "claim": "The reviewer is reluctant to add a passing test that asserts `is_verified` is set to a wrong value (the HTTPS-proxy + HTTP-destination test asserts True, True).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The author was as... | null |
urllib3__urllib3__3283 | urllib3/urllib3 | 3,283 | defect | 7531aa0abff4c3673967ac78579d7028cb82bb57 | ee0e19d456c5dd19a970dac9056774798d9a28e5 | ensure HTTPSconnection.is_verified is set properly | <!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->
- closes #3267
### Followup Issu... | diff --git a/changelog/3267.bugfix.rst b/changelog/3267.bugfix.rst
new file mode 100644
index 00000000000..ac805a8b922
--- /dev/null
+++ b/changelog/3267.bugfix.rst
@@ -0,0 +1,2 @@
+Fixed ``HTTPSConnection.is_verified`` to be set to ``False`` when connecting
+from a https proxy to a http target. It was set to ``True``... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new is_verified assignment in connect() could be written more simply as the single expression `self.is_verified = sock_and_verified.is_verified and not self.proxy_is_forwarding`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
urllib3__urllib3__3310 | urllib3/urllib3 | 3,310 | defect | 89ed0d6a65138f6d641e92ae4e0da0cdc7d66870 | 8ee777419873c24025ec68b40d565bf93fdf8ff6 | Allow testing HTTP/1.1 and HTTP/2 in the same test | Closes #3194
We're using a parametrized fixture that when used, will run a given test twice, with HTTP/1.1 and HTTP/2. When used with HTTP/2, it injects HTTP/2 support (which currently forces the usage of HTTP/2). The value of the fixture is "h11" or "h2", which helps to check the header return by Hypercorn.
Thin... | diff --git a/dev-requirements.txt b/dev-requirements.txt
index adefa58df0..ef1cb59f92 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,3 +1,4 @@
+h2==4.1.0
coverage==7.4.0
PySocks==1.7.1
pytest==7.4.2
diff --git a/dummyserver/socketserver.py b/dummyserver/socketserver.py
index 488fc729f8..202915ce8... | 1 | 1 | 0 | [{"id": "G0", "claim": "test_http2.py should be renamed to test_hypercorn_server.py — or, as the author suggested, perhaps dropped altogether — now that the test covers both HTTP/1.1 and HTTP/2.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
urllib3__urllib3__3321 | urllib3/urllib3 | 3,321 | defect | 26a07dbd3267b174439f1fca0ab473dc79f473dc | 1949484574e91cbdebd9824fecbdaf49ff577452 | Disable tunnel for http2 requests | Closes https://github.com/urllib3/urllib3/issues/3298 | diff --git a/src/urllib3/http2.py b/src/urllib3/http2.py
index 05de106f73..68f0e19db7 100644
--- a/src/urllib3/http2.py
+++ b/src/urllib3/http2.py
@@ -33,6 +33,9 @@ def __init__(
if "proxy" in kwargs or "proxy_config" in kwargs: # Defensive:
raise NotImplementedError("Proxies aren't supported wit... | 3 | 3 | 3 | [{"id": "G0", "claim": "Add a unit test so the HTTP/2 tunnel guard isn't lost in a later refactoring, and make sure the change does not break existing tests.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add a socket-level test that records the TLS han... | null |
urllib3__urllib3__3324 | urllib3/urllib3 | 3,324 | defect | 8c8e26dab401121e9fccc8e8e8958609ccb045f5 | 7a2fe7b195d677c7857b715aa8d5e7cba93452fe | Probe and cache HTTP/2 support per-origin | Moved `_LockedObject` to `urllib3._collections`.
Adds an "HTTP/2 support" cache which does one of three things if HTTP/2 support is going to be requested from the origin:
- Returns the cached value `True` or `False`
- Returns `None` meaning the current connection is probing and needs to return back a result.
... | diff --git a/changelog/3301.feature.rst b/changelog/3301.feature.rst
new file mode 100644
index 00000000000..9a1dc75b025
--- /dev/null
+++ b/changelog/3301.feature.rst
@@ -0,0 +1,2 @@
+Added a probing mechanism for determining whether a given target origin
+supports HTTP/2 via ALPN.
\ No newline at end of file
diff --g... | 9 | 7 | 1 | [{"id": "G0", "claim": "The comment added before the HTTP/2 probe block will be immediately out of date once the next step of HTTP/2 support proceeds.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Move the _HTTP2ProbeCache object out of connectio... | null |
urllib3__urllib3__3333 | urllib3/urllib3 | 3,333 | defect | 9929d3c4e03b71ba485148a8390cd9411981f40f | c5dc9ba136d19a599223e2fdae11d6cc90064a2e | Fix issue where InsecureRequestWarning is emitted for HTTPS Emscripte… | …n requests
Closes #3331 I wasn't able to get tests to run locally and spent a bunch of time trying to get Jupyterlite+micropip to install a local wheel file to no avail :cry: So will be relying on CI for this one, unfortunately. We really need #3330 | diff --git a/changelog/3331.bugfix.rst b/changelog/3331.bugfix.rst
new file mode 100644
index 0000000000..d309ee7b48
--- /dev/null
+++ b/changelog/3331.bugfix.rst
@@ -0,0 +1 @@
+Fixed issue where ``InsecureRequestWarning`` was emitted for HTTPS connections when using Emscripten.
diff --git a/src/urllib3/contrib/emscrip... | 1 | 1 | 1 | [{"id": "G0", "claim": "The new Pyodide test references `warnings` without importing it where the test runs, so CI fails.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}] | null |
urllib3__urllib3__3356 | urllib3/urllib3 | 3,356 | defect | a7b81f554863f6dfafe2102e38d16688fdd9869a | cce0c0cbf76b8016e64fc869d7ceb3cbfee972be | Allow passing negative integers as `amt` to read methods | Fixes #3122.
According to https://docs.python.org/3/library/io.html#io.BufferedIOBase.read, if the [size] argument is omitted, `None`, or negative, data is read and returned until EOF is reached.
urllib3 (as well as httplib) breaks when a negative number is passed to its read methods. This PR fixes the issue by m... | diff --git a/changelog/3122.bugfix.rst b/changelog/3122.bugfix.rst
new file mode 100644
index 0000000000..12fbbbf131
--- /dev/null
+++ b/changelog/3122.bugfix.rst
@@ -0,0 +1,2 @@
+Allowed passing negative integers as ``amt`` to read methods of
+:class:`http.client.HTTPResponse` as an alternative to ``None``.
diff --git... | 1 | 1 | 1 | [{"id": "G0", "claim": "Parametrize test_mock_transfer_encoding_chunked_unlmtd_read with `read_chunked_args` cases including `()` so the no-argument call is still covered after `amt` was added.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
urllib3__urllib3__3358 | urllib3/urllib3 | 3,358 | defect | 8bbc3db69eb05ec6cce8b3599c2d81b50dbffebf | af2da9db1687ee4c5b9ec3319eaf15e554f5664c | Fix tests that leak threads (pytest 8) | Bumping the pytest version to 8.0.2 revealed that some tests are leaking threads. The tests create a SocketServerThread and those threads never finish. These unterminated threads confuse pytest-memray since while running a test one of these threads can do an allocation that will be counted as part of this test.
I... | diff --git a/dev-requirements.txt b/dev-requirements.txt
index 0533f66d8a..406b8d2f5b 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,7 +1,7 @@
h2==4.1.0
coverage==7.4.1
PySocks==1.7.1
-pytest==7.4.4
+pytest==8.0.2
pytest-timeout==2.1.0
pyOpenSSL==24.0.0
idna==3.4
diff --git a/dummyserver/socke... | 5 | 5 | 1 | [{"id": "G0", "claim": "Debug print statements in validate_request are leftovers and should be removed.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The added time.sleep(1) after ssock.close() is unjustified - why is it needed and why would one se... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.