nebius/SWE-bench-extra huggingface dataset:
Repository: andrewgodwin/urlman

Issue:
__qualname__ access by Sphinx 3.4.0 fails
I'm using Sphinx to document my project that uses `urlman`. As of the new Sphinx 3.4.0, Sphinx [uses](https://github.com/sphinx-doc/sphinx/issues/5538) `__qualname__` to resolve inheritance when running `autodoc`. This process causes `urlman` to throw an exception, making the docs unbuildable:

```
  File "/home/pretalx_docs/.local/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 931, in generate
    sourcename = self.get_sourcename()
  File "/home/pretalx_docs/.local/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 575, in get_sourcename
    getattr(self.object, '__qualname__', None)):
  File "/home/pretalx_docs/.local/lib/python3.8/site-packages/urlman.py", line 69, in __getattr__
    return self.get_url(attr)
  File "/home/pretalx_docs/.local/lib/python3.8/site-packages/urlman.py", line 76, in get_url
    raise ValueError("No URL called %r on %r" %
ValueError: No URL called '__qualname__' on 'NoneType'
```

I'm not sure what the right solution is – I'm tempted to say that dunder attribute access should just not be interpreted as a URL, or at least should be given a second attempt at the actual attributes when URL lookup fails.

Comments:

Patch:
diff --git a/urlman.py b/urlman.py
index 738018e..7700384 100644
--- a/urlman.py
+++ b/urlman.py
@@ -51,7 +51,7 @@ class UrlsMetaclass(type):
         return type.__new__(self, name, bases, attrs)
 
     def __get__(self, instance, klass):
-        return self(klass, instance)
+        return self(klass, instance, self.__name__)
 
 
 class Urls(with_metaclass(UrlsMetaclass)):
