Northy1717/SWE-bench-Live huggingface dataset:
Repository: beetbox/beets

Issue:
[Dev] ~50 library tests fail with the wrong drive on Windows
The tests are failing when run on any Windows machine that uses the default system drive of `C:/` (they hard-code `D:/`).

### Problem

```python
# Set up beets for contributing (install poetry, etc)
# ...

poe test
# => 50+ failures, like:
# FAILED test/test_library.py::DestinationFunctionTest::test_upper_case_literal - AssertionError: assert b'C:\\base\\FOO' == b'D:\\base\\FOO'
```

This looks to be a regression introduced with #5224. The fix is to use the `%SystemDrive%` environment variable, not a hard-coded `D:`

### Setup

* OS: Windows 11 24H2
* Python version: 3.11
* beets version: commit e439c04d89d14d993a2b381ad92ad7dd1b72c733
* Turning off plugins made problem go away (yes/no): (n/a)



Discussion:

Patch:
diff --git a/beets/library.py b/beets/library.py
index 9be3a16020..b813d2ba4c 100644
--- a/beets/library.py
+++ b/beets/library.py
@@ -1084,7 +1084,9 @@ def destination(
         (i.e., where the file ought to be).
 
         The path is returned as a bytestring. ``basedir`` can override the
-        library's base directory for the destination.
+        library's base directory for the destination. If ``relative_to_libdir``
+        is true, returns just the fragment of the path underneath the library
+        base directory.
         """
         db = self._check_db()
         basedir = basedir or db.directory
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 09259e1fa1..9bc065419a 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -28,6 +28,8 @@ Bug fixes:
 * :doc:`plugins/musicbrainz`: fix regression where user configured
   ``extra_tags`` have been read incorrectly.
   :bug:`5788`
+* tests: Fix library tests failing on Windows when run from outside ``D:/``.
+  :bug:`5802`
 
 For packagers:
 


Test patch:
diff --git a/test/test_library.py b/test/test_library.py
index 39f1d0b9ea..bb014d76d0 100644
--- a/test/test_library.py
+++ b/test/test_library.py
@@ -34,7 +34,7 @@
 from beets.test import _common
 from beets.test._common import item
 from beets.test.helper import BeetsTestCase, ItemInDBTestCase
-from beets.util import as_string, bytestring_path, syspath
+from beets.util import as_string, bytestring_path, normpath, syspath
 
 # Shortcut to path normalization.
 np = util.normpath
@@ -553,6 +553,9 @@ def test_both_artist_and_albumartist_empty(self):
 class PathFormattingMixin:
     """Utilities for testing path formatting."""
 
+    i: beets.library.Item
+    lib: beets.library.Library
+
     def _setf(self, fmt):
         self.lib.path_formats.insert(0, ("default", fmt))
 
@@ -560,9 +563,12 @@ def _assert_dest(self, dest, i=None):
         if i is None:
             i = self.i
 
+        # Handle paths on Windows.
         if os.path.sep != "/":
             dest = dest.replace(b"/", os.path.sep.encode())
-            dest = b"D:" + dest
+
+            # Paths are normalized based on the CWD.
+            dest = normpath(dest)
 
         actual = i.destination()
Repository: pytorch/torchtitan

Issue:
[Extensions] JobConfig extensions processing does not propagate actual values, sets to zero
### Bug description

Using the JobConfig [extension](https://github.com/pytorch/torchtitan/blob/main/docs/extension.md#extending-jobconfig) point, values are not being propogated. 
The new field(s) are added, but they all end up with zero as the value rather than what was set. 

example:
~~~
@dataclass
class Parallelism:
    expert_parallel_degree: int = 2
    """ degree to parallelize experts """
~~~
will add expert_parallel_degree = 0 rather than 2.



### Versions

525 nightly
latest Titan


Discussion:

Patch:
diff --git a/torchtitan/config_manager.py b/torchtitan/config_manager.py
index 22e25460f..d8299f91a 100644
--- a/torchtitan/config_manager.py
+++ b/torchtitan/config_manager.py
@@ -721,7 +721,7 @@ def _merge_configs(base, custom) -> Type:
         # Only in Custom
         for name, f in c_map.items():
             if name not in b_map:
-                result.append((name, f.type, field(default_factory=f.type)))
+                result.append((name, f.type, f))
 
         return make_dataclass(f"Merged{base.__name__}", result, bases=(base,))
 


Test patch:
diff --git a/tests/unit_tests/test_job_config.py b/tests/unit_tests/test_job_config.py
index b5dd0b21e..2a64b38e5 100644
--- a/tests/unit_tests/test_job_config.py
+++ b/tests/unit_tests/test_job_config.py
@@ -281,6 +281,7 @@ def test_custom_parser(self):
                 ]
             )
             assert config.custom_args.how_is_your_day == "bad"
+            assert config.training.my_custom_steps == 32
             assert config.model.converters == ["float8", "mxfp"]
             result = config.to_dict()
             assert isinstance(result, dict)
Repository: pylint-dev/pylint

Issue:
AttributeError: 'NoneType' object has no attribute 'scope' in variables checker
### Bug description

Pylint crashes on this fuzzed code from pysource-codegen:
```python
@d
class a:
    d: int

import d
```


### Command used

```shell
pylint crash.py
```

### Pylint output

```python
Exception on node <Name.d l.1 at 0x77162afcce90> in file 'crash.py'
Traceback (most recent call last):
  File "pylint/pylint/utils/ast_walker.py", line 87, in walk
    callback(astroid)
  File "pylint/pylint/checkers/variables.py", line 1651, in visit_name
    self._undefined_and_used_before_checker(node, stmt)
  File "pylint/pylint/checkers/variables.py", line 1694, in _undefined_and_used_before_checker
    action, nodes_to_consume = self._check_consumer(
                               ^^^^^^^^^^^^^^^^^^^^^
  File "pylint/pylint/checkers/variables.py", line 1942, in _check_consumer
    elif not self._is_builtin(node.name) and self._is_only_type_assignment(
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pylint/pylint/checkers/variables.py", line 2415, in _is_only_type_assignment
    parent_scope = parent.scope()
                   ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'scope'
```

### Expected behavior

No crash

### Pylint version

pylint: 55098c79725
astroid: cae4388d75
Python 3.12.7

### OS / Environment

Arch Linux



Discussion:

Patch:
diff --git a/doc/whatsnew/fragments/10105.bugfix b/doc/whatsnew/fragments/10105.bugfix
new file mode 100644
index 0000000000..608a723f71
--- /dev/null
+++ b/doc/whatsnew/fragments/10105.bugfix
@@ -0,0 +1,3 @@
+Fixed a crash when importing a class decorator that did not exist with the same name than a class attribute after the class definition.
+
+Closes #10105
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index 84a75baadc..7a55bc68b2 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -2445,7 +2445,7 @@ def _is_only_type_assignment(
         node_frame = node.frame()
 
         parent = node
-        while parent is not defstmt_frame.parent:
+        while parent not in {defstmt_frame.parent, None}:
             parent_scope = parent.scope()
 
             # Find out if any nonlocals receive values in nested functions


Test patch:
diff --git a/tests/functional/r/regression_02/regression_10105.py b/tests/functional/r/regression_02/regression_10105.py
new file mode 100644
index 0000000000..9eeaeac1b6
--- /dev/null
+++ b/tests/functional/r/regression_02/regression_10105.py
@@ -0,0 +1,9 @@
+# pylint: disable=too-few-public-methods,missing-docstring,used-before-assignment,import-error,unused-import
+# pylint: disable=wrong-import-position
+
+
+@decorator
+class DecoratedClass:
+    decorator: int
+
+import decorator