Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-WWW-Mechanize for 
openSUSE:Factory checked in at 2026-06-28 21:05:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-WWW-Mechanize (Old)
 and      /work/SRC/openSUSE:Factory/.perl-WWW-Mechanize.new.11887 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-WWW-Mechanize"

Sun Jun 28 21:05:16 2026 rev:50 rq:1361945 version:2.220.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-WWW-Mechanize/perl-WWW-Mechanize.changes    
2026-06-15 19:42:48.969835914 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-WWW-Mechanize.new.11887/perl-WWW-Mechanize.changes
 2026-06-28 21:05:57.320904023 +0200
@@ -1,0 +2,12 @@
+Fri Jun 19 09:53:14 UTC 2026 - Tina Müller <[email protected]>
+
+- updated to 2.220.0 (2.22)
+   see /usr/share/doc/packages/perl-WWW-Mechanize/Changes
+
+  2.22      2026-06-18 20:59:34Z
+      [ENHANCEMENTS]
+      - credentials() now warns when called with the two-argument form, which
+        stores credentials globally; prefer the host-scoped four-argument form.
+        (GH#420) (Olaf Alders)
+
+-------------------------------------------------------------------

Old:
----
  WWW-Mechanize-2.21.tar.gz

New:
----
  WWW-Mechanize-2.22.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-WWW-Mechanize.spec ++++++
--- /var/tmp/diff_new_pack.DlAJoz/_old  2026-06-28 21:05:59.364972899 +0200
+++ /var/tmp/diff_new_pack.DlAJoz/_new  2026-06-28 21:05:59.376973303 +0200
@@ -18,10 +18,10 @@
 
 %define cpan_name WWW-Mechanize
 Name:           perl-WWW-Mechanize
-Version:        2.210.0
+Version:        2.220.0
 Release:        0
-# 2.21 -> normalize -> 2.210.0
-%define cpan_version 2.21
+# 2.22 -> normalize -> 2.220.0
+%define cpan_version 2.22
 License:        Artistic-1.0 OR GPL-1.0-or-later
 Summary:        Handy web browsing in a Perl object
 URL:            https://metacpan.org/release/%{cpan_name}

++++++ WWW-Mechanize-2.21.tar.gz -> WWW-Mechanize-2.22.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/Changes 
new/WWW-Mechanize-2.22/Changes
--- old/WWW-Mechanize-2.21/Changes      2026-06-13 09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/Changes      2026-06-18 22:59:41.000000000 +0200
@@ -1,5 +1,11 @@
 Revision history for WWW::Mechanize
 
+2.22      2026-06-18 20:59:34Z
+    [ENHANCEMENTS]
+    - credentials() now warns when called with the two-argument form, which
+      stores credentials globally; prefer the host-scoped four-argument form.
+      (GH#420) (Olaf Alders)
+
 2.21      2026-06-13 07:53:14Z
     [FIXED]
     - Link extraction no longer drops links which follow an unclosed <a> tag
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/MANIFEST 
new/WWW-Mechanize-2.22/MANIFEST
--- old/WWW-Mechanize-2.21/MANIFEST     2026-06-13 09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/MANIFEST     2026-06-18 22:59:41.000000000 +0200
@@ -39,6 +39,7 @@
 t/content.t
 t/cookies.t
 t/credentials-api.t
+t/credentials-unscoped-warning.t
 t/credentials.t
 t/die.t
 t/dump.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/META.json 
new/WWW-Mechanize-2.22/META.json
--- old/WWW-Mechanize-2.21/META.json    2026-06-13 09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/META.json    2026-06-18 22:59:41.000000000 +0200
@@ -42,6 +42,7 @@
             "Perl::Critic" : "1.132",
             "Perl::Tidy" : "20180220",
             "Pod::Coverage::TrustPod" : "0",
+            "Pod::Tidy" : "0",
             "Test::Code::TidyAll" : "0.50",
             "Test::EOL" : "0",
             "Test::Memory::Cycle" : "0",
@@ -112,15 +113,15 @@
    "provides" : {
       "WWW::Mechanize" : {
          "file" : "lib/WWW/Mechanize.pm",
-         "version" : "2.21"
+         "version" : "2.22"
       },
       "WWW::Mechanize::Image" : {
          "file" : "lib/WWW/Mechanize/Image.pm",
-         "version" : "2.21"
+         "version" : "2.22"
       },
       "WWW::Mechanize::Link" : {
          "file" : "lib/WWW/Mechanize/Link.pm",
-         "version" : "2.21"
+         "version" : "2.22"
       }
    },
    "release_status" : "stable",
@@ -135,7 +136,7 @@
          "web" : "https://github.com/libwww-perl/WWW-Mechanize";
       }
    },
