Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions .cspell.dict/python-more.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
abiflags
abstractmethods
addcompare
aenter
aexit
aiter
altzone
anext
anextawaitable
annotationlib
Expand All @@ -24,6 +26,7 @@ breakpointhook
cformat
chunksize
classcell
classmethods
closefd
closesocket
codepoint
Expand All @@ -32,6 +35,8 @@ codesize
contextvar
cpython
cratio
ctype
ctypes
dealloc
debugbuild
decompressor
Expand Down Expand Up @@ -74,6 +79,8 @@ fstring
fstrings
ftruncate
genexpr
genexpressions
getargs
getattro
getcodesize
getdefaultencoding
Expand All @@ -83,14 +90,17 @@ getformat
getframe
getframemodulename
getnewargs
getopt
getpip
getrandom
getrecursionlimit
getrefcount
getsizeof
getswitchinterval
getweakref
getweakrefcount
getweakrefs
getweakrefs
Comment on lines 102 to +103
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove duplicate entry.

The term "getweakrefs" appears twice on consecutive lines. Dictionary files should contain unique entries only.

🔧 Proposed fix
 getweakrefcount
-getweakrefs
 getweakrefs
 getwindowsversion
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
getweakrefs
getweakrefs
getweakrefcount
getweakrefs
getwindowsversion
🤖 Prompt for AI Agents
In @.cspell.dict/python-more.txt around lines 102 - 103, The dictionary contains
a duplicate entry "getweakrefs" on consecutive lines; remove the redundant line
so only a single "getweakrefs" entry remains (i.e., keep one occurrence and
delete the duplicate to ensure unique entries).

getwindowsversion
gmtoff
groupdict
Expand All @@ -103,8 +113,12 @@ idxs
impls
indexgroup
infj
inittab
Inittab
instancecheck
instanceof
interpchannels
interpqueues
irepeat
isabstractmethod
isbytes
Expand All @@ -129,6 +143,7 @@ listcomp
longrange
lvalue
mappingproxy
markupbase
maskpri
maxdigits
MAXGROUPS
Expand All @@ -144,6 +159,7 @@ mformat
mro
mros
multiarch
mymodule
namereplace
nanj
nbytes
Expand All @@ -156,6 +172,7 @@ nlocals
NOARGS
nonbytes
Nonprintable
onceregistry
origname
ospath
pendingcr
Expand All @@ -170,7 +187,10 @@ profilefunc
pycache
pycodecs
pycs
pydatetime
pyexpat
pyio
pymain
PYTHONAPI
PYTHONBREAKPOINT
PYTHONDEBUG
Expand Down Expand Up @@ -220,10 +240,13 @@ scproxy
seennl
setattro
setcomp
setprofileallthreads
setrecursionlimit
setswitchinterval
settraceallthreads
showwarnmsg
signum
sitebuiltins
slotnames
STACKLESS
stacklevel
Expand All @@ -232,14 +255,17 @@ startpos
subclassable
subclasscheck
subclasshook
subclassing
suboffset
suboffsets
SUBPATTERN
subpatterns
sumprod
surrogateescape
surrogatepass
sysconf
sysconfigdata
sysdict
sysvars
teedata
thisclass
Expand All @@ -266,35 +292,10 @@ warnopts
weaklist
weakproxy
weakrefs
weakrefset
winver
withdata
xmlcharrefreplace
xoptions
xopts
yieldfrom
addcompare
altzone
classmethods
ctype
ctypes
genexpressions
getargs
getopt
getweakref
getweakrefs
inittab
Inittab
interpchannels
interpqueues
markupbase
mymodule
pydatetime
pyio
pymain
setprofileallthreads
settraceallthreads
sitebuiltins
subclassing
subpatterns
sysdict
weakrefset
1 change: 0 additions & 1 deletion Lib/test/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ def test_lazy_imports(self):

class StartupImportTests(unittest.TestCase):

