anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
# Environment variables and worker initialization issues
I've encountered a problem with the worker initialization process in Gunicorn. When running my application, I'm seeing unexpected behavior related to environment variables and worker reloading.
## Description
When a worker initializes, it seems that environmen... | diff --git a/gunicorn/workers/base.py b/gunicorn/workers/base.py
index 93c465c..650b8ca 100644
--- b/gunicorn/workers/base.py
+++ a/gunicorn/workers/base.py
@@ -92,11 +92,11 @@ class Worker:
# set environment' variables
if self.cfg.env:
- for v, k in self.cfg.env.items():
+ for... |
Syntax error column position off by one
When a CSS selector has a syntax error, the column position reported in the error context is off by one. The error pointer appears one position to the left of where it should be.
#### Steps/Code to Reproduce
```python
import soupsieve as sv
try:
sv.compile('input.field[ty... | diff --git a/soupsieve/util.py b/soupsieve/util.py
index 9b2e64d..b4fe04e 100644
--- b/soupsieve/util.py
+++ a/soupsieve/util.py
@@ -92,11 +92,11 @@ def get_pattern_context(pattern: str, index: int) -> tuple[str, int, int]:
if not len(m.group(0)) and not len(text):
indent = ''
offset ... |
ClassDef._inferred_bases() returns incorrect object reference causing KeyError
#### Description
When working with class inheritance, the `_inferred_bases()` method in `ClassDef` is returning an incorrect object reference, which causes a `KeyError: 0` when trying to access builtin objects or process class hierarchies.... | diff --git a/astroid/nodes/scoped_nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes/scoped_nodes.py
index 99ed796..51459af 100644
--- b/astroid/nodes/scoped_nodes/scoped_nodes.py
+++ a/astroid/nodes/scoped_nodes/scoped_nodes.py
@@ -2801,18 +2801,30 @@ class ClassDef(
return self._all_slots
def _inferre... |
# Settings.__getattr__ logic is reversed, causing AttributeError for valid settings
## Description
I discovered a bug in the `Settings.__getattr__` method where the logic for checking attributes is reversed. When trying to access a valid setting that exists in `main_thread_config`, the code raises an `AttributeError`... | diff --git a/dspy/dsp/utils/settings.py b/dspy/dsp/utils/settings.py
index 983927f..36828c9 100644
--- b/dspy/dsp/utils/settings.py
+++ a/dspy/dsp/utils/settings.py
@@ -76,9 +76,10 @@ class Settings:
if name in overrides:
return overrides[name]
elif name in main_thread_config:
+ ... |
get_latest_suite_node returns wrong node type
#### Description
The `get_latest_suite_node` method in `IndentationNode` is returning nodes that are not suite nodes. This affects PEP8 normalization and indentation handling.
#### Steps/Code to Reproduce
```python
import parso
code = """
def foo():
if True:
... | diff --git a/parso/python/pep8.py b/parso/python/pep8.py
index c492dae..a64b18c 100644
--- b/parso/python/pep8.py
+++ a/parso/python/pep8.py
@@ -47,7 +47,7 @@ class IndentationNode(object):
def get_latest_suite_node(self):
n = self
while n is not None:
- if n.type != IndentationTypes.S... |
submap method raises UnboundLocalError when accessing pixel_corners variable
#### Description
The `submap` method in `GenericMap` is raising an `UnboundLocalError` when trying to access the `pixel_corners` variable. This appears to be happening because the variable is being used before it's defined in the method.
##... | diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
index bdcac77..4711a9d 100644
--- b/sunpy/map/mapbase.py
+++ a/sunpy/map/mapbase.py
@@ -1957,60 +1957,6 @@ class GenericMap(NDData):
@u.quantity_input
def submap(self, bottom_left, *, top_right=None, width: (u.deg, u.pix) = None, height: (u.deg, u.pix... |
StringArray.isin() fails with BaseStringArray values parameter
#### Description
When calling `isin()` on a StringArray with another BaseStringArray as the values parameter, the method raises an AttributeError because it tries to call `_from_sequence` on the wrong branch of the conditional logic.
#### Steps/Code to R... | diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py
index 7227ea7..3124434 100644
--- b/pandas/core/arrays/string_.py
+++ a/pandas/core/arrays/string_.py
@@ -801,6 +801,8 @@ class StringArray(BaseStringArray, NumpyExtensionArray): # type: ignore[misc]
if isinstance(values, BaseStringArr... |
#### Description
The `widow_control` property in `ParagraphFormat` returns incorrect boolean values when the paragraph properties element is missing or when widow control is enabled.
#### Steps/Code to Reproduce
```python
from docx import Document
from docx.shared import Inches
# Create a new document
doc = Documen... | diff --git a/src/docx/text/parfmt.py b/src/docx/text/parfmt.py
index ea37437..dfba21a 100644
--- b/src/docx/text/parfmt.py
+++ a/src/docx/text/parfmt.py
@@ -246,8 +246,8 @@ class ParagraphFormat(ElementProxy):
"""
pPr = self._element.pPr
if pPr is None:
- return False
- retu... |
KCD multiplex signal loading broken with argument order error
#### Description
When loading KCD files with multiplex signals, the parser fails with `'list' object has no attribute 'attrib'` error. This appears to be related to incorrect argument ordering in the `_load_signal_element` function calls within the multipl... | diff --git a/src/cantools/database/can/formats/kcd.py b/src/cantools/database/can/formats/kcd.py
index a54c86c..d969d1b 100644
--- b/src/cantools/database/can/formats/kcd.py
+++ a/src/cantools/database/can/formats/kcd.py
@@ -151,18 +151,18 @@ def _load_multiplex_element(mux, nodes):
"""
- mux_signal = _load... |
SQL Builder not properly handling PlanOptions in Build method
#### Description
The `Build` method in the postgres migrate state is not using the configured `PlanOptions` when creating SQL builders, causing SQL statements to be generated without proper formatting or configuration options.
#### Steps/Code to Reproduce... | diff --git a/sql/postgres/migrate_oss.go b/sql/postgres/migrate_oss.go
index 2b3756b..567784e 100644
--- b/sql/postgres/migrate_oss.go
+++ a/sql/postgres/migrate_oss.go
@@ -1199,14 +1199,8 @@ func (s *state) append(c ...*migrate.Change) {
// Build instantiates a new builder and writes the given phrase to it.
func (... |
MoneyField value gets doubled and validation fails with wrong object
#### Description
When working with MoneyField instances, the field value gets unexpectedly doubled and validation is performed on the wrong object, causing various operations to fail.
#### Steps/Code to Reproduce
```python
from djmoney import Mone... | diff --git a/djmoney/models/fields.py b/djmoney/models/fields.py
index dc5f6ad..8052852 100644
--- b/djmoney/models/fields.py
+++ a/djmoney/models/fields.py
@@ -125,11 +125,11 @@ class MoneyFieldProxy:
obj.__dict__[self.field.name] = value
def prepare_value(self, obj, value):
- validate_money_val... |
DataFrame merge produces incorrect column order when using cross merge
#### Description
When performing a cross merge operation on DataFrames, the resulting DataFrame has columns in the wrong order. The left DataFrame columns should appear before the right DataFrame columns, but they appear after instead.
#### Steps... | diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py
index 09be82c..6929b4a 100644
--- b/pandas/core/reshape/merge.py
+++ a/pandas/core/reshape/merge.py
@@ -1083,49 +1083,50 @@ class _MergeOperation:
"""
reindex along index and concat along columns.
"""
+ # Take vie... |
LazyFile.close() doesn't actually close the file
#### Description
The `LazyFile.close()` method only flushes the underlying file instead of actually closing it. This causes issues when the file handle remains open after calling close().
#### Steps/Code to Reproduce
```python
import click
import tempfile
import os
... | diff --git a/src/click/utils.py b/src/click/utils.py
index ab2fe58..2894091 100644
--- b/src/click/utils.py
+++ a/src/click/utils.py
@@ -169,7 +169,7 @@ class LazyFile:
def close(self) -> None:
"""Closes the underlying file, no matter what."""
if self._f is not None:
- self._f.flush()
... |
PDFStandardSecurityHandler initialization order causes AttributeError
#### Description
When processing encrypted PDF files, the PDFStandardSecurityHandler fails during initialization with an AttributeError. The issue occurs because `init_key()` is being called before the required parameters are properly initialized.
... | diff --git a/pdfminer/pdfdocument.py b/pdfminer/pdfdocument.py
index 1c06335..50dee58 100644
--- b/pdfminer/pdfdocument.py
+++ a/pdfminer/pdfdocument.py
@@ -345,11 +345,12 @@ class PDFStandardSecurityHandler:
self.init()
def init(self) -> None:
- self.init_key()
self.init_params()
... |
UnboundLocalError in pandas utility functions after recent changes
#### Description
Several pandas utility functions are throwing `UnboundLocalError` exceptions when called. This affects functions like `show_versions()`, argument validation functions, and boolean validation utilities.
#### Steps/Code to Reproduce
`... | diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py
index bd20660..034ba1d 100644
--- b/pandas/util/_print_versions.py
+++ a/pandas/util/_print_versions.py
@@ -63,7 +63,6 @@ def _get_dependency_info() -> dict[str, JSONSerializable]:
"""
Returns dependency information as a JSON seriali... |
FileResponse fails when serving files without range requests
#### Description
After a recent change, FileResponse is broken for basic file serving without range requests. The `_handle_simple` method was removed but it's still being called internally, causing an AttributeError.
#### Steps/Code to Reproduce
```python... | diff --git a/starlette/responses.py b/starlette/responses.py
index c711dfa..1c2db22 100644
--- b/starlette/responses.py
+++ a/starlette/responses.py
@@ -373,6 +373,18 @@ class FileResponse(Response):
if self.background is not None:
await self.background()
+ async def _handle_simple(self, send... |
# Incorrect type identification in cc_to_dict function
## Description
The `cc_to_dict` function in `radon/cli/tools.py` is incorrectly identifying the type of objects. The function is supposed to determine whether an object is a method, function, or class, but it's currently returning the wrong types.
When using the... | diff --git a/radon/cli/tools.py b/radon/cli/tools.py
index cc8d4fa..78163d9 100644
--- b/radon/cli/tools.py
+++ a/radon/cli/tools.py
@@ -297,8 +297,8 @@ def cc_to_dict(obj):
def get_type(obj):
'''The object can be of type *method*, *function* or *class*.'''
if isinstance(obj, Function):
- ... |
### Issue with HTTP Error Handling in Scraper
#### What happened?
While using the `Scraper` class to fetch files from a web directory, it seems that certain HTTP errors are not being handled as expected. Specifically, when encountering HTTP errors such as 400 (Bad Request), 403 (Forbidden), 429 (Too Many Requests), a... | diff --git a/sunpy/net/scraper.py b/sunpy/net/scraper.py
index 202638e..3cd10bd 100644
--- b/sunpy/net/scraper.py
+++ a/sunpy/net/scraper.py
@@ -344,43 +344,60 @@ class Scraper:
Goes over http archives hosted on the web, to return list of files in the given timerange.
"""
directories = self.r... |
Style formatting produces incorrect output after recent changes
#### Description
The style formatting system is producing incorrect output when highlighting code. Colors and formatting attributes appear to be mixed up or applied incorrectly.
#### Steps/Code to Reproduce
```python
from pygments import highlight
from... | diff --git a/pygments/style.py b/pygments/style.py
index 449522c..61452e1 100644
--- b/pygments/style.py
+++ a/pygments/style.py
@@ -61,19 +61,19 @@ class StyleMeta(type):
obj = type.__new__(mcs, name, bases, dct)
for token in STANDARD_TYPES:
if token not in obj.styles:
- o... |
Index.insert() fails with ExtensionArray when trying to insert incompatible types
#### Description
When using `Index.insert()` with an ExtensionArray-backed index and trying to insert an item that's incompatible with the array's dtype, the operation fails instead of falling back to a compatible dtype.
#### Steps/Cod... | diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py
index c17c8c1..c15a5f3 100644
--- b/pandas/core/indexes/base.py
+++ a/pandas/core/indexes/base.py
@@ -6917,6 +6917,22 @@ class Index(IndexOpsMixin, PandasObject):
if dtype != self.dtype:
return self.astype(dtype).insert... |
Font processing fails with UnboundLocalError when colorspace spec is a list
#### Description
When processing PDF files that contain colorspace specifications as lists, the PDF interpreter fails with an `UnboundLocalError: local variable 'name' referenced before assignment`. This occurs because the `get_colorspace` fu... | diff --git a/pdfminer/pdfinterp.py b/pdfminer/pdfinterp.py
index ae1c46a..effe89b 100644
--- b/pdfminer/pdfinterp.py
+++ a/pdfminer/pdfinterp.py
@@ -382,7 +382,7 @@ class PDFPageInterpreter:
def get_colorspace(spec: object) -> Optional[PDFColorSpace]:
if isinstance(spec, list):
- ... |
IOLoop.initialized() method missing causing AttributeError in fork_processes
#### Description
When calling `fork_processes()`, the code fails with an AttributeError because `IOLoop.initialized()` method doesn't exist. The error message suggests using `initialize` instead, but this breaks the multiprocess functionalit... | diff --git a/tornado/process.py b/tornado/process.py
index 339ef65..8d31712 100644
--- b/tornado/process.py
+++ a/tornado/process.py
@@ -80,8 +80,9 @@ def _reseed_random() -> None:
_task_id = None
-def fork_processes(num_processes: Optional[int], max_restarts: Optional[int
- ]=None) ->int:
+def fork_processes(
... |
CallContext arguments and keywords incorrectly processed
#### Description
When creating a CallContext, the positional arguments are being reversed and keyword argument pairs are swapped, causing incorrect function call analysis.
#### Steps/Code to Reproduce
```python
import astroid
# Create a simple function call
... | diff --git a/astroid/context.py b/astroid/context.py
index d5efc9a..c663034 100644
--- b/astroid/context.py
+++ a/astroid/context.py
@@ -172,13 +172,13 @@ class CallContext:
keywords: list[Keyword] | None = None,
callee: InferenceResult | None = None,
):
- self.args = list(reversed(args)) ... |
### Issue with `readlink` Returning Bytes Instead of String
#### Describe the bug
The `readlink` method in the SFTP client is returning a byte string instead of a regular string. This behavior is causing issues when comparing the result of `readlink` with expected string values.
#### How to Reproduce
1. Create a sy... | diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py
index 066cd83..6fa9bbf 100644
--- b/paramiko/sftp_client.py
+++ a/paramiko/sftp_client.py
@@ -609,9 +609,12 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
if t != CMD_NAME:
raise SFTPError("Expected name response")
coun... |
HECClient initialization fails with UnboundLocalError when SSL error occurs
#### Description
When creating a HECClient instance and an SSL error occurs during initialization, the code raises an `UnboundLocalError: cannot access local variable 'session' where it is not associated with a value` instead of properly hand... | diff --git a/sunpy/net/helio/hec.py b/sunpy/net/helio/hec.py
index 8b84536..cd0da7b 100644
--- b/sunpy/net/helio/hec.py
+++ a/sunpy/net/helio/hec.py
@@ -67,16 +67,6 @@ class HECClient(BaseClient):
"""
def __init__(self, link=None):
- transport = Transport(session=session)
- if link is None:
- ... |
Crash when analysing qiskit
**Crash Report**
Running mypy on a library where typing has recently been added causes a crash while analyzing this line:
https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/circuit/library/blueprintcircuit.py#L72
**Traceback**
```
/q/qiskit-terra/qiskit/circuit/library/blue... | diff --git a/mypy/checker.py b/mypy/checker.py
index b8d5bbd..83c1baf 100644
--- b/mypy/checker.py
+++ a/mypy/checker.py
@@ -2148,7 +2148,7 @@ class TypeChecker(NodeVisitor[None], CheckerPluginInterface):
# `original_type` can be partial if (e.g.) it is originally an
# instance variable from an `__ini... |
File operations broken after recent changes
#### Description
File operations are failing with "File not open for writing" errors even when files are opened in write mode. This affects both SFTP operations and regular file handling.
#### Steps/Code to Reproduce
```python
import paramiko
# Basic file writing fails
w... | diff --git a/paramiko/file.py b/paramiko/file.py
index a36abb9..2c5e9a5 100644
--- b/paramiko/file.py
+++ a/paramiko/file.py
@@ -87,12 +87,12 @@ class BufferedFile(ClosingContextManager):
def flush(self):
"""
- Write out any data in the write buffer. This may do nothing if write
+ Write ou... |
# Bug in map_err method of Ok class
<!-- Summary. -->
I found a bug in the `map_err` method of the `Ok` class in the Result library. When trying to map errors, the method doesn't work correctly for successful results.
<!-- What you expected. -->
I expected the `map_err` method to return the original `Ok` value unch... | diff --git a/src/result/result.py b/src/result/result.py
index 8551239..d856270 100644
--- b/src/result/result.py
+++ a/src/result/result.py
@@ -180,7 +180,7 @@ class Ok(Generic[T]):
"""
The contained result is `Ok`, so return `Ok` with the original value
"""
- return op
+ retur... |
Graph initialization adds extra data point causing plot dimension mismatch
#### Description
When creating plots, the Graph class initialization is adding an unexpected data point that causes x and y arrays to have mismatched dimensions. This results in plotting errors when the data arrays don't align properly.
#### ... | diff --git a/src/cantools/subparsers/plot.py b/src/cantools/subparsers/plot.py
index c3d5890..380fc0f 100644
--- b/src/cantools/subparsers/plot.py
+++ a/src/cantools/subparsers/plot.py
@@ -795,9 +795,9 @@ class Graph:
__slots__ = ('plotted_signal', 'x', 'y')
def __init__(self):
- self.x = [0] # Chan... |
CSS selector matching broken for XML documents
#### Description
When parsing XML documents, CSS selectors are not matching elements correctly. The tag name matching appears to be completely broken, causing selectors to fail to find elements that should match.
#### Steps/Code to Reproduce
```python
import soupsieve ... | diff --git a/soupsieve/css_match.py b/soupsieve/css_match.py
index e52e42d..3f78cfa 100644
--- b/soupsieve/css_match.py
+++ a/soupsieve/css_match.py
@@ -548,7 +548,7 @@ class CSSMatch(_DocumentNav):
"""Get tag."""
name = self.get_tag_name(el)
- return util.upper(name) if name is not None and ... |
ArgReplacer logic inverted for positional vs keyword arguments
#### Description
The `ArgReplacer.replace()` method has inverted logic when determining whether an argument is passed positionally or by keyword. When an argument position exists and there are enough positional arguments, it should handle the positional c... | diff --git a/tornado/util.py b/tornado/util.py
index 2e5eee7..9e4caed 100644
--- b/tornado/util.py
+++ a/tornado/util.py
@@ -392,16 +392,17 @@ class ArgReplacer:
to ``kwargs`` and None will be returned as ``old_value``.
"""
if self.arg_pos is not None and len(args) > self.arg_pos:
- ... |
Dashboard._iter_panels() iterates over wrong collections
#### Description
The `_iter_panels()` method in the Dashboard class is iterating over the wrong collections. When trying to access panels from a dashboard, the method fails to properly iterate through both rows and panels.
#### Steps/Code to Reproduce
```pyth... | diff --git a/grafanalib/core.py b/grafanalib/core.py
index 79849fe..45b636b 100644
--- b/grafanalib/core.py
+++ a/grafanalib/core.py
@@ -1820,11 +1820,11 @@ class Dashboard(object):
uid = attr.ib(default=None)
def _iter_panels(self):
- for row in self.panels:
+ for row in self.rows:
... |
np.gradient returns all zeros when computing gradients
#### Description
When using autograd with `np.gradient`, the gradient computation returns an array of all zeros instead of the expected gradient values.
#### Steps/Code to Reproduce
```python
import autograd.numpy as np
from autograd import grad
# Simple 1D ca... | diff --git a/autograd/numpy/numpy_vjps.py b/autograd/numpy/numpy_vjps.py
index 08d4e1b..1fb50ab 100644
--- b/autograd/numpy/numpy_vjps.py
+++ a/autograd/numpy/numpy_vjps.py
@@ -313,10 +313,28 @@ def grad_gradient(ans, x, *vargs, **kwargs):
# accumulate gradient
out = anp.zeros(x_shape, dtype=x_dtype)
... |
Text extraction with layout produces IndexError when accessing empty textmap
When using `extract_text(layout=True)` on certain PDFs, the text extraction fails with an `IndexError: list index out of range` error. This appears to happen when the textmap becomes empty during processing.
#### Steps/Code to Reproduce
```... | diff --git a/pdfplumber/utils/text.py b/pdfplumber/utils/text.py
index 8edafa1..f649819 100644
--- b/pdfplumber/utils/text.py
+++ a/pdfplumber/utils/text.py
@@ -297,7 +297,7 @@ class WordMap:
if not len(self.tuples):
return TextMap(
_textmap,
- line_dir_render=line_... |
CharsetMatches.__len__ returns incorrect count
#### Description
The `CharsetMatches` class returns an incorrect length when calling `len()` on it. The length is off by one, returning one more than the actual number of results.
#### Steps/Code to Reproduce
```python
from charset_normalizer import from_bytes
# Test ... | diff --git a/charset_normalizer/models.py b/charset_normalizer/models.py
index 09492a9..b18cc51 100644
--- b/charset_normalizer/models.py
+++ a/charset_normalizer/models.py
@@ -268,7 +268,7 @@ class CharsetMatches:
raise KeyError
def __len__(self) -> int:
- return len(self._results) + 1
+ ... |
# ExceptionGroup.split() method returns incorrect results
### Description
I've discovered a bug in the `split()` method of `BaseExceptionGroup`. When trying to split an exception group based on a condition, the method is returning incorrect results - it seems to be mixing up the matching and non-matching exceptions.
... | diff --git a/src/exceptiongroup/_exceptions.py b/src/exceptiongroup/_exceptions.py
index a4a7ace..bf114d9 100644
--- b/src/exceptiongroup/_exceptions.py
+++ a/src/exceptiongroup/_exceptions.py
@@ -212,8 +212,8 @@ class BaseExceptionGroup(BaseException, Generic[_BaseExceptionT_co]):
]
):
condition... |
# Language detection fails after recent changes
## Description
I've discovered a critical issue with the language detection functionality. After some recent changes, the language detector is no longer correctly identifying languages.
## How to Reproduce
The following simple code fails to correctly identify language... | diff --git a/langdetect/utils/lang_profile.py b/langdetect/utils/lang_profile.py
index 118cff8..aeac463 100644
--- b/langdetect/utils/lang_profile.py
+++ a/langdetect/utils/lang_profile.py
@@ -27,13 +27,13 @@ class LangProfile(object):
def add(self, gram):
'''Add n-gram to profile.'''
- if gram i... |
Manpage update function not working correctly
I'm having issues with the manpage update functionality. When I try to update the manpage with version information, it's not behaving as expected.
#### Steps to Reproduce
```python
from qrcode.release import update_manpage
# This should update the manpage
update_manpage... | diff --git a/qrcode/release.py b/qrcode/release.py
index 208ac1e..fe56c0c 100644
--- b/qrcode/release.py
+++ a/qrcode/release.py
@@ -12,7 +12,7 @@ def update_manpage(data):
"""
Update the version in the manpage document.
"""
- if data["name"] == "qrcodes":
+ if data["name"] != "qrcode":
re... |
# Setting currency to None in MoneyFieldProxy.__set__ causes multiple issues
### Current problem
When setting a Money field value, the `__set__` method in `MoneyFieldProxy` has been rewritten and now has several issues:
1. It doesn't properly handle nullable currency fields when setting non-Money values
2. It fails ... | diff --git a/djmoney/models/fields.py b/djmoney/models/fields.py
index dc5f6ad..b780b47 100644
--- b/djmoney/models/fields.py
+++ a/djmoney/models/fields.py
@@ -105,34 +105,25 @@ class MoneyFieldProxy:
data[self.field.name] = self._money_from_obj(obj)
return data[self.field.name]
- def __set_... |
Non-FITS unit strings no longer trigger warnings
#### Description
When using unit strings that are not valid FITS units (like "Mx", "electron", or "DN / electron"), the Map class no longer emits warnings as expected. Previously, these invalid unit strings would trigger a `SunpyMetadataWarning` to inform users about t... | diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
index bdcac77..5914f8a 100644
--- b/sunpy/map/mapbase.py
+++ a/sunpy/map/mapbase.py
@@ -794,7 +794,27 @@ class GenericMap(NDData):
if unit_str.lower() in replacements:
unit_str = replacements[unit_str.lower()]
unit = u.Unit(unit_str... |
### Bug report
**Bug summary**
After the recent changes, certain client operations are not functioning as expected. Specifically, actions related to following/unfollowing lists and users, managing pinned lists, and interacting with tweets (like/unlike) are failing.
**Code for reproduction**
Here's a minimal example t... | diff --git a/tweepy/client.py b/tweepy/client.py
index d463129..3947a36 100644
--- b/tweepy/client.py
+++ a/tweepy/client.py
@@ -45,20 +45,20 @@ class BaseClient:
access_token=None, access_token_secret=None, *, return_type=Response,
wait_on_rate_limit=False
):
- self.bearer_token = consume... |
# Bug in random.sample inference in brain_random.py
I've found a bug in the inference of `random.sample` in the brain_random.py module. The issue affects how arguments are processed and how the function behaves when certain conditions are met.
## Issue Description
When using `random.sample` with a sequence and a len... | diff --git a/astroid/brain/brain_random.py b/astroid/brain/brain_random.py
index 48cc121..cd1d3dc 100644
--- b/astroid/brain/brain_random.py
+++ a/astroid/brain/brain_random.py
@@ -26,18 +26,11 @@ ACCEPTED_ITERABLES_FOR_SAMPLE = (List, Set, Tuple)
def _clone_node_with_lineno(node, parent, lineno):
- if hasattr(... |
Authorization code grant validation logic inverted causing authentication failures
#### Description
The authorization code grant validation is failing for valid requests and allowing invalid ones. When trying to authenticate with proper OAuth2 authorization code flow, the server returns errors for legitimate requests... | diff --git a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
index 09dc619..a77f210 100644
--- b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
+++ a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
@@ -45,8 +45,8 @@ def code_chal... |
Delta subtraction operation produces incorrect results
#### Description
When using the subtraction operator (`-`) with Delta objects, the operation returns incorrect results. The subtraction should reverse the delta operation, but instead it appears to be returning the negation of an incorrect result.
#### Steps/Cod... | diff --git a/deepdiff/delta.py b/deepdiff/delta.py
index 8bafc9a..1c51f12 100644
--- b/deepdiff/delta.py
+++ a/deepdiff/delta.py
@@ -204,11 +204,11 @@ class Delta:
def __rsub__(self, other):
if self._reversed_diff is None:
- self._reversed_diff = self.diff
+ self._reversed_diff = s... |
Binary or union type operands are swapped
#### Description
When using the binary or operator (`|`) to create union types in Python 3.10+, the operands are being swapped in the resulting UnionType. The left operand becomes the right operand and vice versa.
#### Steps/Code to Reproduce
```python
import astroid
code ... | diff --git a/astroid/nodes/_base_nodes.py b/astroid/nodes/_base_nodes.py
index 65b703d..706b6fa 100644
--- b/astroid/nodes/_base_nodes.py
+++ a/astroid/nodes/_base_nodes.py
@@ -477,7 +477,7 @@ class OperatorNode(NodeNG):
right: bases.UnionType | nodes.ClassDef | nodes.Const,
) -> Generator[InferenceResult... |
Deprecation decorator not working for default argument values
#### Description
The deprecation decorator for default argument values is not functioning correctly. When calling methods or constructors that should trigger deprecation warnings for default argument values, no warnings are being emitted.
#### Steps/Code ... | diff --git a/astroid/decorators.py b/astroid/decorators.py
index cd0f5a7..6a81a7f 100644
--- b/astroid/decorators.py
+++ a/astroid/decorators.py
@@ -128,9 +128,11 @@ if util.check_warnings_filter(): # noqa: C901
@functools.wraps(func)
def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _R:
... |
Environment Variable Impact on Config Evaluation
Description
It seems that recent changes to the environment variable handling have introduced unexpected behavior in the configuration evaluation process. Specifically, the use of environment variables like `MONAI_EVAL_EXPR` and `MONAI_ALLOW_MISSING_REFERENCE` is affec... | diff --git a/monai/bundle/config_item.py b/monai/bundle/config_item.py
index e5122bf..4b1d739 100644
--- b/monai/bundle/config_item.py
+++ a/monai/bundle/config_item.py
@@ -13,7 +13,6 @@ from __future__ import annotations
import ast
import inspect
-import os
import sys
import warnings
from abc import ABC, abstra... |
### Issue: Column Qualification and Annotation Errors
#### Description
After the recent changes, there seems to be an issue with how columns are being qualified and annotated, particularly when dealing with lateral views and unnest operations. The optimizer is not correctly resolving column types, leading to unexpect... | diff --git a/sqlglot/optimizer/qualify_columns.py b/sqlglot/optimizer/qualify_columns.py
index 3ab987d..a22bc8f 100644
--- b/sqlglot/optimizer/qualify_columns.py
+++ a/sqlglot/optimizer/qualify_columns.py
@@ -893,56 +893,52 @@ class Resolver:
}
return self._all_columns
- def get_source_column... |
JSOCClient.fetch() raises UnboundLocalError when processing empty responses
#### Description
When calling `fetch()` on an empty JSOC response, the method raises an `UnboundLocalError` because it tries to access a local variable `responses` that hasn't been defined yet.
#### Steps/Code to Reproduce
```python
from su... | diff --git a/sunpy/net/jsoc/jsoc.py b/sunpy/net/jsoc/jsoc.py
index f5506de..e563701 100644
--- b/sunpy/net/jsoc/jsoc.py
+++ a/sunpy/net/jsoc/jsoc.py
@@ -371,38 +371,6 @@ class JSOCClient(BaseClient):
@convert_row_to_table
def fetch(self, jsoc_response, path=None, progress=True, overwrite=False,
... |
Math plugin renders inline and block math incorrectly
#### Description
The math plugin is not rendering inline and block math expressions correctly. Block math expressions are being rendered with inline math formatting, and inline math expressions are being rendered with block math formatting.
#### Steps/Code to Rep... | diff --git a/src/mistune/plugins/math.py b/src/mistune/plugins/math.py
index 30eb349..af3f46b 100644
--- b/src/mistune/plugins/math.py
+++ a/src/mistune/plugins/math.py
@@ -27,7 +27,7 @@ def parse_inline_math(
def render_block_math(renderer: "BaseRenderer", text: str) -> str:
- return '<div class="math">\n' + t... |
PackageLoader.list_templates() returns incorrect path separators and sorting
#### Description
The `PackageLoader.list_templates()` method is returning template paths with incorrect path separators and wrong sorting order. Instead of using forward slashes as path separators (which is the expected format for template p... | diff --git a/src/jinja2/loaders.py b/src/jinja2/loaders.py
index 8ca32cb..fea4d5c 100644
--- b/src/jinja2/loaders.py
+++ a/src/jinja2/loaders.py
@@ -396,25 +396,28 @@ class PackageLoader(BaseLoader):
results: t.List[str] = []
if self._archive is None:
+ # Package is a directory.
... |
Task list items not rendering correctly
Description
It seems that the task list items are not rendering as expected after the recent changes. The checkboxes are not appearing correctly in the HTML output. This issue can be reproduced by using the `render_task_list_item` function to generate a task list item.
For ex... | diff --git a/src/mistune/plugins/task_lists.py b/src/mistune/plugins/task_lists.py
index 840088f..53c1bf7 100644
--- b/src/mistune/plugins/task_lists.py
+++ a/src/mistune/plugins/task_lists.py
@@ -15,20 +15,22 @@ def task_lists_hook(md: "Markdown", state: "BlockState") -> Iterable[Dict[str, A
return _rewrite_all_l... |
BitString.fromHexString returns raw input instead of processed value
#### Description
When calling `BitString.fromHexString()`, the method returns the raw input string instead of the properly processed BitString value. This affects all BitString operations that rely on hex string conversion.
#### Steps/Code to Repro... | diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py
index 9aff5e6..79503c2 100644
--- b/pyasn1/type/univ.py
+++ a/pyasn1/type/univ.py
@@ -569,11 +569,6 @@ class BitString(base.SimpleAsn1Type):
value: :class:`str`
Text string like 'DEADBEEF'
"""
-
- return value
-
- if not... |
Presentation properties returning wrong values
I'm having issues with the Presentation class where some properties are returning incorrect values or behaving unexpectedly.
#### Steps/Code to Reproduce
```python
from pptx import Presentation
# Create or load a presentation
prs = Presentation()
# Try to access core ... | diff --git a/src/pptx/presentation.py b/src/pptx/presentation.py
index a41bfd5..66fda11 100644
--- b/src/pptx/presentation.py
+++ a/src/pptx/presentation.py
@@ -31,7 +31,7 @@ class Presentation(PartElementProxy):
Provides read/write access to the Dublin Core document properties for the presentation.
... |
Error handling broken for name analysis in Python parser
#### Description
The Python error detection system is producing incorrect results when analyzing variable names in different contexts. Names in global statements, nonlocal statements, and function definitions are being misclassified, leading to improper error r... | diff --git a/parso/python/errors.py b/parso/python/errors.py
index 09c5047..43c4434 100644
--- b/parso/python/errors.py
+++ a/parso/python/errors.py
@@ -269,20 +269,20 @@ class _Context:
def add_name(self, name):
parent_type = name.parent.type
- if parent_type == 'global_stmt':
+ if parent... |
# tap() function in debug.py is broken and returns None instead of the input value
## Description
The `tap()` function in debug.py is not working as expected. It's supposed to print a value and return it, but it's returning `None` instead and the printing functionality is also broken.
## Steps to Reproduce
```pytho... | diff --git a/funcy/debug.py b/funcy/debug.py
index 62ef1bc..a004d44 100644
--- b/funcy/debug.py
+++ a/funcy/debug.py
@@ -23,10 +23,10 @@ REPR_LEN = 25
def tap(x, label=None):
"""Prints x and then returns it."""
if label:
- print('%s: %s' % (x, label))
+ print('%s: %s' % (label, x))
else:
-... |
Choice.__contains__ returns incorrect results
#### Description
The `__contains__` method in the Choice class is returning incorrect boolean values when checking if a component name exists in the choice.
#### Steps/Code to Reproduce
```python
from pyasn1.type import univ, namedtype
# Create a Choice with named comp... | diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py
index 9aff5e6..b805e4d 100644
--- b/pyasn1/type/univ.py
+++ a/pyasn1/type/univ.py
@@ -3033,8 +3033,8 @@ class Choice(Set):
def __contains__(self, key):
if self._currentIdx is None:
- return True
- return key != self.componentType[s... |
# to_snake function breaks when converting camelCase to snake_case
## Description
The `to_snake` function in `pydantic/alias_generators.py` is not correctly converting camelCase strings to snake_case in certain scenarios. The function is supposed to handle various naming conventions and convert them to snake_case, bu... | diff --git a/pydantic/alias_generators.py b/pydantic/alias_generators.py
index 0b7653f..bccf31b 100644
--- b/pydantic/alias_generators.py
+++ a/pydantic/alias_generators.py
@@ -49,13 +49,14 @@ def to_snake(camel: str) -> str:
Returns:
The converted string in snake_case.
"""
- # `(?<=[a-zA-Z])(?=[0... |
PilImage.new_image method missing causes AttributeError when creating QR codes
When trying to create QR codes using the PIL image factory, I'm getting an AttributeError because the `new_image` method is missing from the PilImage class.
#### Steps/Code to Reproduce
```python
import qrcode
# Basic QR code creation fa... | diff --git a/qrcode/image/pil.py b/qrcode/image/pil.py
index 57ee13a..67c3925 100644
--- b/qrcode/image/pil.py
+++ a/qrcode/image/pil.py
@@ -9,6 +9,40 @@ class PilImage(qrcode.image.base.BaseImage):
kind = "PNG"
+ def new_image(self, **kwargs):
+ if not Image:
+ raise ImportError("PIL libr... |
# MoneyWidget.decompress() returns values in wrong order
## Description
I found a bug in the MoneyWidget's decompress method. When using a form with a Money field, the currency and amount values are swapped, causing validation issues and incorrect display of default currency.
## To Reproduce
Create a form with a Mo... | diff --git a/djmoney/forms/widgets.py b/djmoney/forms/widgets.py
index 3217654..9d46201 100644
--- b/djmoney/forms/widgets.py
+++ a/djmoney/forms/widgets.py
@@ -25,6 +25,6 @@ class MoneyWidget(MultiWidget):
def decompress(self, value):
if value is not None:
if isinstance(value, (list, tuple))... |
MultipleInvalid constructor logic reversed when errors is None
#### Description
When creating a `MultipleInvalid` exception with `errors=None`, the constructor incorrectly assigns `None` to `self.errors` instead of an empty list. This causes `IndexError: list index out of range` when trying to access error details.
... | diff --git a/voluptuous/error.py b/voluptuous/error.py
index 9dab943..eeed54d 100644
--- b/voluptuous/error.py
+++ a/voluptuous/error.py
@@ -59,7 +59,7 @@ class Invalid(Error):
class MultipleInvalid(Invalid):
def __init__(self, errors: typing.Optional[typing.List[Invalid]] = None) -> None:
- self.errors ... |
# [Bug]: Feedback mode in Synthesizer not working when generating examples
## Description
I found a bug in the `Synthesizer` class in the experimental synthesizer module. When using the feedback mode with `num_example_for_feedback` set, the feedback functionality is not working at all.
The issue occurs in the `gener... | diff --git a/dspy/experimental/synthesizer/synthesizer.py b/dspy/experimental/synthesizer/synthesizer.py
index e1184c5..b3b2d03 100644
--- b/dspy/experimental/synthesizer/synthesizer.py
+++ a/dspy/experimental/synthesizer/synthesizer.py
@@ -170,7 +170,7 @@ class Synthesizer:
if self.config.num_example_for_op... |
# AUTOSAR End-to-End protection CRC calculation broken
I found an issue with the AUTOSAR End-to-End protection CRC calculation in the library. Both Profile2 and Profile5 CRC calculations are not working correctly.
## Profile2 Issue
When calculating the CRC for Profile2, the result is incorrect:
```python
db = canto... | diff --git a/src/cantools/autosar/end_to_end.py b/src/cantools/autosar/end_to_end.py
index 2ce4ae7..ea22fe9 100644
--- b/src/cantools/autosar/end_to_end.py
+++ a/src/cantools/autosar/end_to_end.py
@@ -37,20 +37,21 @@ def compute_profile2_crc(payload: bytes,
assert msg.autosar.e2e is not None
assert ms... |
PEP8 normalizer swaps error codes for 'not in' and 'is not' checks
#### Description
The PEP8 normalizer is incorrectly assigning error codes when checking for negated membership and identity tests. When encountering `not in` expressions, it reports error code 714 (which should be for `is not`), and when encountering ... | diff --git a/parso/python/pep8.py b/parso/python/pep8.py
index c492dae..6c4039a 100644
--- b/parso/python/pep8.py
+++ a/parso/python/pep8.py
@@ -710,9 +710,9 @@ class PEP8Normalizer(ErrorFinder):
comparison = leaf.parent
if comparison.type == 'comparison' and comparison.parent.type == 'not_tes... |
tz_isoformat returns incorrect timezone offset format
#### Description
The `tz_isoformat` function is returning timezone offsets with hours and minutes swapped in the output format.
#### Steps/Code to Reproduce
```python
from datetime import datetime, timezone, timedelta
from isodate.isotzinfo import tz_isoformat
... | diff --git a/src/isodate/isotzinfo.py b/src/isodate/isotzinfo.py
index f7efb86..29612d1 100644
--- b/src/isodate/isotzinfo.py
+++ a/src/isodate/isotzinfo.py
@@ -80,14 +80,14 @@ def tz_isoformat(dt: datetime, format: str = "%Z") -> str:
seconds = tdelta.days * 24 * 60 * 60 + tdelta.seconds
sign = ((seconds < 0... |
Style color parsing broken for hex colors and CSS functions
#### Description
When using styles with hex color codes or CSS functions like `var()` and `calc()`, the color parsing is producing incorrect output. Hex colors are being truncated and CSS functions are being mangled.
#### Steps/Code to Reproduce
```python
... | diff --git a/pygments/style.py b/pygments/style.py
index 449522c..8141090 100644
--- b/pygments/style.py
+++ a/pygments/style.py
@@ -69,14 +69,14 @@ class StyleMeta(type):
if text[0:1] == '#':
col = text[1:]
if len(col) == 6:
- return col[0:3] # Truncat... |
# Bug in WebApplicationClient constructor and prepare_request_uri method
## Description
I found a bug in the `WebApplicationClient` class in `oauthlib/oauth2/rfc6749/clients/web_application.py`. The constructor and `prepare_request_uri` method have issues that cause incorrect behavior.
The constructor is incorrectly... | diff --git a/oauthlib/oauth2/rfc6749/clients/web_application.py b/oauthlib/oauth2/rfc6749/clients/web_application.py
index 3bf94c4..90a0a38 100644
--- b/oauthlib/oauth2/rfc6749/clients/web_application.py
+++ a/oauthlib/oauth2/rfc6749/clients/web_application.py
@@ -37,20 +37,68 @@ class WebApplicationClient(Client):
... |
Categorical comparison with scalar values produces incorrect results
#### Description
When comparing a Categorical array with scalar values that are in the categories, the comparison logic appears to be inverted. Comparisons that should return `True` are returning `False` and vice versa.
#### Steps/Code to Reproduce... | diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py
index 0ce7007..f0ee618 100644
--- b/pandas/core/arrays/categorical.py
+++ a/pandas/core/arrays/categorical.py
@@ -157,6 +157,20 @@ def _cat_compare_op(op):
return ret
if hashable:
+ if other in self.cat... |
# Downloader cog incorrectly processes repo and module information
## Description
I've discovered an issue with the downloader cog where it's not correctly processing repository and module information. When trying to install a cog from a repository, the cog information is being incorrectly parsed and stored.
Here's ... | diff --git a/redbot/cogs/downloader/info_schemas.py b/redbot/cogs/downloader/info_schemas.py
index 8033d13..5c46094 100644
--- b/redbot/cogs/downloader/info_schemas.py
+++ a/redbot/cogs/downloader/info_schemas.py
@@ -52,10 +52,10 @@ def ensure_tuple_of_str(
def ensure_str(info_file: Path, key_name: str, value: Uni... |
QR code pattern generation produces incorrect output
#### Description
When generating QR codes, the positioning patterns appear to be malformed, resulting in incorrect visual output when printed to terminal or converted to ASCII representation.
#### Steps/Code to Reproduce
```python
import qrcode
import io
# Creat... | diff --git a/qrcode/main.py b/qrcode/main.py
index 46116b5..da46fdb 100644
--- b/qrcode/main.py
+++ a/qrcode/main.py
@@ -412,7 +412,7 @@ class QRCode(Generic[GenericImage]):
row = pos[i]
for j in range(len(pos)):
- col = pos[i] # Changed 'col = pos[j]' to 'col = pos[i]'
+ ... |
Discriminated union schema generation broken after recent changes
#### Description
After some recent changes, discriminated union schemas are not being generated correctly. The schema build process appears to be incomplete, causing validation to fail unexpectedly.
#### Steps/Code to Reproduce
```python
from typing ... | diff --git a/pydantic/_internal/_discriminated_union.py b/pydantic/_internal/_discriminated_union.py
index 5dd6fda..dc743f9 100644
--- b/pydantic/_internal/_discriminated_union.py
+++ a/pydantic/_internal/_discriminated_union.py
@@ -195,6 +195,9 @@ class _ApplyInferredDiscriminator:
# Reverse the choices list ... |
Statement.get_type() always returns 'UNKNOWN'
#### Description
The `get_type()` method on SQL statements is not working correctly and always returns 'UNKNOWN' regardless of the actual SQL statement type.
#### Steps/Code to Reproduce
```python
import sqlparse
# Simple SELECT statement
sql = 'SELECT * FROM foo'
pars... | diff --git a/sqlparse/sql.py b/sqlparse/sql.py
index 1037375..ddf8ea6 100644
--- b/sqlparse/sql.py
+++ a/sqlparse/sql.py
@@ -419,10 +419,32 @@ class Statement(TokenList):
are ignored.
"""
token = self.token_first(skip_cm=True)
+ if token is None:
+ # An "empty" statement tha... |
MultiIndex.sortlevel() returns incorrect results when sort_remaining=False
#### Description
When calling `sortlevel()` on a MultiIndex with `sort_remaining=False`, the method returns incorrect sorting results. The issue appears to affect the sorting logic when only specific levels should be sorted without sorting the... | diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py
index 79eb1b6..c9009dd 100644
--- b/pandas/core/indexes/multi.py
+++ a/pandas/core/indexes/multi.py
@@ -2801,11 +2801,11 @@ class MultiIndex(Index):
if not len(level) == len(ascending):
raise ValueError("level must ha... |
SectionWrapper constructor arguments swapped causing AttributeError
When creating a SectionWrapper instance, the config and name arguments appear to be swapped in the constructor, causing AttributeError when trying to access section properties.
#### Steps/Code to Reproduce
```python
from iniconfig import IniConfig
... | diff --git a/src/iniconfig/__init__.py b/src/iniconfig/__init__.py
index 3c40bc9..7f42fb9 100644
--- b/src/iniconfig/__init__.py
+++ a/src/iniconfig/__init__.py
@@ -37,8 +37,8 @@ class SectionWrapper:
name: Final[str]
def __init__(self, config: IniConfig, name: str) -> None:
- self.config = name
- ... |
BaseEndpoint constructor swaps request_validator and token_generator parameters
#### Description
The BaseEndpoint constructor incorrectly assigns the parameters - the request_validator parameter gets assigned to token_generator and vice versa. This causes OAuth1 endpoints to fail validation since they can't access th... | diff --git a/oauthlib/oauth1/rfc5849/endpoints/base.py b/oauthlib/oauth1/rfc5849/endpoints/base.py
index 8d3d89c..bde633a 100644
--- b/oauthlib/oauth1/rfc5849/endpoints/base.py
+++ a/oauthlib/oauth1/rfc5849/endpoints/base.py
@@ -21,8 +21,8 @@ from .. import (
class BaseEndpoint:
def __init__(self, request_valid... |
#### Description
The optimizer functions are not working correctly after recent changes. When running SQL optimization, several functions including `isolate_table_selects` and `optimize_joins` are producing incorrect results.
#### Steps/Code to Reproduce
```python
import sqlglot
from sqlglot import optimizer
# Exam... | diff --git a/sqlglot/optimizer/isolate_table_selects.py b/sqlglot/optimizer/isolate_table_selects.py
index a6524b8..7b4facd 100644
--- b/sqlglot/optimizer/isolate_table_selects.py
+++ a/sqlglot/optimizer/isolate_table_selects.py
@@ -5,6 +5,7 @@ from sqlglot.schema import ensure_schema
def isolate_table_selects(exp... |
# pipdeptree text rendering broken with Unicode characters
I'm using pipdeptree to visualize my package dependencies, but I've noticed that the text rendering is broken when using Unicode characters.
## Reproduction
I have a simple dependency tree with several packages. When I try to render it with Unicode character... | diff --git a/src/pipdeptree/_render/text.py b/src/pipdeptree/_render/text.py
index efa5a02..6a7eed3 100644
--- b/src/pipdeptree/_render/text.py
+++ a/src/pipdeptree/_render/text.py
@@ -50,8 +50,8 @@ def _render_text_with_unicode(
use_bullets = not frozen
def aux( # noqa: PLR0913, PLR0917
- node: Dis... |
# QRCode initialization doesn't validate image_factory properly
## Description
There appears to be an issue with the QRCode class initialization where it no longer properly validates the image_factory parameter. Previously, the code would check if the provided image_factory is a subclass of BaseImage, but this valida... | diff --git a/qrcode/main.py b/qrcode/main.py
index 46116b5..f2a5e93 100644
--- b/qrcode/main.py
+++ a/qrcode/main.py
@@ -78,19 +78,29 @@ class QRCode(Generic[GenericImage]):
modules: ModulesType
_version: Optional[int] = None
- def __init__(self, version=None, error_correction=constants.ERROR_CORRECT_M,
... |
# Downloader cog crashes when trying to serialize installed modules
## Description
I've found an issue with the downloader cog where it crashes when trying to serialize installed modules. This happens when the bot tries to save information about installed cogs.
## Steps to reproduce
1. Install a cog using the downl... | diff --git a/redbot/cogs/downloader/info_schemas.py b/redbot/cogs/downloader/info_schemas.py
index 8033d13..df13705 100644
--- b/redbot/cogs/downloader/info_schemas.py
+++ a/redbot/cogs/downloader/info_schemas.py
@@ -153,9 +153,18 @@ def ensure_bool(
def ensure_required_cogs_mapping(
info_file: Path, key_name: st... |
# Invalid style value not raising error in set_style method
When setting an invalid style value using the `set_style` method, the method no longer raises a ValueError as expected. This behavior is inconsistent with previous versions.
## Description
The `set_style` method should validate that the provided style is a ... | diff --git a/src/prettytable/prettytable.py b/src/prettytable/prettytable.py
index 818a520..56c014b 100644
--- b/src/prettytable/prettytable.py
+++ a/src/prettytable/prettytable.py
@@ -1441,12 +1441,6 @@ class PrettyTable:
##############################
def set_style(self, style: TableStyle) -> None:
- ... |
Objective-C lexer incorrectly identifies C code as Logos
#### Description
The Objective-C lexer is incorrectly identifying plain C code as Logos lexer instead of C lexer. This affects code analysis and syntax highlighting for C files.
#### Steps/Code to Reproduce
```python
from pygments.lexers import guess_lexer
#... | diff --git a/pygments/lexers/objective.py b/pygments/lexers/objective.py
index b37a9d4..1908fce 100644
--- b/pygments/lexers/objective.py
+++ a/pygments/lexers/objective.py
@@ -26,11 +26,18 @@ def objective(baselexer):
extensions.
"""
- _oc_keywords = re.compile(r'@(?:end|implementation|protocaol)')
-
- ... |
HeaderDict.append() swaps key and value parameters
Description
When using HeaderDict.append(), the key and value parameters are being swapped internally, causing headers to be stored with incorrect keys and values.
Steps/Code to Reproduce
```python
from bottle import HeaderDict
# Create a HeaderDict and append a h... | diff --git a/bottle.py b/bottle.py
index 286b5bc..839e06d 100755
--- b/bottle.py
+++ a/bottle.py
@@ -2261,7 +2261,7 @@ class HeaderDict(MultiDict):
self.dict[_hkey(key)] = [_hval(value)]
def append(self, key, value):
- self.dict.setdefault(_hkey(value), []).append(_hval(key))
+ self.dict.s... |
# Frequency comparison functions not working correctly
### Problem
I'm having an issue with the frequency comparison functions in pandas. The `is_subperiod` and `is_superperiod` functions don't seem to be working correctly together.
When I try to check if one period is a subperiod of another, I'm getting inconsistent... | diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py
index 88ea1bf..5ceefe1 100644
--- b/pandas/tseries/frequencies.py
+++ a/pandas/tseries/frequencies.py
@@ -458,6 +458,7 @@ def is_subperiod(source, target) -> bool:
if target is None or source is None:
return False
source = _ma... |
NameError when using Annotated fields with FieldInfo
#### Description
When using `Annotated` type hints with `FieldInfo` instances, a `NameError` occurs because `annotation_metadata` is referenced before being defined.
#### Steps/Code to Reproduce
```python
from typing import Annotated
from pydantic import BaseMode... | diff --git a/pydantic/fields.py b/pydantic/fields.py
index 7081292..0b3668c 100644
--- b/pydantic/fields.py
+++ a/pydantic/fields.py
@@ -399,6 +399,10 @@ class FieldInfo(_repr.Representation):
annotation = typing_extensions.get_args(annotation)[0]
if isinstance(default, FieldInfo):
+ ... |
BottleParser cookie parsing broken after recent changes
#### Description
The BottleParser is no longer able to parse cookies from requests. When trying to access cookies through the parser, it returns an empty dictionary instead of the actual cookie values.
#### Steps/Code to Reproduce
```python
import bottle
from ... | diff --git a/src/webargs/bottleparser.py b/src/webargs/bottleparser.py
index a2bf7af..f6f301f 100644
--- b/src/webargs/bottleparser.py
+++ a/src/webargs/bottleparser.py
@@ -55,7 +55,7 @@ class BottleParser(core.Parser[bottle.Request]):
def load_querystring(self, req, schema):
"""Return query params from... |
Progress bar rendering broken after recent changes
Description
The progress bar animations are not rendering correctly. When creating progress bars with various character sets and configurations, the output doesn't match expected patterns.
Steps/Code to Reproduce
```python
from alive_progress.animations.bars import... | diff --git a/alive_progress/animations/bars.py b/alive_progress/animations/bars.py
index e2e5359..2ac9c11 100644
--- b/alive_progress/animations/bars.py
+++ a/alive_progress/animations/bars.py
@@ -40,17 +40,17 @@ def bar_factory(chars=None, *, tip=None, background=None, borders=None, errors=N
if chars:
... |
IRCFormatter line numbers appear at wrong position when linenos=True
#### Description
When using the IRCFormatter with `linenos=True`, the line numbers are being written at the end of the output instead of at the beginning of each line. This causes the formatted output to have incorrect line number positioning.
####... | diff --git a/pygments/formatters/irc.py b/pygments/formatters/irc.py
index a1e3979..26ca531 100644
--- b/pygments/formatters/irc.py
+++ a/pygments/formatters/irc.py
@@ -133,6 +133,7 @@ class IRCFormatter(Formatter):
outfile.write("%04d: " % self._lineno)
def format_unencoded(self, tokensource, outfi... |
DeepDiff incorrectly handles basic hashable type detection for iterables
#### Description
When comparing iterables, DeepDiff's `_all_values_basic_hashable` method returns incorrect results, causing unexpected behavior in difference detection. The method appears to have inverted logic that returns `True` when it shoul... | diff --git a/deepdiff/diff.py b/deepdiff/diff.py
index 76f186b..15022d5 100755
--- b/deepdiff/diff.py
+++ a/deepdiff/diff.py
@@ -868,16 +868,16 @@ class DeepDiff(ResultDict, SerializationMixin, DistanceMixin, Base):
def _all_values_basic_hashable(self, iterable):
"""
Are all items basic hashable ... |
# yamllint disable directive not working correctly
I'm having an issue with the yamllint disable directive not working as expected. When I try to disable rules using inline comments, they're not being properly recognized.
## Steps to reproduce
1. Create a YAML file with a directive to disable rules:
```yaml
---
# y... | diff --git a/yamllint/linter.py b/yamllint/linter.py
index a2faa06..ddc5f33 100644
--- b/yamllint/linter.py
+++ a/yamllint/linter.py
@@ -115,10 +115,10 @@ def get_cosmetic_problems(buffer, conf, filepath):
items = comment[23:].rstrip().split(' ')
rules = [item[5:] for item in items][1:... |
elevation_angle function returns incorrect values when radians parameter is swapped
#### Description
The `elevation_angle` function in the geo module appears to be returning incorrect angle values. When calculating elevation angles between two locations, the function returns negative degrees when it should return pos... | diff --git a/test.py b/test.py
index 7dd6f44..9b74e4d 100644
--- b/test.py
+++ a/test.py
@@ -1262,10 +1262,10 @@ class GPXTests(mod_unittest.TestCase):
loc2 = mod_geo.Location(0, 1)
loc1.elevation = 100
- loc2.elevation = loc1.elevation - loc1.distance_2d(loc2) # type: ignore
+ loc2.el... |
Environment variable parsing fails for nested structs with custom parsers
#### Description
When parsing environment variables into nested structs that have custom parsers or special field types, the parsing process is not working correctly. Fields that should be populated from environment variables are remaining empt... | diff --git a/env.go b/env.go
index c928b66..848756d 100644
--- b/env.go
+++ a/env.go
@@ -398,18 +398,19 @@ func doParseField(
return nil
}
+ if err := processField(refField, refTypeField, opts, params); err != nil {
+ return err
+ }
+
if params.Init && isInvalidPtr(refField) {
refField.Set(reflect.New(refF... |
# update_many() not updating all rows correctly
I've found an issue with the `update_many()` method in the Table class. It seems to be incorrectly processing rows when updating multiple records.
## Description
When using `update_many()` to update multiple rows in a table, not all rows are being updated correctly. Th... | diff --git a/dataset/table.py b/dataset/table.py
index 732964c..60be388 100644
--- b/dataset/table.py
+++ a/dataset/table.py
@@ -239,7 +239,7 @@ class Table(object):
chunk.append(row)
# Update when chunk_size is fulfilled or this is the last row
- if len(chunk) == chunk_size or in... |
Option parsing broken for commands with arguments
#### Description
After a recent change, option parsing seems to be completely broken. Commands that previously worked now fail to parse their arguments correctly, causing widespread test failures.
#### Steps/Code to Reproduce
```python
import click
@click.command()... | diff --git a/src/click/parser.py b/src/click/parser.py
index a8b7d26..b2c64d8 100644
--- b/src/click/parser.py
+++ a/src/click/parser.py
@@ -433,8 +433,8 @@ class _OptionParser:
) -> t.Any:
nargs = option.nargs
- if len(state.rargs) <= nargs: # Change from < to <=
- if not option.obj.... |
Option default value handling broken for non-boolean flags
#### Description
When using non-boolean flags (like `flag_value` options), the default value handling is not working correctly. The `get_default` method is returning unexpected values instead of the proper defaults.
#### Steps/Code to Reproduce
```python
im... | diff --git a/src/click/core.py b/src/click/core.py
index abe9fa9..7bc58ac 100644
--- b/src/click/core.py
+++ a/src/click/core.py
@@ -2819,15 +2819,18 @@ class Option(Parameter):
def get_default(
self, ctx: Context, call: bool = True
) -> t.Any | t.Callable[[], t.Any] | None:
+ # If we're a non... |
Time parsing broken after recent changes
#### Description
ISO 8601 time parsing is completely broken. Basic time strings like "23:20:50" and "232050" are failing to parse correctly.
#### Steps/Code to Reproduce
```python
from isodate import parse_time
# These should work but don't
parse_time("23:20:50")
parse_time... | diff --git a/src/isodate/isotime.py b/src/isodate/isotime.py
index 78b4de2..62e970f 100644
--- b/src/isodate/isotime.py
+++ a/src/isodate/isotime.py
@@ -25,33 +25,46 @@ def build_time_regexps() -> list[re.Pattern[str]]:
The regular expressions are compiled and stored in TIME_REGEX_CACHE
for later reuse.
... |
Cache delete operation not updating hit statistics
#### Description
When deleting entries from the cache, the delete hit statistics are not being properly updated. The `delhit()` method call appears to be missing from the delete operation, causing cache statistics to be inaccurate.
#### Steps/Code to Reproduce
```g... | diff --git a/shard.go b/shard.go
index 4f03b53..fd3ff4b 100644
--- b/shard.go
+++ a/shard.go
@@ -260,15 +260,16 @@ func (s *cacheShard) del(hashedKey uint64) error {
return err
}
+ delete(s.hashmap, hashedKey)
+ s.onRemove(wrappedEntry, Deleted)
if s.statsEnabled {
delete(s.hashmapStats, hashedKey)
... |
Variable reference lookup returns empty string instead of None when not found
#### Description
When looking up variable references in nested scopes, the `find_ref` method now returns an empty string `""` instead of `None` when a reference is not found anywhere in the scope chain. This breaks template compilation as t... | diff --git a/src/jinja2/idtracking.py b/src/jinja2/idtracking.py
index d6cb635..f01da27 100644
--- b/src/jinja2/idtracking.py
+++ a/src/jinja2/idtracking.py
@@ -66,13 +66,13 @@ class Symbols:
return None
def find_ref(self, name: str) -> t.Optional[str]:
+ if name in self.refs:
+ return... |
# Missing `repo` parameter in `get_fs_config` function causes errors when accessing remote storage
When trying to access remote storage configurations, I'm getting errors because the `get_fs_config` function is missing a required parameter.
## Steps to reproduce
1. Create a DVC project with a remote configuration
2.... | diff --git a/dvc/fs/__init__.py b/dvc/fs/__init__.py
index cf3998a..719c553 100644
--- b/dvc/fs/__init__.py
+++ a/dvc/fs/__init__.py
@@ -96,7 +96,7 @@ def parse_external_url(url, fs_config=None, config=None):
return fs, fs_path
-def get_fs_config(repo, config, **kwargs):
+def get_fs_config(config, **kwargs):
... |
`--diff` flag removed but still referenced in help text
#### Description
The `--diff` flag has been removed from the CLI but users trying to use it get an unrecognized argument error. The functionality to compare stubs generated with and without existing annotations is no longer available.
#### Steps/Code to Reprodu... | diff --git a/monkeytype/cli.py b/monkeytype/cli.py
index 990079d..5c1d3b7 100644
--- b/monkeytype/cli.py
+++ a/monkeytype/cli.py
@@ -5,6 +5,7 @@
# LICENSE file in the root directory of this source tree.
import argparse
import collections
+import difflib
import importlib
import inspect
import os
@@ -224,12 +225,43... |
# Context manager in BaseRetrying.__iter__ not working correctly
## Description
When using the context manager pattern with the `Retrying` class, the code fails to work correctly. The issue is in the `__iter__` method of `BaseRetrying` class where the initialization and state management is incorrect.
## Steps to rep... | diff --git a/tenacity/__init__.py b/tenacity/__init__.py
index 72eba04..6584c29 100644
--- b/tenacity/__init__.py
+++ a/tenacity/__init__.py
@@ -436,6 +436,9 @@ class BaseRetrying(ABC):
self._add_action_func(lambda rs: DoSleep(rs.upcoming_sleep))
def __iter__(self) -> t.Generator[AttemptManager, None, N... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.