-   "version" : "2.21",
+   "version" : "2.22",
    "x_Dist_Zilla" : {
       "perl" : {
          "version" : "5.042002"
@@ -659,7 +660,7 @@
                   "branch" : null,
                   "changelog" : "Changes",
                   "signed" : 0,
-                  "tag" : "v2.21",
+                  "tag" : "v2.22",
                   "tag_format" : "v%V",
                   "tag_message" : "v%V"
                },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/META.yml 
new/WWW-Mechanize-2.22/META.yml
--- old/WWW-Mechanize-2.21/META.yml     2026-06-13 09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/META.yml     2026-06-18 22:59:41.000000000 +0200
@@ -38,13 +38,13 @@
 provides:
   WWW::Mechanize:
     file: lib/WWW/Mechanize.pm
-    version: '2.21'
+    version: '2.22'
   WWW::Mechanize::Image:
     file: lib/WWW/Mechanize/Image.pm
-    version: '2.21'
+    version: '2.22'
   WWW::Mechanize::Link:
     file: lib/WWW/Mechanize/Link.pm
-    version: '2.21'
+    version: '2.22'
 recommends:
   Compress::Zlib: '0'
 requires:
@@ -71,7 +71,7 @@
   bugtracker: https://github.com/libwww-perl/WWW-Mechanize/issues
   homepage: https://github.com/libwww-perl/WWW-Mechanize
   repository: https://github.com/libwww-perl/WWW-Mechanize.git
-version: '2.21'
+version: '2.22'
 x_Dist_Zilla:
   perl:
     version: '5.042002'
@@ -476,7 +476,7 @@
           branch: ~
           changelog: Changes
           signed: 0
-          tag: v2.21
+          tag: v2.22
           tag_format: v%V
           tag_message: v%V
         Dist::Zilla::Role::Git::Repo:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/Makefile.PL 
new/WWW-Mechanize-2.22/Makefile.PL
--- old/WWW-Mechanize-2.21/Makefile.PL  2026-06-13 09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/Makefile.PL  2026-06-18 22:59:41.000000000 +0200
@@ -59,7 +59,7 @@
     "bytes" => 0,
     "lib" => 0
   },