@unittest.expectedFailure # TODO: RUSTPYTHON
@support.requires_subprocess()
def test_startup_imports(self):
# Get sys.path in isolated mode (python3 -I)
Expand Down
26 changes: 0 additions & 26 deletions Lib/test/test_warnings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,6 @@ class CWarnTests(WarnTests, unittest.TestCase):

# As an early adopter, we sanity check the
# test.import_helper.import_fresh_module utility function
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: 'function' object has unexpected attribute '__code__'
def test_accelerated(self):
self.assertIsNot(original_warnings, self.module)
self.assertNotHasAttr(self.module.warn, '__code__')
Expand Down Expand Up @@ -1012,7 +1011,6 @@ def test_showwarning_missing(self):
result = stream.getvalue()
self.assertIn(text, result)

@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: module 'warnings' has no attribute '_showwarnmsg'. Did you mean: 'showwarning'?
def test_showwarnmsg_missing(self):
# Test that _showwarnmsg() missing is okay.
text = 'del _showwarnmsg test'
Expand Down Expand Up @@ -1458,15 +1456,13 @@ class PyCatchWarningTests(CatchWarningTests, unittest.TestCase):

class EnvironmentVariableTests(BaseTest):

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: b'[]' != b"['ignore::DeprecationWarning']"
def test_single_warning(self):
rc, stdout, stderr = assert_python_ok("-c",
"import sys; sys.stdout.write(str(sys.warnoptions))",
PYTHONWARNINGS="ignore::DeprecationWarning",
PYTHONDEVMODE="")
self.assertEqual(stdout, b"['ignore::DeprecationWarning']")

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: b'[]' != b"['ignore::DeprecationWarning', 'ignore::UnicodeWarning']"
def test_comma_separated_warnings(self):
rc, stdout, stderr = assert_python_ok("-c",
"import sys; sys.stdout.write(str(sys.warnoptions))",
Expand All @@ -1475,7 +1471,6 @@ def test_comma_separated_warnings(self):
self.assertEqual(stdout,
b"['ignore::DeprecationWarning', 'ignore::UnicodeWarning']")

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: b"['ignore::UnicodeWarning']" != b"['ignore::DeprecationWarning', 'ignore::UnicodeWarning']"
@force_not_colorized
def test_envvar_and_command_line(self):
rc, stdout, stderr = assert_python_ok("-Wignore::UnicodeWarning", "-c",
Expand Down Expand Up @@ -1535,7 +1530,6 @@ def test_default_filter_configuration(self):
self.assertEqual(stdout_lines, expected_output)


@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: b'[]' != b"['ignore:DeprecationWarning\xc3\xa6']"
@unittest.skipUnless(sys.getfilesystemencoding() != 'ascii',
'requires non-ascii filesystemencoding')
def test_nonascii(self):
Expand All @@ -1550,10 +1544,6 @@ def test_nonascii(self):
class CEnvironmentVariableTests(EnvironmentVariableTests, unittest.TestCase):
module = c_warnings

@unittest.expectedFailure # TODO: RUSTPYTHON; Lists differ
def test_default_filter_configuration(self):
return super().test_default_filter_configuration()

class PyEnvironmentVariableTests(EnvironmentVariableTests, unittest.TestCase):
module = py_warnings

Expand Down Expand Up @@ -1851,7 +1841,6 @@ def h(x):
self.assertEqual(len(overloads), 2)
self.assertEqual(overloads[0].__deprecated__, "no more ints")

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_class(self):
@deprecated("A will go away soon")
class A:
Expand All @@ -1863,7 +1852,6 @@ class A:
with self.assertRaises(TypeError):
A(42)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_class_with_init(self):
@deprecated("HasInit will go away soon")
class HasInit:
Expand All @@ -1874,7 +1862,6 @@ def __init__(self, x):
instance = HasInit(42)
self.assertEqual(instance.x, 42)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_class_with_new(self):
has_new_called = False

Expand All @@ -1893,7 +1880,6 @@ def __init__(self, x) -> None:
self.assertEqual(instance.x, 42)
self.assertTrue(has_new_called)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_class_with_inherited_new(self):
new_base_called = False

Expand All @@ -1915,7 +1901,6 @@ class HasInheritedNew(NewBase):
self.assertEqual(instance.x, 42)
self.assertTrue(new_base_called)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_class_with_new_but_no_init(self):
new_called = False

Expand All @@ -1933,7 +1918,6 @@ def __new__(cls, x):
self.assertEqual(instance.x, 42)
self.assertTrue(new_called)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_mixin_class(self):
@deprecated("Mixin will go away soon")
class Mixin:
Expand All @@ -1950,7 +1934,6 @@ class Child(Base, Mixin):
instance = Child(42)
self.assertEqual(instance.a, 42)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_do_not_shadow_user_arguments(self):
new_called = False
new_called_cls = None
Expand All @@ -1970,7 +1953,6 @@ class Foo(metaclass=MyMeta, cls='haha'):
self.assertTrue(new_called)
self.assertEqual(new_called_cls, 'haha')

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_existing_init_subclass(self):
@deprecated("C will go away soon")
class C:
Expand All @@ -1987,7 +1969,6 @@ class D(C):
self.assertTrue(D.inited)
self.assertIsInstance(D(), D) # no deprecation

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_existing_init_subclass_in_base(self):
class Base:
def __init_subclass__(cls, x) -> None:
Expand All @@ -2008,7 +1989,6 @@ class D(C, x=3):

self.assertEqual(D.inited, 3)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_existing_init_subclass_in_sibling_base(self):
@deprecated("A will go away soon")
class A:
Expand All @@ -2028,7 +2008,6 @@ class D(B, A, x=42):
pass
self.assertEqual(D.inited, 42)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_init_subclass_has_correct_cls(self):
init_subclass_saw = None

Expand All @@ -2046,7 +2025,6 @@ class C(Base):

self.assertIs(init_subclass_saw, C)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_init_subclass_with_explicit_classmethod(self):
init_subclass_saw = None

Expand All @@ -2065,7 +2043,6 @@ class C(Base):

self.assertIs(init_subclass_saw, C)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_function(self):
@deprecated("b will go away soon")
def b():
Expand All @@ -2074,7 +2051,6 @@ def b():
with self.assertWarnsRegex(DeprecationWarning, "b will go away soon"):
b()

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_method(self):
class Capybara:
@deprecated("x will go away soon")
Expand All @@ -2085,7 +2061,6 @@ def x(self):
with self.assertWarnsRegex(DeprecationWarning, "x will go away soon"):
instance.x()

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_property(self):
class Capybara:
@property
Expand Down Expand Up @@ -2113,7 +2088,6 @@ def no_more_setting(self, value):
with self.assertWarnsRegex(DeprecationWarning, "no more setting"):
instance.no_more_setting = 42

@unittest.expectedFailure # TODO: RUSTPYTHON; RuntimeWarning not triggered
def test_category(self):
@deprecated("c will go away soon", category=RuntimeWarning)
def c():
Expand Down
8 changes: 5 additions & 3 deletions crates/stdlib/src/_asyncio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,10 +1014,12 @@ pub(crate) mod _asyncio {
// Warn about deprecated (type, val, tb) signature
if exc_val.is_present() || exc_tb.is_present() {
warn::warn(
vm.ctx.new_str(
"the (type, val, tb) signature of throw() is deprecated, \
vm.ctx
.new_str(
"the (type, val, tb) signature of throw() is deprecated, \
use throw(val) instead",
),
)
.into(),
Some(vm.ctx.exceptions.deprecation_warning.to_owned()),
1,
None,
Expand Down
2 changes: 1 addition & 1 deletion crates/stdlib/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,7 @@ mod _socket {
laddr
);
let _ = crate::vm::warn::warn(
vm.ctx.new_str(msg),
vm.ctx.new_str(msg).into(),
Some(vm.ctx.exceptions.resource_warning.to_owned()),
1,
None,
Expand Down
Loading
Loading