Skip to content

Commit 059bdb5

Browse files
committed
1.030 2023/03/27 SNOOPYJC issue_s335: give errors in the generated code on unix, issue s337: Fix issues in Time::HiRes on unix, issue s336: Assigning a string to a signal handler generates incorrect code unless the string is IGNORE or DEFAULT, issue s338: Use of uninitialized value in string eq at ../../Pythonizer.pm line 2171 caused by @+ not being recognized, issue s339 - Use of uninitialized value in string eq at ../../Perlscan.pm line 9614 causes by @{... \n} not being recognized and @isa = ... also not being recognized, issue s340: Substitute in elsif generates bad code, issue s341: Bogus [Perlscan-S5450]: Unterminated string starting at line XX, issue s345: Diamond operator with python keyword as file handle generates bad code, issue s344: Simple regex substitute generates bad code, issue s342: %+ hash is not available, issue s343: The number of generated chunk exceeed 2048, issue s346: Array to Hash map idiom generates bad code, issue s347: Converting a class object to a string should change '.' to '::', issue s348: Copies of @_ need to be autovivified, issue s349: Initializing a %hash with a qw(...) causes it to be an array, issue s350: Handle dynamic require statement in eval, issue s351: sort that looks like a sub call generates incorrect code, issue s352: Pattern match with variable sub-pattern doesn't create the match variable, issue s353: Methods with multiple out parameters are not properly handled, issue s354: defined on an arrayref gives error on get operation, issue s355: undef being interpolated in string as None instead of '' if coming from arrayref or hashref, issue s356: Conditionally assigned arrayref is being incorrectly initialized to an empty array instead of undef, issue s357: A conditional IO::File open fails as it calls open_ instead, issue s358: Bad code generated for ' 'x operation, issue s359: referencing an array element that doesn't exist shouldn't create it, issue s360: Subpackage with the same name as any parent package causes the module to overwrite the parent namespace, issue s361: Symbolic reference not generating proper code, issue s362: C-style for loop with ++j may generate bad code, issue s363: Pattern style range operator no longer works if a simple string pattern is used
1 parent c7cce5c commit 059bdb5

149 files changed

Lines changed: 27714 additions & 23508 deletions

File tree

Some content is hidden

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

CONTRIBUTING.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Ready to contribute? Here's how to set up `pythonizer` for local development.
7474

7575
o Carp::Assert
7676
o IPC::System::Simple
77+
o Switch
78+
o CGI
7779

7880
5. When you're done making changes, check that your changes pass the
7981
tests::

Config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__author__ = """Joe Cool"""
44
___email__ = 'snoopyjc@gmail.com'
5-
__version__ = '1.029'
5+
__version__ = '1.030'
66

77
import perllib
88
import subprocess

Exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Generated by "pythonizer -aM -d5 -v3 Exporter.pm" v1.027 run by SNOOPYJC on Wed Feb 22 14:03:51 2023
33
__author__ = """Joe Cool"""
44
__email__ = 'snoopyjc@gmail.com'
5-
__version__ = '1.029'
5+
__version__ = '1.030'
66
import builtins,perllib,re
77
_bn = lambda s: '' if s is None else s
88
_pb = lambda b: 1 if b else ''

File/Path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Implementation of perl File::Path package"""
44
__author__ = """Joe Cool"""
55
__email__ = "snoopyjc@gmail.com"
6-
__version__ = "1.029"
6+
__version__ = "1.030"
77
import builtins, perllib, os, re
88

99
_str = lambda s: "" if s is None else str(s)

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
History
33
=======
44

5+
1.030 (2023-03-27)
6+
------------------
7+
8+
* Issue s335: Replace os.getgrouplist() call in _stat.py with os.getgroups(), Issue s337: Fix issues in Time::HiRes on unix. Issue s347: Converting a class object to a string should change '.' to '::' - fixed in _init_package, Issue s350: Handle dynamic require statement in eval - fix _import to handle '::' as '/', Issue s359: define get() in _ArrayHash to work with negative index, define get() in _add_tie_methods for tied arrays and also define proper __getitem__, __setitem__, and __delitem__ methods, define get() for File_stat class in _stat, fix _each to work on Array objects, allow _list_of_n to work on an itertools.chain object
9+
510
1.029 (2023-03-03)
611
------------------
712

Pass0.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ sub pass_0
158158
last;
159159
}
160160

161+
} elsif($ValClass[$i] eq 'f' && $ValPy[$i] eq '_set_signal') { # issue s336
162+
$use_implicit_my = 0;
163+
say STDERR "Using -M due to set %SIG" if($say_why);
164+
last;
161165
}
162166
}
163167
}

Perlscan.pm

Lines changed: 174 additions & 31 deletions
Large diffs are not rendered by default.

Pyconfig.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ our @EXPORT = qw( $TABSIZE $MAXNESTING $MAXLINELEN $DEFAULT_VAR $DEFAULT_MATCH $
2323
our $TABSIZE = 4;
2424
our $MAXNESTING = 32;
2525
our $MAXLINELEN = 188;
26-
our $MAX_CHUNKS = 2048; # Limit on gen_chunk
26+
our $MAX_CHUNKS = 8192; # Limit on gen_chunk
2727
our $MAX_DEPTH = 1024; # Limit on expression recursion depth
2828
our $DEFAULT_VAR = "_d";
2929
our $DEFAULT_MATCH = "_m";
@@ -224,7 +224,7 @@ our %PYF_CALLS=(_basename=>'_fileparse', _croak=>'_shortmess', _confess=>'_longm
224224
_unpack=>'_pack',
225225
_assign_sparse=>'_int,_warn,_die,_caller', # issue s332
226226
_can=>'_isa', _binmode=>'_autoflush',
227-
_add_tie_methods=>'_raise', # issue s216
227+
_add_tie_methods=>'_raise,Array,ArrayHash', # issue s216, issue s359
228228
_method_call=>'_cluck', # issue s236
229229
_smartmatch=>'_num,_warn,_die,_caller', # issue s251, issue s332
230230
_exec=>'_execp,_cluck', # issue s247
@@ -240,6 +240,7 @@ our %PYF_CALLS=(_basename=>'_fileparse', _croak=>'_shortmess', _confess=>'_longm
240240
_store_perl_meta=>'_assign_meta,_init_package,ArrayHash,Hash,_ArrayHash,_ArrayHashClass,_partialclass', # issue s301
241241
_isa_op=>'_isa', # issue s287
242242
_add_tie_call=>'_tie_call', # issue s304
243+
_set_signal=>'_num,_warn', # issue s336
243244
_carp=>'_shortmess', _cluck=>'_longmess'); # Who calls who
244245
our %PYF_OUT_PARAMETERS=(); # Functions with out parameters - which parameter (counting from 1) is "out"?
245246
our %STATEMENT_FUNCTIONS=(getopts=>1, GetOptions=>1, chop=>1, chomp=>1); # issue s150: These functions generate statements and must be pulled out of expressions/conditions, issue s167: Add chop/chomp

Pythonizer.pm

Lines changed: 168 additions & 47 deletions
Large diffs are not rendered by default.

Sys/Hostname.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
__author__ = """Joe Cool"""
66
___email__ = 'snoopyjc@gmail.com'
7-
__version__ = '1.029'
7+
__version__ = '1.030'
88

99
import signal, re, perllib, builtins, os
1010

0 commit comments

Comments
 (0)