-  "VERSION" => "2.21",
+  "VERSION" => "2.22",
   "test" => {
     "TESTS" => "t/*.t t/local/*.t t/mech-dump/*.t"
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/README.md 
new/WWW-Mechanize-2.22/README.md
--- old/WWW-Mechanize-2.21/README.md    2026-06-13 09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/README.md    2026-06-18 22:59:41.000000000 +0200
@@ -4,7 +4,7 @@
 
 # VERSION
 
-version 2.21
+version 2.22
 
 # SYNOPSIS
 
@@ -115,9 +115,9 @@
 
 ## Packaged for Different Operating Systems
 
-WWW-Mechanize is readily packaged for several Linux distributions.
-The operating system packages are maintained and updated when WWW-Mechanize is 
released.
-Please check for your own OS at the bottom of this page.
+WWW-Mechanize is readily packaged for several Linux distributions. The 
operating system packages
+are maintained and updated when WWW-Mechanize is released. Please check for 
your own OS at the
+bottom of this page.
 
 ## Manual Installation
 
@@ -1413,6 +1413,13 @@
 
 The four argument form described in 
[LWP::UserAgent](https://metacpan.org/pod/LWP%3A%3AUserAgent) is still 
supported.
 
+**Security note:** The two-argument form is not scoped to a host. The 
credentials are stored on the
+object and sent to every host this object contacts, including the targets of 
cross-domain
+redirects. When the same object may contact more than one host, prefer the 
host-scoped
+four-argument form `$mech->credentials($host_port, $realm, $username, 
$password)` described in
+[LWP::UserAgent](https://metacpan.org/pod/LWP%3A%3AUserAgent), which limits 
the credentials to a single host. The two-argument form emits a
+warning on first use.
+
 ## $mech->get\_basic\_credentials( $realm, $uri, $isproxy )
 
 Returns the credentials for the realm and URI.
@@ -1689,7 +1696,9 @@
 # PACKAGING FOR OPERATING SYSTEMS
 
 <div>
-    <a href="https://repology.org/project/perl%3Awww-mechanize/versions";><img 
src="https://repology.org/badge/vertical-allrepos/perl%3Awww-mechanize.svg"; 
alt="Packaging status by Repology"></a>
+    <a href="https://repology.org/project/perl%3Awww-mechanize/versions";><img
+    
src="https://repology.org/badge/vertical-allrepos/perl%3Awww-mechanize.svg"; 
alt="Packaging status
+    by Repology"></a>
 </div>
 
 # AUTHOR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/cpanfile 
new/WWW-Mechanize-2.22/cpanfile
--- old/WWW-Mechanize-2.21/cpanfile     2026-06-13 09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/cpanfile     2026-06-18 22:59:41.000000000 +0200
@@ -63,6 +63,7 @@
   requires "Perl::Critic" => "1.132";
   requires "Perl::Tidy" => "20180220";
   requires "Pod::Coverage::TrustPod" => "0";
+  requires "Pod::Tidy" => "0";
   requires "Test::Code::TidyAll" => "0.50";
   requires "Test::EOL" => "0";
   requires "Test::Memory::Cycle" => "0";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/dist.ini 
new/WWW-Mechanize-2.22/dist.ini
--- old/WWW-Mechanize-2.21/dist.ini     2026-06-13 09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/dist.ini     2026-06-18 22:59:41.000000000 +0200
@@ -37,6 +37,7 @@
 LWP::Protocol::https = 6.07
 Perl::Critic = 0
 Perl::Tidy = 0
+Pod::Tidy = 0
 
 [Prereqs::Soften]
 module = Compress::Zlib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/lib/WWW/Mechanize/Cookbook.pod 
new/WWW-Mechanize-2.22/lib/WWW/Mechanize/Cookbook.pod
--- old/WWW-Mechanize-2.21/lib/WWW/Mechanize/Cookbook.pod       2026-06-13 
09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/lib/WWW/Mechanize/Cookbook.pod       2026-06-18 
22:59:41.000000000 +0200
@@ -13,7 +13,7 @@
 
 =head1 VERSION
 
-version 2.21
+version 2.22
 
 =head1 INTRODUCTION
 
@@ -57,6 +57,9 @@
     $mech->get( 'http://10.11.12.13/password.html' );
     print $mech->content();
 
+If this object may contact more than one host, scope the credentials to a 
single host with the
+four-argument form; see L<WWW::Mechanize/"$mech-E<gt>credentials( $username, 
$password )">.
+
 =head1 LINKS
 
 =head2 Find all image links
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/lib/WWW/Mechanize/Examples.pod 
new/WWW-Mechanize-2.22/lib/WWW/Mechanize/Examples.pod
--- old/WWW-Mechanize-2.21/lib/WWW/Mechanize/Examples.pod       2026-06-13 
09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/lib/WWW/Mechanize/Examples.pod       2026-06-18 
22:59:41.000000000 +0200
@@ -13,7 +13,7 @@
 
 =head1 VERSION
 
-version 2.21
+version 2.22
 
 =head1 SYNOPSIS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/lib/WWW/Mechanize/FAQ.pod 
new/WWW-Mechanize-2.22/lib/WWW/Mechanize/FAQ.pod
--- old/WWW-Mechanize-2.21/lib/WWW/Mechanize/FAQ.pod    2026-06-13 
09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/lib/WWW/Mechanize/FAQ.pod    2026-06-18 
22:59:41.000000000 +0200
@@ -13,7 +13,7 @@
 
 =head1 VERSION
 
-version 2.21
+version 2.22
 
 =head1 How to get help with WWW::Mechanize
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/lib/WWW/Mechanize/Image.pm 
new/WWW-Mechanize-2.22/lib/WWW/Mechanize/Image.pm
--- old/WWW-Mechanize-2.21/lib/WWW/Mechanize/Image.pm   2026-06-13 
09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/lib/WWW/Mechanize/Image.pm   2026-06-18 
22:59:41.000000000 +0200
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '2.21';
+our $VERSION = '2.22';
 
 #ABSTRACT: Image object for WWW::Mechanize
 
@@ -71,7 +71,7 @@
 
 =head1 VERSION
 
-version 2.21
+version 2.22
 
 =head1 SYNOPSIS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/lib/WWW/Mechanize/Link.pm 
new/WWW-Mechanize-2.22/lib/WWW/Mechanize/Link.pm
--- old/WWW-Mechanize-2.21/lib/WWW/Mechanize/Link.pm    2026-06-13 
09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/lib/WWW/Mechanize/Link.pm    2026-06-18 
22:59:41.000000000 +0200
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '2.21';
+our $VERSION = '2.22';
 
 #ABSTRACT: Link object for WWW::Mechanize
 
@@ -65,7 +65,7 @@
 
 =head1 VERSION
 
-version 2.21
+version 2.22
 
 =head1 SYNOPSIS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/lib/WWW/Mechanize.pm 
new/WWW-Mechanize-2.22/lib/WWW/Mechanize.pm
--- old/WWW-Mechanize-2.21/lib/WWW/Mechanize.pm 2026-06-13 09:53:21.000000000 
+0200
+++ new/WWW-Mechanize-2.22/lib/WWW/Mechanize.pm 2026-06-18 22:59:41.000000000 
+0200
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '2.21';
+our $VERSION = '2.22';
 
 use Tie::RefHash       ();
 use HTTP::Request 1.30 ();
@@ -1500,6 +1500,11 @@
     $clone->cookie_jar( $self->cookie_jar );
     $clone->{headers} = { %{ $self->{headers} } };
 
+    # SUPER::clone() copies the whole object hash, including the one-shot
+    # warning flag. A clone is a distinct object with its own credentials,
+    # so let it warn once on its own two-argument credentials() call.
+    delete $clone->{__credentials_unscoped_warned};
+
     return $clone;
 }
 
@@ -1562,6 +1567,18 @@
     @_ == 2
         or $self->die('Invalid # of args for overridden credentials()');
 
+    # The two-argument form is unscoped: credentials are stored on the
+    # object and get_basic_credentials() returns them for any host and
+    # realm, so they are sent to every host this object contacts,
+    # including cross-domain redirect targets. Warn once per instance so
+    # callers can move to the host-scoped four-argument form.
+    unless ( $self->{__credentials_unscoped_warned} ) {
+        $self->warn(
+            'WWW::Mechanize: the two-argument credentials() form stores 
credentials on the object and sends them to every host this object contacts, 
including cross-domain redirect targets. Use the host-scoped four-argument form 
credentials($host_port, $realm, $user, $pass) to limit credentials to a 
specific host.'
+        );
+        $self->{__credentials_unscoped_warned} = 1;
+    }
+
     return @$self{qw( __username __password )} = @_;
 }
 
