Skip to content

Commit 9009d8f

Browse files
committed
1.025 2023/02/05 SNOOPYJC issue s70: Malformed UTF-8 character (fatal) at ../pythonizer/Pythonizer.pm, plus add -e flag and change how ord/chr work for non-utf8 encodings, issue s269: Naming a package 'bytes' should generate an escaped name, implement Encode, Encode::Encoding, Encode::MIME::Name, CGI, CGI::Cookie, CGI::Util, CGI::File::Temp, issue s272: Conditional ::single assignment generates unconditional call to pdb
1 parent 346ed95 commit 9009d8f

84 files changed

Lines changed: 17255 additions & 867 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CGI/CGI.pm

Lines changed: 3907 additions & 0 deletions
Large diffs are not rendered by default.

CGI/Cookie.pm

Lines changed: 557 additions & 0 deletions
Large diffs are not rendered by default.

CGI/Cookie.py

Lines changed: 863 additions & 0 deletions
Large diffs are not rendered by default.

CGI/File/Temp.pm

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# this is a back compatibility wrapper around File::Temp. DO NOT
2+
# use this package outside of CGI, i won't provide any help if
3+
# you use it directly and your code breaks horribly.
4+
package CGI::File::Temp;
5+
6+
$CGI::File::Temp::VERSION = '4.54';
7+
8+
use parent File::Temp;
9+
use parent Fh;
10+
11+
my $appease_cpants_kwalitee = q/
12+
use strict;
13+
use warnings;
14+
#/;
15+
16+
use overload
17+
'""' => \&asString,
18+
'cmp' => \&compare,
19+
'fallback'=>1;
20+
21+
# back compatibility method since we now return a File::Temp object
22+
# as the filehandle (which isa IO::Handle) so calling ->handle on
23+
# it will fail. FIXME: deprecate this method in v5+
24+
sub handle { return shift; };
25+
26+
sub compare {
27+
my ( $self,$value ) = @_;
28+
return "$self" cmp $value;
29+
}
30+
31+
sub _mp_filename {
32+
my ( $self,$filename ) = @_;
33+
${*$self}->{ _mp_filename } = $filename
34+
if $filename;
35+
return ${*$self}->{_mp_filename};
36+
}
37+
38+
sub asString {
39+
my ( $self ) = @_;
40+
return $self->_mp_filename;
41+
}
42+
43+
1;