@@ -62,11 +62,12 @@ class Urls(with_metaclass(UrlsMetaclass)):
     format. If you need to you can also specify a handler function for a url.
     """
 
-    def __init__(self, klass, instance):
+    def __init__(self, klass, instance, name):
         self.klass = klass
         self.instance = instance
         self.context = {"self": self.instance}
         self.context.update(self.urls)
+        self.__qualname__ = ".".join((klass.__qualname__, name))
 
     def __getattr__(self, attr):
         return self.get_url(attr)


Test patch:
diff --git a/test_urlman.py b/test_urlman.py
index 6fb6713..201eed9 100644
--- a/test_urlman.py
+++ b/test_urlman.py
@@ -135,3 +135,7 @@ def test_rest_framework_serializer(post):
         "admin": post.urls.admin.full(),
     }
     assert relative_field.to_representation(post) == {"view": post.urls.view}
+
+
+def test_qualname(post):
+    assert post.urls.__qualname__ == "Post.urls"
Repository: antirotor/speedcopy

Issue:
Copying doesn't work if non-absolute filenames supplied
```
speedcopy.copyfile("C:/Temp/asdf", "C:/Temp/fdsa")
```
should work exactly the same as
```
os.chdir("C:/Temp")
speedcopy.copyfile("asdf", "fdsa")
```


Comments:

Patch:
diff --git a/speedcopy/__init__.py b/speedcopy/__init__.py
index c7b2c99..e681fd7 100644
--- a/speedcopy/__init__.py
+++ b/speedcopy/__init__.py
@@ -144,8 +144,8 @@ if not sys.platform.startswith("win32"):
             os.symlink(os.readlink(src), dst)
         else:
             fs_src_type = FilesystemInfo().filesystem(src.encode('utf-8'))
-            fs_dst_type = FilesystemInfo().filesystem(
-                os.path.dirname(dst.encode('utf-8')))
+            dst_dir_path = os.path.normpath(os.path.dirname(dst.encode('utf-8')))  # noqa: E501
+            fs_dst_type = FilesystemInfo().filesystem(dst_dir_path)
             supported_fs = ['CIFS', 'SMB2']
             debug(">>> Source FS: {}".format(fs_src_type))
             debug(">>> Destination FS: {}".format(fs_dst_type))
@@ -218,8 +218,8 @@ else:
                                  ctypes.c_void_p)
             copyfile.restype = ctypes.HRESULT
 
-            source_file = os.path.normpath(src)
-            dest_file = os.path.normpath(dst)
+            source_file = os.path.abspath(os.path.normpath(src))
+            dest_file = os.path.abspath(os.path.normpath(dst))
             if source_file.startswith('\\\\'):
                 source_file = 'UNC\\' + source_file[2:]
             if dest_file.startswith('\\\\'):


Test patch:
diff --git a/tests/test_speedcopy.py b/tests/test_speedcopy.py
index bea8ba4..ec69756 100644
--- a/tests/test_speedcopy.py
+++ b/tests/test_speedcopy.py
@@ -3,6 +3,7 @@ import speedcopy
 import os
 
 speedcopy.SPEEDCOPY_DEBUG = True
+_FILE_SIZE = 5 * 1024 * 1024
 
 
 def setup_function(function):
@@ -13,11 +14,11 @@ def teadown_function(function):
     speedcopy.unpatch_copyfile()
 
 
-def test_copy(tmpdir):
+def test_copy_abs(tmpdir):
     src = tmpdir.join("source")
     dst = tmpdir.join("destination")
     with open(str(src), "wb") as f:
-        f.write(os.urandom(5 * 1024 * 1024))
+        f.write(os.urandom(_FILE_SIZE))
     f.close()
 
     shutil.copyfile(str(src), str(dst))
@@ -25,6 +26,24 @@ def test_copy(tmpdir):
     assert os.path.isfile(str(dst))
 
 
+def test_copy_rel(tmpdir):
+    cwd = os.getcwd()
+    os.chdir(str(tmpdir))
+
+    try:
+        src = "source"
+        dst = "destination"
+        with open(str(src), "wb") as f:
+            f.write(os.urandom(_FILE_SIZE))
+        f.close()
+
+        shutil.copyfile(str(src), str(dst))
+
+        assert os.path.isfile(str(dst))
+    finally:
+        os.chdir(cwd)
+
+
 def test_patch():
     assert shutil.copyfile == speedcopy.copyfile
Repository: argoproj-labs/gordian

Issue:
Fetching of all files
It appears gordian is fetching all the files of a repo even if you only need 1.

Comments:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cab46c1..eafba89 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com),
 and this project adheres to [Semantic Versioning](https://semver.org).
 
+
+## [3.7.0] - 2023-10-18
+### Added
+- Added support to pass in a path when calling get_files(), resolves issue #34
+
 ## [3.6.0] - 2023-10-06
 ### Fix
 - Fetch repo content from target branch
diff --git a/gordian/repo.py b/gordian/repo.py
index ae72642..0c53a0b 100644
--- a/gordian/repo.py
+++ b/gordian/repo.py
@@ -77,9 +77,9 @@ class Repo:
 
         return PlainTextFile(file, self)
 
-    def get_files(self):
+    def get_files(self, path=''):
         if not self.files:
-            contents = self._get_repo_contents('')
+            contents = self._get_repo_contents(path)
 
             while contents:
                 file = contents.pop(0)


Test patch:
diff --git a/tests/test_repo.py b/tests/test_repo.py
index 4398ec0..a341ea1 100644
--- a/tests/test_repo.py
+++ b/tests/test_repo.py
@@ -191,6 +191,16 @@ class TestRepo(unittest.TestCase):
         repo._source_repo.delete_file.assert_called_once()
         self.assertTrue(repo.dirty)
 
+    def test_get_files_with_path(self):
+        self.repo._set_target_branch('target')
+        self.repo.files = []
+        self.repo._source_repo = MagicMock()
+        repository_file = MagicMock(path='test/afile.txt', type='not_dir')
+        self.repo._source_repo.get_contents.side_effect = [[MagicMock(path='directory', type='dir')],[repository_file]]
+        self.repo.get_files('test')
+        self.repo._source_repo.get_contents.assert_has_calls([call('test', 'target'), call('directory', 'target')])
+        self.assertEquals(self.repo.files, [repository_file])
+
     def test__get_github_client(self):
         repo = Repo('test_repo', branch='', github=self.mock_git)