@@ -1986,7 +2003,7 @@
 
 =head1 VERSION
 
-version 2.21
+version 2.22
 
 =head1 SYNOPSIS
 
@@ -2114,9 +2131,9 @@
 
 =head2 Packaged for Different Operating Systems
 
-WWW-Mechanize is readily packaged for several Linux distributions.
-The operating system packages are maintained and updated when WWW-Mechanize is 
released.
-Please check for your own OS at the bottom of this page.
+WWW-Mechanize is readily packaged for several Linux distributions. The 
operating system packages
+are maintained and updated when WWW-Mechanize is released. Please check for 
your own OS at the
+bottom of this page.
 
 =head2 Manual Installation
 
@@ -3501,6 +3518,13 @@
 
 The four argument form described in L<LWP::UserAgent> is still supported.
 
+B<Security note:> The two-argument form is not scoped to a host. The 
credentials are stored on the
+object and sent to every host this object contacts, including the targets of 
cross-domain
+redirects. When the same object may contact more than one host, prefer the 
host-scoped
+four-argument form C<< $mech->credentials($host_port, $realm, $username, 
$password) >> described in
+L<LWP::UserAgent>, which limits the credentials to a single host. The 
two-argument form emits a
+warning on first use.
+
 =head2 $mech->get_basic_credentials( $realm, $uri, $isproxy )
 
 Returns the credentials for the realm and URI.
