nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: hamba/avro
Pull request #214 (2022-11-28 15:32:42)

Improved union type resolution error
- updated the union type resolution error to give the union type from the schema that couldn't be resolved. The message when from `"avro: decode union type: unknown union type"` to `"avro: problem resolving decoder for Avro union: avro: unable to resolve type with name test"`. The reason I did this was because I was having a difficult time interpreting the error and had to step through the debugger to see what the problem is.


Patch:
diff --git a/codec_union.go b/codec_union.go
index 068401b..efb97b2 100644
--- a/codec_union.go
+++ b/codec_union.go
@@ -27,7 +27,12 @@ func createDecoderOfUnion(cfg *frozenConfig, schema Schema, typ reflect2.Type) V
 
 	case reflect.Interface:
 		if _, ok := typ.(*reflect2.UnsafeIFaceType); !ok {
-			return decoderOfResolvedUnion(cfg, schema)
+			dec, err := decoderOfResolvedUnion(cfg, schema)
+			if err != nil {
+				return &errorDecoder{err: fmt.Errorf("avro: problem resolving decoder for Avro %s: %w", schema.Type(), err)}
+			}
+
+			return dec
 		}
 	}
 
@@ -222,29 +227,34 @@ func (e *unionPtrEncoder) Encode(ptr unsafe.Pointer, w *Writer) {
 	e.encoder.Encode(*((*unsafe.Pointer)(ptr)), w)
 }
 