CGI/File/Temp.py

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#!/usr/bin/env python3
2+
# Generated by "pythonizer -a File/Temp.pm" v1.025 run by SNOOPYJC on Fri Feb 10 14:35:57 2023
3+
__author__ = """Joe Cool"""
4+
__email__ = "snoopyjc@gmail.com"
5+
__version__ = "1.025"
6+
# this is a back compatibility wrapper around File::Temp. DO NOT
7+
# use this package outside of CGI, i won't provide any help if
8+
# you use it directly and your code breaks horribly.
9+
import builtins, perllib
10+
11+
_bn = lambda s: "" if s is None else s
12+
_str = lambda s: "" if s is None else str(s)
13+
import Fh as _Fh
14+
15+
perllib.init_package("CGI.File.Temp", isa="File.Temp Fh".split())
16+
17+
18+
def asString(*_args):
19+
[self] = perllib.list_of_n(_args, 1)
20+
return self._mp_filename()
21+
22+
23+
CGI.File.Temp.asString = asString
24+
25+
26+
def _mp_filename(*_args):
27+
[self, filename] = perllib.list_of_n(_args, 2)
28+
if filename:
29+
(CGI.File.Temp.__dict__[self])["_mp_filename"] = filename
30+
31+
return (CGI.File.Temp.__dict__.get(self)).get("_mp_filename")
32+
33+
34+
CGI.File.Temp._mp_filename = _mp_filename
35+
36+
37+
def compare(*_args):
38+
[self, value] = perllib.list_of_n(_args, 2)
39+
return perllib.cmp(f"{_bn(self)}", value)
40+
41+
42+
CGI.File.Temp.compare = compare
43+
44+
# back compatibility method since we now return a File::Temp object
45+
# as the filehandle (which isa IO::Handle) so calling ->handle on
46+
# it will fail. FIXME: deprecate this method in v5+
47+
48+
49+
def handle(*_args):
50+
_args = list(_args)
51+
return _args.pop(0) if _args else None
52+
53+
54+
CGI.File.Temp.handle = handle
55+
56+
57+
def __gt__(self, other): # extra overload '>'
58+
return compare(self, other, False) > 0
59+
60+
61+
CGI.File.Temp.__gt__ = __gt__
62+
63+
64+
def __ge__(self, other): # extra overload '>='
65+
return compare(self, other, False) >= 0
66+
67+
68+
CGI.File.Temp.__ge__ = __ge__
69+
70+
71+
def __ne__(self, other): # extra overload '!='
72+
return compare(self, other, False) != 0
73+
74+
75+
CGI.File.Temp.__ne__ = __ne__
76+
77+
78+
def __eq__(self, other): # extra overload '=='
79+
return compare(self, other, False) == 0
80+
81+
82+
CGI.File.Temp.__eq__ = __eq__
83+
84+
85+
def __le__(self, other): # extra overload '<='
86+
return compare(self, other, False) <= 0
87+
88+
89+
CGI.File.Temp.__le__ = __le__
90+
91+
92+
def __lt__(self, other): # extra overload '<'
93+
return compare(self, other, False) < 0
94+
95+
96+
CGI.File.Temp.__lt__ = __lt__
97+
98+
99+
def __rcmp__(self, other): # reversed overload 'cmp'
100+
return compare(self, other, True)
101+
102+
103+
CGI.File.Temp.__rcmp__ = __rcmp__
104+
105+
106+
def __cmp__(self, other): # use overload 'cmp'
107+
return compare(self, other, False)
108+
109+
110+
CGI.File.Temp.__cmp__ = __cmp__
111+
112+
113+
def __str__(self): # use overload '""'
114+
return _str(asString(self, None, False))
115+
116+
117+
CGI.File.Temp.__str__ = __str__
118+
119+
builtins.__PACKAGE__ = "CGI.File.Temp"
120+
CGI.File.Temp.ISA_a = perllib.init_global("CGI.File.Temp", "ISA_a", perllib.Array())
121+
122+
CGI.File.Temp.VERSION_v = "4.54"
123+
124+
# SKIPPED: use parent File::Temp;
125+
CGI.File.Temp.ISA_a.append("File.Temp")
126+
CGI.File.Temp.ISA_a.append("Fh")
127+
128+
appease_cpants_kwalitee = """
129+
use strict;
130+
use warnings;
131+
#"""
132+
133+
setattr(CGI.File.Temp, '(""', asString)
134+
setattr(CGI.File.Temp, "(cmp", compare)

CGI/Util.data

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
=head1 NAME
3+
4+
CGI::Util - Internal utilities used by CGI module
5+
6+
=head1 SYNOPSIS
7+
8+
none
9+
10+
=head1 DESCRIPTION
11+
12+
no public subroutines
13+
14+
=head1 AUTHOR INFORMATION
15+
16+
The CGI.pm distribution is copyright 1995-2007, Lincoln D. Stein. It is
17+
distributed under the Artistic License 2.0. It is currently
18+
maintained by Lee Johnson with help from many contributors.
19+
20+
Address bug reports and comments to: https://github.com/leejo/CGI.pm/issues
21+
22+
The original bug tracker can be found at: https://rt.cpan.org/Public/Dist/Display.html?Queue=CGI.pm
23+
24+
When sending bug reports, please provide the version of CGI.pm, the version of
25+
Perl, the name and version of your Web server, and the name and version of the
26+
operating system you are using. If the problem is even remotely browser
27+
dependent, please provide information about the affected browsers as well.
28+
29+
=head1 SEE ALSO
30+
31+
L<CGI>
32+
33+
=cut

0 commit comments

Comments
 (0)