@@ -3816,7 +3840,9 @@
 
 =head1 PACKAGING FOR OPERATING SYSTEMS
 
-=for html <a 
href="https://repology.org/project/perl%3Awww-mechanize/versions";><img 
src="https://repology.org/badge/vertical-allrepos/perl%3Awww-mechanize.svg"; 
alt="Packaging status by Repology"></a>
+=for html <a 
href="https://repology.org/project/perl%3Awww-mechanize/versions";><img
+src="https://repology.org/badge/vertical-allrepos/perl%3Awww-mechanize.svg"; 
alt="Packaging status
+by Repology"></a>
 
 =head1 AUTHOR
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/script/mech-dump 
new/WWW-Mechanize-2.22/script/mech-dump
--- old/WWW-Mechanize-2.21/script/mech-dump     2026-06-13 09:53:21.000000000 
+0200
+++ new/WWW-Mechanize-2.22/script/mech-dump     2026-06-18 22:59:41.000000000 
+0200
@@ -178,7 +178,7 @@
 
 =head1 VERSION
 
-version 2.21
+version 2.22
 
 =head1 SYNOPSIS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/t/00-report-prereqs.dd 
new/WWW-Mechanize-2.22/t/00-report-prereqs.dd
--- old/WWW-Mechanize-2.21/t/00-report-prereqs.dd       2026-06-13 
09:53:21.000000000 +0200
+++ new/WWW-Mechanize-2.22/t/00-report-prereqs.dd       2026-06-18 
22:59:41.000000000 +0200
@@ -20,6 +20,7 @@
                                       'Perl::Critic' => '1.132',
                                       'Perl::Tidy' => '20180220',
                                       'Pod::Coverage::TrustPod' => '0',
+                                      'Pod::Tidy' => '0',
                                       'Test::Code::TidyAll' => '0.50',
                                       'Test::EOL' => '0',
                                       'Test::Memory::Cycle' => '0',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/t/credentials-api.t 
new/WWW-Mechanize-2.22/t/credentials-api.t
--- old/WWW-Mechanize-2.21/t/credentials-api.t  2026-06-13 09:53:21.000000000 
+0200
+++ new/WWW-Mechanize-2.22/t/credentials-api.t  2026-06-18 22:59:41.000000000 
+0200
@@ -1,18 +1,15 @@
 use strict;
 use warnings;
 
-use Test::More tests => 4;
+use Test::More;
+use Test::Warnings qw( :no_end_test warnings );
 use LWP::UserAgent ();
 use WWW::Mechanize ();
 use URI            ();
 
-=pod
-
-The monkeypatch introduced since at least WWW::Mechanize 1.34 only
-ever allows one instance of every LWP::UserAgent descendant to have
-credentials.  This test checks that this buggy behaviour is gone.
-
-=cut
+# The monkeypatch introduced since at least WWW::Mechanize 1.34 only
+# ever allows one instance of every LWP::UserAgent descendant to have
+# credentials.  This test checks that this buggy behaviour is gone.
 
 my $uri   = URI->new('http://localhost');
 my $realm = 'myrealm';
@@ -24,8 +21,15 @@
 my $mech2 = WWW::Mechanize->new();
 my $mech3 = WWW::Mechanize->new();
 