-func decoderOfResolvedUnion(cfg *frozenConfig, schema Schema) ValDecoder {
+func decoderOfResolvedUnion(cfg *frozenConfig, schema Schema) (ValDecoder, error) {
 	union := schema.(*UnionSchema)
 
 	types := make([]reflect2.Type, len(union.Types()))
 	decoders := make([]ValDecoder, len(union.Types()))
 	for i, schema := range union.Types() {
 		name := unionResolutionName(schema)
-		if typ, err := cfg.resolver.Type(name); err == nil {
-			decoder := decoderOfType(cfg, schema, typ)
-			decoders[i] = decoder
-			types[i] = typ
-			continue
-		}
 
-		if cfg.config.PartialUnionTypeResolution {
-			decoders[i] = nil
-			types[i] = nil
-			continue
+		typ, err := cfg.resolver.Type(name)
+		if err != nil {
+			if cfg.config.UnionResolutionError {
+				return nil, err
+			}
+
+			if cfg.config.PartialUnionTypeResolution {
+				decoders[i] = nil
+				types[i] = nil
+				continue
+			}
+
+			decoders = []ValDecoder{}
+			types = []reflect2.Type{}
+			break
 		}
 
-		decoders = []ValDecoder{}
-		types = []reflect2.Type{}
-		break
+		decoder := decoderOfType(cfg, schema, typ)
+		decoders[i] = decoder
+		types[i] = typ
 	}
 
 	return &unionResolvedDecoder{
@@ -252,7 +262,7 @@ func decoderOfResolvedUnion(cfg *frozenConfig, schema Schema) ValDecoder {
 		schema:   union,
 		types:    types,
 		decoders: decoders,
-	}
+	}, nil
 }
 
 type unionResolvedDecoder struct {


Test patch:
diff --git a/decoder_union_test.go b/decoder_union_test.go
index ea7af9f..3000bf1 100644
--- a/decoder_union_test.go
+++ b/decoder_union_test.go
@@ -633,7 +633,7 @@ func TestDecoder_UnionInterfaceUnresolvableTypeWithError(t *testing.T) {
 	var got interface{}
 	err := dec.Decode(&got)
 
-	assert.Error(t, err)
+	assert.EqualError(t, err, "avro: problem resolving decoder for Avro union: avro: unable to resolve type with name test")
 }
 
 func TestDecoder_UnionInterfaceInvalidSchema(t *testing.T) {
Repository: hamba/avro
Pull request #241 (2023-03-11 10:41:31)

feat: add delete subject request for schema registry client

nrwiersma: Thanks for the contribution.

You can disable the `interfacebloat` linter.

Patch:
diff --git a/.golangci.yml b/.golangci.yml
index 0f19bad..5ec6350 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -9,6 +9,7 @@ linters-settings:
 linters:
   enable-all: true
   disable:
+    - interfacebloat
     - sqlclosecheck # not relevant (SQL)
     - rowserrcheck # not relevant (SQL)
     - execinquery # not relevant (SQL)
diff --git a/registry/client.go b/registry/client.go
index ff9343a..ea6af71 100644
--- a/registry/client.go
+++ b/registry/client.go
@@ -31,6 +31,9 @@ type Registry interface {
 	// GetSchema returns the schema with the given id.
 	GetSchema(ctx context.Context, id int) (avro.Schema, error)
 
+	// DeleteSubject delete subject.
+	DeleteSubject(ctx context.Context, subject string) ([]int, error)
+
 	// GetSubjects gets the registry subjects.
 	GetSubjects(ctx context.Context) ([]string, error)
 
@@ -200,6 +203,17 @@ func (c *Client) GetSubjects(ctx context.Context) ([]string, error) {
 	return subjects, nil
 }
 
+// DeleteSubject delete subject.
+func (c *Client) DeleteSubject(ctx context.Context, subject string) ([]int, error) {
+	var versions []int
+	p := path.Join("subjects", subject)
+	if err := c.request(ctx, http.MethodDelete, p, nil, &versions); err != nil {
+		return nil, err
+	}
+
+	return versions, nil
+}
+
 // GetVersions gets the schema versions for a subject.
 func (c *Client) GetVersions(ctx context.Context, subject string) ([]int, error) {
 	var versions []int


Test patch:
diff --git a/registry/client_test.go b/registry/client_test.go
index e08e3d4..58214ef 100644
--- a/registry/client_test.go
+++ b/registry/client_test.go
@@ -148,6 +148,35 @@ func TestClient_GetSubjects(t *testing.T) {
 	assert.Equal(t, "foobar", subs[0])
 }
 
+func TestClient_DeleteSubject(t *testing.T) {
+	s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		assert.Equal(t, http.MethodDelete, r.Method)
+		assert.Equal(t, "/subjects/foobar", r.URL.Path)
+
+		_, _ = w.Write([]byte(`[1]`))
+	}))
+	t.Cleanup(s.Close)
+	client, _ := registry.NewClient(s.URL)
+
+	versions, err := client.DeleteSubject(context.Background(), "foobar")
+
+	require.NoError(t, err)
+	require.Len(t, versions, 1)
+	assert.Equal(t, 1, versions[0])
+}
+
+func TestClient_DeleteSubjectRequestError(t *testing.T) {
+	s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		w.WriteHeader(500)
+	}))
+	t.Cleanup(s.Close)
+	client, _ := registry.NewClient(s.URL)
+
+	_, err := client.DeleteSubject(context.Background(), "foobar")
+
+	assert.Error(t, err)
+}
+
 func TestClient_GetSubjectsRequestError(t *testing.T) {
 	s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		w.WriteHeader(500)
Repository: hamba/avro
Pull request #272 (2023-07-05 07:48:25)

Register uuids by default
Registers the uuid logical type by default. The tests added failed before.

nrwiersma: Hey. Thanks for the contribution. 

My only concert here is that others have registered actual UUID packages on this resolver name, which this would break.

Patch:
diff --git a/resolver.go b/resolver.go
index a55aa02..aabf466 100644
--- a/resolver.go
+++ b/resolver.go
@@ -40,6 +40,7 @@ func NewTypeResolver() *TypeResolver {
 	r.Register(string(Long)+"."+string(TimestampMicros), time.Time{})
 	r.Register(string(Long)+"."+string(TimeMicros), time.Duration(0))
 	r.Register(string(Bytes)+"."+string(Decimal), big.NewRat(1, 1))
+	r.Register(string(String)+"."+string(UUID), "")
 
 	return r
 }


Test patch:
diff --git a/decoder_union_test.go b/decoder_union_test.go
index bbc1fe6..e5858db 100644
--- a/decoder_union_test.go
+++ b/decoder_union_test.go
@@ -621,6 +621,20 @@ func TestDecoder_UnionInterfaceWithDecimal_Negative(t *testing.T) {
 	})
 }
 