-$mech1->credentials( 'mech1', 'mech1' );
-$mech2->credentials( 'mech2', 'mech2' );
+my @warnings = warnings {
+    $mech1->credentials( 'mech1', 'mech1' );
+    $mech1->credentials( 'mech1', 'mech1' );
+    $mech2->credentials( 'mech2', 'mech2' );
+    $mech2->credentials( 'mech2', 'mech2' );
+};
+
+is scalar @warnings, 2,
+    'two-argument credentials() warns once per instance';
 
 is_deeply(
     [ $ua->credentials( $uri, $realm ) ], [ 'user', 'pass' ],
@@ -44,3 +48,5 @@
     [ $mech3->get_basic_credentials( $realm, $uri ) ], [],
     'Untouched instance retains its credentials'
 );
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/t/credentials-unscoped-warning.t 
new/WWW-Mechanize-2.22/t/credentials-unscoped-warning.t
--- old/WWW-Mechanize-2.21/t/credentials-unscoped-warning.t     1970-01-01 
01:00:00.000000000 +0100
+++ new/WWW-Mechanize-2.22/t/credentials-unscoped-warning.t     2026-06-18 
22:59:41.000000000 +0200
@@ -0,0 +1,53 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Warnings qw( :no_end_test warnings );
+use WWW::Mechanize ();
+
+subtest 'two-argument form warns once per instance' => sub {
+    my $mech = WWW::Mechanize->new;
+
+    my @warnings = warnings { $mech->credentials( 'user', 'pass' ) };
+    is scalar @warnings, 1,
+        'two-argument credentials() warns on first use';
+    like $warnings[0], qr/four-argument form/,
+        'warning points at the host-scoped four-argument form';
+
+    @warnings = warnings { $mech->credentials( 'user2', 'pass2' ) };
+    is scalar @warnings, 0,
+        'two-argument credentials() warns only once per instance';
+};
+
+subtest 'a clone warns on its own credentials (flag is not inherited)' =>
+    sub {
+    my $mech = WWW::Mechanize->new;
+    warnings { $mech->credentials( 'user', 'pass' ) };
+
+    my $clone    = $mech->clone;
+    my @warnings = warnings {
+        $clone->credentials( 'cloneuser', 'clonepass' )
+    };
+    is scalar @warnings, 1,
+        'a clone warns once on its own two-argument credentials() call';
+    };
+
+subtest 'host-scoped forms do not warn' => sub {
+    my $mech = WWW::Mechanize->new;
+
+    my @warnings = warnings {
+        $mech->credentials( 'localhost:80', 'realm', 'user', 'pass' )
+    };
+    is scalar @warnings, 0,
+        'four-argument credentials() does not warn';
+
+    @warnings = warnings {
+        $mech->credentials( 'localhost:80', 'realm' )
+    };
+    is scalar @warnings, 0,
+        'two-argument host:port credentials() does not warn';
+};
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/t/credentials.t 
new/WWW-Mechanize-2.22/t/credentials.t
--- old/WWW-Mechanize-2.21/t/credentials.t      2026-06-13 09:53:21.000000000 
+0200
+++ new/WWW-Mechanize-2.22/t/credentials.t      2026-06-18 22:59:41.000000000 
+0200
@@ -5,10 +5,10 @@
 
 use WWW::Mechanize ();
 use Test::More;
-use Test::Fatal qw( exception );
+use Test::Fatal    qw( exception );
+use Test::Warnings qw( :no_end_test warning );
 
 my $mech = WWW::Mechanize->new;
-isa_ok( $mech, 'WWW::Mechanize' );
 
 my ( $user, $pass );
 
@@ -20,13 +20,17 @@
 
 like(
     exception {
-        $mech->credentials( "one", "two", "three" );
+        $mech->credentials( 'one', 'two', 'three' );
     },
     qr/Invalid # of args for overridden credentials/,
     'credentials dies with wrong number of args'
 );
 
-$mech->credentials( "username", "password" );
+like(
+    warning { $mech->credentials( 'username', 'password' ) },
+    qr/four-argument form/,
+    'two-argument credentials() warns about host scoping'
+);
 
 ( $user, $pass ) = $mech->get_basic_credentials( 'myrealm', $uri, 0 );
 is $user, 'username',
@@ -43,7 +47,6 @@
     'cloned object has password for get_basic_credentials';
 
 my $mech3 = WWW::Mechanize->new;
-isa_ok( $mech3, 'WWW::Mechanize' );
 
 ( $user, $pass ) = $mech3->get_basic_credentials( 'myrealm', $uri, 0 );
 is $user, undef, 'new object has no username for get_basic_credentials';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/t/local/overload.t 