+func TestDecoder_UnionInterfaceWithUUID(t *testing.T) {
+	defer ConfigTeardown()
+
+	data := []byte{0x2, 0x48, 0x66, 0x33, 0x36, 0x65, 0x35, 0x38, 0x39, 0x61, 0x2d, 0x33, 0x61, 0x35, 0x32, 0x2d, 0x34, 0x39, 0x32, 0x62, 0x2d, 0x62, 0x39, 0x35, 0x63, 0x2d, 0x64, 0x61, 0x64, 0x33, 0x34, 0x35, 0x65, 0x38, 0x64, 0x32, 0x61, 0x63}
+	schema := `["null", {"type": "string", "logicalType": "uuid"}]`
+	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
+
+	var got any
+	err := dec.Decode(&got)
+
+	require.NoError(t, err)
+	assert.Equal(t, "f36e589a-3a52-492b-b95c-dad345e8d2ac", got)
+}
+
 func TestDecoder_UnionInterfaceUnresolvableTypeWithError(t *testing.T) {
 	defer ConfigTeardown()
 
diff --git a/encoder_union_test.go b/encoder_union_test.go
index 215da87..ac43838 100644
--- a/encoder_union_test.go
+++ b/encoder_union_test.go
@@ -444,6 +444,21 @@ func TestEncoder_UnionInterfaceWithDecimal(t *testing.T) {
 	})
 }
 
+func TestEncoder_UnionInterfaceWithUUID(t *testing.T) {
+	defer ConfigTeardown()
+
+	schema := `["null", {"type": "string", "logicalType": "uuid"}]`
+	buf := bytes.NewBuffer([]byte{})
+	enc, err := avro.NewEncoder(schema, buf)
+	require.NoError(t, err)
+
+	var val any = "f36e589a-3a52-492b-b95c-dad345e8d2ac"
+	err = enc.Encode(val)
+
+	require.NoError(t, err)
+	assert.Equal(t, []byte{0x2, 0x48, 0x66, 0x33, 0x36, 0x65, 0x35, 0x38, 0x39, 0x61, 0x2d, 0x33, 0x61, 0x35, 0x32, 0x2d, 0x34, 0x39, 0x32, 0x62, 0x2d, 0x62, 0x39, 0x35, 0x63, 0x2d, 0x64, 0x61, 0x64, 0x33, 0x34, 0x35, 0x65, 0x38, 0x64, 0x32, 0x61, 0x63}, buf.Bytes())
+}
+
 func TestEncoder_UnionInterfaceUnregisteredType(t *testing.T) {
 	defer ConfigTeardown()
Repository: hamba/avro
Pull request #282 (2023-08-13 16:53:45)

fix: fields reference with a full name
fix: #280 

Khalid-Nowaf: Hi @nrwiersma, this PR solved issue #280. I have tested it locally, and it is working.

please let me know if you have any feedback on the fix.


Patch:
diff --git a/schema_parse.go b/schema_parse.go
index c2017ef..cec311c 100644
--- a/schema_parse.go
+++ b/schema_parse.go
@@ -247,7 +247,7 @@ func parseRecord(typ Type, namespace string, m map[string]any, cache *SchemaCach
 	}
 
 	for i, f := range r.Fields {
-		field, err := parseField(r.Namespace, f, cache)
+		field, err := parseField(rec.namespace, f, cache)
 		if err != nil {
 			return nil, err
 		}


Test patch:
diff --git a/schema_test.go b/schema_test.go
index 78d1b67..d390403 100644
--- a/schema_test.go
+++ b/schema_test.go
@@ -535,6 +535,38 @@ func TestRecordSchema_WithReference(t *testing.T) {
 	assert.Equal(t, s.Fingerprint(), s.(*avro.RecordSchema).Fields()[1].Type().Fingerprint())
 }
 
+func TestRecordSchema_WithReferenceFullName(t *testing.T) {
+	schm := `
+{
+   "type": "record",
+   "name": "org.hamba.avro.ValidName",
+    "fields": [
+        {
+            "name": "recordType1",
+            "type": {
+                "name": "refIntType",
+                "type": "record",
+                "fields": [
+                    {"name": "intField", "type": "int"}
+                ]
+            }
+        },
+        {
+            "name": "recordType2",
+            "type": "org.hamba.avro.refIntType"
+        }
+    ]
+}
+`
+
+	s, err := avro.Parse(schm)
+
+	require.NoError(t, err)
+	assert.Equal(t, avro.Record, s.Type())
+	assert.Equal(t, avro.Ref, s.(*avro.RecordSchema).Fields()[1].Type().Type())
+	assert.Equal(t, s.(*avro.RecordSchema).Fields()[0].Type().Fingerprint(), s.(*avro.RecordSchema).Fields()[1].Type().Fingerprint())
+}
+
 func TestRecordSchema_WithAliasReference(t *testing.T) {
 	schm := `
 {
Repository: litestar-org/polyfactory
Pull request #440 (2023-11-14 22:57:51)

fix: flatten_annotation behaviour for Optional
<!--
By submitting this pull request, you agree to:
- follow [Litestar's Code of Conduct](https://github.com/litestar-org/.github/blob/main/CODE_OF_CONDUCT.md)
- follow [Litestar's contribution guidelines](https://github.com/litestar-org/.github/blob/main/CONTRIBUTING.md)
- follow the [PSFs's Code of Conduct](https://www.python.org/psf/conduct/)
-->

### Pull Request Checklist

- [x] New code has 100% test coverage
- [x] (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
- [x] (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
- [x] Pre-Commit Checks were ran and passed
- [x] Tests were ran and passed

### Description
`polyfactoryutils.helpers.flatten_annotation` does not handle Optional properly


### Close Issue(s)
Fixes: #439 

sam-or: @guacs Sorry I let this one split through some how, simple fix
github-actions[bot]: Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/440
guacs: > @guacs Sorry I let this one split through some how, simple fix. Can you please review?

No worries. It happens. Thanks for the fix, btw :)

Patch:
diff --git a/polyfactory/utils/helpers.py b/polyfactory/utils/helpers.py
index 2eb2eca..c28c062 100644
--- a/polyfactory/utils/helpers.py
+++ b/polyfactory/utils/helpers.py
@@ -94,8 +94,8 @@ def flatten_annotation(annotation: Any) -> list[Any]:
     if is_new_type(annotation):
         flat.extend(flatten_annotation(unwrap_new_type(annotation)))
     elif is_optional(annotation):
-        flat.append(NoneType)
-        flat.extend(flatten_annotation(arg) for arg in get_args(annotation) if arg not in (NoneType, None))
+        for a in get_args(annotation):
+            flat.extend(flatten_annotation(a))
     elif is_annotated(annotation):
         flat.extend(flatten_annotation(get_args(annotation)[0]))
     elif is_union(annotation):


Test patch:
diff --git a/tests/test_type_coverage_generation.py b/tests/test_type_coverage_generation.py
index 047c995..7a3a3d5 100644
--- a/tests/test_type_coverage_generation.py
+++ b/tests/test_type_coverage_generation.py
@@ -3,7 +3,7 @@ from __future__ import annotations
 
 from dataclasses import dataclass, make_dataclass
 from datetime import date
-from typing import Dict, FrozenSet, List, Literal, Set, Tuple, Union
+from typing import Dict, FrozenSet, List, Literal, Optional, Set, Tuple, Union
 from uuid import UUID
 
 import pytest
@@ -212,3 +212,18 @@ def test_coverage_parameter_exception() -> None:
 
     with pytest.raises(ParameterException):
         list(Factory.coverage())
+
+
+def test_coverage_optional_field() -> None:
+    @dataclass
+    class OptionalInt:
+        i: Optional[int]
+
+    class OptionalIntFactory(DataclassFactory[OptionalInt]):
+        __model__ = OptionalInt
+
+    results = list(OptionalIntFactory.coverage())
+    assert len(results) == 2
+
+    assert isinstance(results[0].i, int)
+    assert results[1].i is None
Repository: litestar-org/polyfactory
Pull request #698 (2025-04-28 05:46:06)

feat: Allow usage of Pydantic models containing forward references
<!--
By submitting this pull request, you agree to:
- follow [Litestar's Code of Conduct](https://github.com/litestar-org/.github/blob/main/CODE_OF_CONDUCT.md)
- follow [Litestar's contribution guidelines](https://github.com/litestar-org/.github/blob/main/CONTRIBUTING.md)
- follow the [PSFs's Code of Conduct](https://www.python.org/psf/conduct/)
-->
## Description

Call `model_rebuild` when instantiating a `ModelFactory` so that forward references may be replaced with concrete field information (the equivalent is already done for Pydantic V1).

<!--
Please add in issue numbers this pull request will close, if applicable
Examples: Fixes #4321 or Closes #1234

Ensure you are using a supported keyword to properly link an issue:
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
## Closes

Fixes https://github.com/litestar-org/polyfactory/issues/686.

github-actions[bot]: Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/698
adhtruong: @https://github.com/all-contributors add @marcuslimdw for code

Patch:
diff --git a/polyfactory/factories/pydantic_factory.py b/polyfactory/factories/pydantic_factory.py
index e0b9a75..3bfe3a3 100644
--- a/polyfactory/factories/pydantic_factory.py
+++ b/polyfactory/factories/pydantic_factory.py
@@ -396,13 +396,16 @@ class ModelFactory(Generic[T], BaseFactory[T]):
     def __init_subclass__(cls, *args: Any, **kwargs: Any) -> None:
         super().__init_subclass__(*args, **kwargs)
 
-        if (
-            getattr(cls, "__model__", None)
-            and _is_pydantic_v1_model(cls.__model__)
-            and hasattr(cls.__model__, "update_forward_refs")
-        ):
+        model = getattr(cls, "__model__", None)
+        if model is None:
+            return
+
+        if _is_pydantic_v1_model(model) and hasattr(cls.__model__, "update_forward_refs"):
             with suppress(NameError):  # pragma: no cover
-                cls.__model__.update_forward_refs(**cls.__forward_ref_resolution_type_mapping__)  # type: ignore[attr-defined]
+                cls.__model__.update_forward_refs(**cls.__forward_ref_resolution_type_mapping__)
+
+        if _is_pydantic_v2_model(model):
+            model.model_rebuild()
 
     @classmethod
     def is_supported_type(cls, value: Any) -> TypeGuard[type[T]]:


Test patch:
diff --git a/tests/test_pydantic_factory.py b/tests/test_pydantic_factory.py
index 5612cf5..f6eb3ea 100644
--- a/tests/test_pydantic_factory.py
+++ b/tests/test_pydantic_factory.py
@@ -1100,3 +1100,18 @@ def test_use_examples_value_override() -> None:
 
     instance = PaymentFactory.build(currency="DKK")
     assert instance.currency == "DKK"
+
+
+class Base(BaseModel):
+    nested: "Nested"
+
+
+class Nested(BaseModel):
+    value: int
+
+
+def test_rebuild() -> None:
+    class BaseFactory(ModelFactory[Base]):
+        pass
+
+    assert isinstance(BaseFactory.build(), Base)
Repository: exercism/cli
Pull request #721 (2018-08-26 19:23:10)

Handle windows filepaths that accidentally got submitted to the server
Some of the older CLIs did not submit a normalized path for the file, but rather submitted the
filepath. This means that we sometimes had forward slashes and sometimes had backslashes.

The CLI now always submits the normalized path with forward slashes.

This ensures that when we receive files submitted with a buggy client we rewrite the paths
correctly.

Closes https://github.com/exercism/exercism/issues/4260
Closes https://github.com/exercism/exercism/issues/4101
Closes https://github.com/exercism/exercism/issues/4072


Patch:
diff --git a/cmd/download.go b/cmd/download.go
index dc20918..a7491c4 100644
--- a/cmd/download.go
+++ b/cmd/download.go
@@ -199,6 +199,10 @@ func runDownload(cfg config.Config, flags *pflag.FlagSet, args []string) error {
 
 		// TODO: if there's a collision, interactively resolve (show diff, ask if overwrite).
 		// TODO: handle --force flag to overwrite without asking.
+
+		// Rewrite paths submitted with an older, buggy client where the Windows path is being treated as part of the filename.
+		file = strings.Replace(file, "\\", "/", -1)
+
 		relativePath := filepath.FromSlash(file)
 		dir := filepath.Join(solution.Dir, filepath.Dir(relativePath))
 		os.MkdirAll(dir, os.FileMode(0755))


Test patch:
diff --git a/cmd/download_test.go b/cmd/download_test.go
index 865e3e3..401eb6d 100644
--- a/cmd/download_test.go
+++ b/cmd/download_test.go
@@ -170,6 +170,13 @@ func fakeDownloadServer(requestor, teamSlug string) *httptest.Server {
 		fmt.Fprint(w, "this is a special file")
 	})
 
+	mux.HandleFunc("/\\with-leading-backslash.txt", func(w http.ResponseWriter, r *http.Request) {
+		fmt.Fprint(w, "with backslash in name")
+	})
+	mux.HandleFunc("/\\with\\backslashes\\in\\path.txt", func(w http.ResponseWriter, r *http.Request) {
+		fmt.Fprint(w, "with backslash in path")
+	})
+
 	mux.HandleFunc("/with-leading-slash.txt", func(w http.ResponseWriter, r *http.Request) {
 		fmt.Fprint(w, "this has a slash")
 	})
@@ -220,6 +227,16 @@ func assertDownloadedCorrectFiles(t *testing.T, targetDir string) {
 			path:     filepath.Join(targetDir, "bogus-track", "bogus-exercise", "with-leading-slash.txt"),
 			contents: "this has a slash",
 		},
+		{
+			desc:     "a file with a leading backslash",
+			path:     filepath.Join(targetDir, "bogus-track", "bogus-exercise", "with-leading-backslash.txt"),
+			contents: "with backslash in name",
+		},
+		{
+			desc:     "a file with backslashes in path",
+			path:     filepath.Join(targetDir, "bogus-track", "bogus-exercise", "with", "backslashes", "in", "path.txt"),
+			contents: "with backslash in path",
+		},
 	}
 
 	for _, file := range expectedFiles {
@@ -259,6 +276,8 @@ const payloadTemplate = `
 			"subdir/file-2.txt",
 			"special-char-filename#.txt",
 			"/with-leading-slash.txt",
+			"\\with-leading-backslash.txt",
+			"\\with\\backslashes\\in\\path.txt",
 			"file-3.txt"
 		],
 		"iteration": {
Repository: exercism/cli
Pull request #724 (2018-08-29 17:24:59)

Update submit error message when submitting a directory
This it updating the error message when trying to submit a directory to help new students.
Issue: [https://github.com/exercism/exercism/issues/4309](https://github.com/exercism/exercism/issues/4309)

nywilken: @sfairchild \please update the formatting so that it is consistent with the message format being used for the download message error

https://github.com/exercism/cli/blob/e9877e2a172e4004124983488918ec68292fe9d3/cmd/submit.go#L138-L144
sfairchild: Thanks for the feedback. I updated and pushed the changes

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d78781a..8c9d737 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,11 @@ The exercism CLI follows [semantic versioning](http://semver.org/).
 ## Next Release
 * **Your contribution here**
 
+## v3.0.9 (2018-08-29)
+* [#720](https://github.com/exercism/cli/pull/720) Make the timeout configurable globally - [@kytrinyx]
+* [#721](https://github.com/exercism/cli/pull/721) Handle windows filepaths that accidentally got submitted to the server - [@kytrinyx]
+* [#722](https://github.com/exercism/cli/pull/722) Handle exercise directories with numeric suffixes - [@kytrinyx]
+
 ## v3.0.8 (2018-08-22)
 * [#713](https://github.com/exercism/cli/pull/713) Fix broken support for uuid flag on download command - [@nywilken]
 
diff --git a/cmd/submit.go b/cmd/submit.go
index 9952b5f..29d7eb4 100644
--- a/cmd/submit.go
+++ b/cmd/submit.go
@@ -87,8 +87,12 @@ func runSubmit(cfg config.Config, flags *pflag.FlagSet, args []string) error {
 
         %s
 
+    Please change into the directory and provide the path to the file(s) you wish to submit
+
+        %s submit FILENAME
+
 			`
-			return fmt.Errorf(msg, arg)
+			return fmt.Errorf(msg, arg, BinaryName)
 		}
 
 		src, err := filepath.EvalSymlinks(arg)
diff --git a/cmd/version.go b/cmd/version.go
index f65b5e5..f834132 100644
--- a/cmd/version.go
+++ b/cmd/version.go
@@ -9,7 +9,7 @@ import (
 
 // Version is the version of the current build.
 // It follows semantic versioning.
-const Version = "3.0.8"
+const Version = "3.0.9"
 
 // checkLatest flag for version command.
 var checkLatest bool


Test patch:
diff --git a/cmd/submit_test.go b/cmd/submit_test.go
index 556c3d3..ca1147e 100644
--- a/cmd/submit_test.go
+++ b/cmd/submit_test.go
@@ -123,6 +123,7 @@ func TestSubmitFilesAndDir(t *testing.T) {
 	}
 	err = runSubmit(cfg, pflag.NewFlagSet("fake", pflag.PanicOnError), files)
 	assert.Regexp(t, "submitting a directory", err.Error())
+	assert.Regexp(t, "Please change into the directory and provide the path to the file\\(s\\) you wish to submit", err.Error())
 }
 
 func TestSubmitFiles(t *testing.T) {