new/WWW-Mechanize-2.22/t/local/overload.t
--- old/WWW-Mechanize-2.21/t/local/overload.t   2026-06-13 09:53:21.000000000 
+0200
+++ new/WWW-Mechanize-2.22/t/local/overload.t   2026-06-18 22:59:41.000000000 
+0200
@@ -1,33 +1,14 @@
-use Test::More skip_all =>
-    "Mysteriously stopped passing, and I don't know why.";
 use warnings;
 use strict;
 use lib 't/local';
 use LocalServer ();
-use Test::More tests => 11;
+use Test::More;
 
-=head1 NAME
-
-overload.t
-
-=head1 SYNOPSIS
-
-This tests for various ways, advertised in L<WWW::Mechanize>, to
-create a subclass of the mech to alter it's behavior in a useful
-manner. (Of course free-style overloading is discouraged, as it breaks
-encapsulation big time.)
-
-This test first feeds some bad HTML to Mech to make sure that it throws
-an error.  Then, it overloads update_html() to fix the HTML before
-processing it, and then we should not have an error.
-
-=head2 Overloading update_html()
-
-This is the recommended way to tidy up the received HTML in a generic
-way, and/or to install supplemental "surface tests" on the HTML
-(e.g. link checker).
-
-=cut
+# Tests the advertised way to subclass mech to alter its behavior:
+# overloading update_html() to tidy up the received HTML before
+# processing (e.g. fixing broken markup or installing surface tests).
+# Here we feed deliberately-broken HTML and confirm the overload repairs
+# it so the form parses cleanly and without warnings.
 
 BEGIN {
     delete @ENV{qw( IFS CDPATH ENV BASH_ENV )};
@@ -64,19 +45,11 @@
 };
 
 my $carpmsg;
-local $^W = 1;
+local $^W = 1;   # enable all warnings so the carp-capture below is meaningful
 no warnings 'redefine';
 local *Carp::carp = sub { $carpmsg = shift };
 
-my $mech = WWW::Mechanize->new();
-isa_ok( $mech, 'WWW::Mechanize' );
-
-$mech->get( $server->url );
-like( $carpmsg, qr{bad.*select}i, 'Standard mech chokes on bogus HTML' );
-
-# If at first you don't succeed, try with a shorter bungee...
-undef $carpmsg;
-$mech = MyMech->new();
+my $mech = MyMech->new();
 isa_ok( $mech, 'WWW::Mechanize', 'Derived object' );
 
 my $response = $mech->get( $server->url );
@@ -92,3 +65,5 @@
     $mech->content(), qr{/select},
     'alteration visible in ->content() too'
 );
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WWW-Mechanize-2.21/xt/author/eol.t 
new/WWW-Mechanize-2.22/xt/author/eol.t
--- old/WWW-Mechanize-2.21/xt/author/eol.t      2026-06-13 09:53:21.000000000 
+0200
+++ new/WWW-Mechanize-2.22/xt/author/eol.t      2026-06-18 22:59:41.000000000 
+0200
@@ -28,6 +28,7 @@
     't/content.t',
     't/cookies.t',
     't/credentials-api.t',
+    't/credentials-unscoped-warning.t',
     't/credentials.t',
     't/die.t',
     't/dump.t',

++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.DlAJoz/_old  2026-06-28 21:06:00.413008213 +0200
+++ /var/tmp/diff_new_pack.DlAJoz/_new  2026-06-28 21:06:00.449009426 +0200
@@ -1,6 +1,6 @@
-mtime: 1781427283
-commit: 30ae349ca728bdb581901455c41e08cb672d215888ca526959ae4861e56f0ac0
+mtime: 1781862795
+commit: 994a4ac008299b0870d17a92dcbe740b8255d1f10ed2227d9f7a016988e1d7a5
 url: https://src.opensuse.org/perl/perl-WWW-Mechanize
-revision: 30ae349ca728bdb581901455c41e08cb672d215888ca526959ae4861e56f0ac0
+revision: 994a4ac008299b0870d17a92dcbe740b8255d1f10ed2227d9f7a016988e1d7a5
 projectscmsync: https://src.opensuse.org/perl/_ObsPrj
 

++++++ build.specials.obscpio ++++++

++++++ build.specials.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore      1970-01-01 01:00:00.000000000 +0100
+++ new/.gitignore      2026-06-19 11:53:15.000000000 +0200
@@ -0,0 +1 @@
+.osc

Reply via email to