Permalink
Commits on Sep 26, 2018
  1. Remove -E from jython.py (fixes #2707) and improve --print on Linux

    jeff5 committed Sep 26, 2018
    Adds quoting and escaping to the output from the launcher when --print
    is specified, lost in a previous change, sufficient for
    test_jython_launcher to pass. See #2686.
    
    The shebang line of jython.py was not valid on Linux where the entire
    line after the first space is treated as one argument, thus
    python2.7 is all we can have after usr/bin/env. See #2707.
Commits on Sep 25, 2018
  1. Fix handling of -Dprop=v in Jython main() options parser.

    jeff5 committed Sep 25, 2018
Commits on Sep 23, 2018
  1. Unify approach to isInteractive().

    jeff5 committed Sep 23, 2018
    This change combines the emulation of CPython Py_FdIsInteractive, evolved in the
    rework of jython.main, with the launcher-based detection from #2325. The simple
    test there "echo 'print 1' | dist\bin\jython" still produces output identical
    with CPython's.
Commits on Sep 22, 2018
  1. Factor out some pre-Python runtime support and implement PYTHONINSPECT.

    jeff5 committed Sep 22, 2018
    This change implements Py.getenv for access to os.environ, and uses it to
    so that PYTHONINSPECT may trigger an interactive session sfter a script.
    At the same time, we separate out some utilities that work before the Python
    type system is ready.
    
    --HG--
    extra : amend_source : 8b00e2d41a9b748ac24b86588e610de352c30a12
Commits on Sep 20, 2018
  1. Retire SystemRestart.

    jeff5 committed Sep 20, 2018
    This feature ("experimental" since 2008) has been broken in 2.7.x since 2014.
    As implemented (when fixed), it still poses technical problems, including an
    incompatibility with multiple interpreters (sys modules). See Jython-dev.
    
    --HG--
    extra : amend_source : 3743e0e66515ecc0f3f59113b494ca7493bdbff4
  2. Re-write main program logic to be more like the CPython main.c (parti…

    jeff5 committed Sep 20, 2018
    …al #2686)
    
    This change improves supportability and conformance. It carefully stitches
    together existing Jython fragments using a main program logic ported from
    CPython 2.7.15. Many a small bug or divergence has been ironed out. Some small
    changes were needed outside org.python.util (and a lot of comments). We pass
    test_cmd_line_script unmodified and test_cmd_line (updated from CPython)
    skipping only -R support.
    
    Support for the -jar option is restored (but deprecated as PEP 338 appears
    sufficient). Support for SystemRestart (broken since 2.7.0) is restored only to
    be removed shortly -- it can't wholly work and hadn't been missed.
    
    --HG--
    extra : amend_source : 10038bb91ee69a88c83c30d4b503dc528f296476
Commits on Aug 11, 2018
  1. Fix all present irregularities in the javadoc

    jeff5 committed Aug 11, 2018
    It seems Gradle will not publish defective javadoc, so it has to be correct.
    Most problems were due to imaginative choice of argument in @see and @link tags.
    
    No code changes except that the solution was sometimes to add an import
    statement for something referred to in documentation. The editor imposes a few
    coding rules on save (trailing space, @override, parentheses) but I have not
    reformatted much, even code sorely divergent from our standard.
Commits on Aug 3, 2018
  1. Separate main and test material into JARs during Gradle build.

    jeff5 committed Aug 3, 2018
Commits on Jul 29, 2018
  1. Rework Gradle build to obtain distributable JAR and POM, both correct.

    jeff5 committed Jul 29, 2018
    Command "./gradlew publishToMavenLocal" will post a JAR and POM locally that may
    be used experimentally in Maven-based projects.
Commits on Jul 21, 2018
  1. Build a distributable JAR with Gradle (.pom needs work).

    jeff5 committed Jul 21, 2018
    The task publishToMavenLocal produces a useful JAR although the POM lacks the
    correct dependencies.
    
    --HG--
    extra : amend_source : 60c591a8e4d3df4cf2ed2c2f5549045ff00dcedf
Commits on Jul 18, 2018
  1. Improve support for Windows UNC paths in getJarFileNameFromURL.

    jeff5 committed Jul 18, 2018
    This adds to the fix for issue #2410. Tests now include drive-letter and
    UNC paths when the OS platform is Windows. We work around some strange
    behaviour wrt UNC paths that may be a Java conformance issue.
Commits on Jul 14, 2018
  1. Enable PySystemStateTest in Gradle build following fix for #2410.

    jeff5 committed Jul 14, 2018
    (Note previous set d83a36fe9f8e is wrongly-attributed. Those mistakes are mine.)
    
    --HG--
    extra : amend_source : 0eda4238237bbf48663421477f6fe723b282800b
  2. Re-work Py.getJarFileNameFromURL to fix #2410.

    Richienb committed Jul 14, 2018
    This version uses java.net methods instead of ad hoc string manipulation
    because these are likely to be correct for both files and network paths.
    As a side effect, the file separator is now correct for the platform, so
    compensating transformations of the result are removed, and the test
    adjusted to expect this.
Commits on Jul 12, 2018
  1. Clean up Demo directory Python content for readability

    Richienb committed Jul 12, 2018
    White-space changes (hard tabs and other cruft) to improve readability
    using AutoPEP8 and Autoflake.
    
    --HG--
    extra : amend_source : 39eb1ad1aef82373f40b0d3f497038cbc615e630
Commits on Jul 11, 2018
  1. Merge Gradle build script addition to trunk.

    jeff5 committed Jul 11, 2018
  2. Correct result of != comparison against List, Set, Map (fixes #2639)

    jamesmudd committed Jul 11, 2018
    Adds __ne__ method to JavaProxy{List, Set, Map}. Changes BaseSet __eq__
    and __ne__ methods to use item by item comparison where needed. Some
    minor improvements e.g. use entrySet for map comparison. Also refactors
    methods for testing equality and inequality to be very similar across
    JavaProxy{List, Set, Map}.
    
    Adds test coverage of != comparisons to Java {List, Set, Map}, and
    tests with more Java types, the comparions in both directions.
    
    --HG--
    extra : amend_source : c4b1212f099c499b8ed582a0a169323b4dfc7332
  3. Provide Gradle build script with jar and test targets.

    jeff5 committed Jul 11, 2018
    This does not yet go as far as publishing an artefact. It answers several
    questions about what should be in the JAR and how to create it with Gradle,
    so a good place to commit something.
Commits on Jul 9, 2018
Commits on Jun 17, 2018
  1. Fixed #2688.

    Stewori committed Jun 17, 2018
Commits on May 20, 2018
  1. Add a test for Gregorian proleptic interpretation in time module.

    jeff5 committed May 20, 2018
    Add test to test_time (which need not be Jython-specific) and update it
    with recent changes to test_time in CPython stdlib. Also, acknowledge
    Tom Bech as contributor of the related patch.
  2. Make the calendar used by the time module Gregorian proleptic.

    tombech committed May 20, 2018
    Change to match CPython behaviour.
    
    --HG--
    extra : amend_source : 79014c30b7d9a9c3c39ddf8b373ae3cc423193ce
Commits on May 18, 2018
  1. Clarify contract of Py.isInteractive and use it in util.jython.run()

    jeff5 committed May 18, 2018
    Change motivated by #2656, we avoid a warning in interactive mode but not yet
    for file arguments. See also #2686.
Commits on May 8, 2018
  1. Avoid private member access in subprocess.py. Contributes to #2656.

    jeff5 committed May 8, 2018
    In Java 9, Process has a pid() method so we no longer have to setAccessible().
Commits on May 7, 2018
  1. Update Netty jars to 4.1.24. Contributes to #2656.

    jeff5 committed May 7, 2018
    Eliminates warning messages about illegal reflective access.
    See also netty/netty#7254
Commits on May 5, 2018
  1. Update JNR Posix and FFI jars. Contributes to #2656.

    jeff5 committed May 5, 2018
    This helps a with suppressing warning messages about illegal reflective
    access, upsetting fewer of the tests that examine output from a subprocess.
  2. Determine console encoding without private method access (fixes #2659)

    jeff5 committed May 5, 2018
    This change removes the reflective access to private method Console.encoding()
    to which Java 9 objects, simplifing the determination of encoding a little.
    We do not fall back to "file.encoding" as a guess, but on a hard-coded "utf-8".
    Use of chcp was contributed by Oti Humbel. Use of "locale charmap" awaits
    test on Unix-like platforms (check the Java property python.console.encoding).
    
    Sub-process management is factored out of getSystemVersionString for shared use.
Commits on May 4, 2018
  1. Trivial reformatting to PySystemState (whitespace and comments).

    jeff5 committed May 4, 2018
    Some coding standard conformance ahead of substantive changes. Also, beefed up
    the Javadoc to getNativePlatform, partly because it's more portable than
    defending the comments against the formatter.
Commits on Apr 30, 2018
  1. Avoid reflective access warnings on modular Java platform. Fixes #2662.

    jeff5 committed Apr 30, 2018
    This change extends the applicability of handleSuperMethodArgCollisions (in
    PyJavaType) to cover classes inaccessible as a result of modular platform access
    controls introduced in Java 9 (project Jigsaw). The apparatus for this test is
    obtained reflectively at run-time, since it doesn't exist in Java 7 and 8.
Commits on Apr 19, 2018
  1. Restore ordering of method list in PyJavaType.

    jeff5 committed Apr 19, 2018
    Accidentally displaced in previous refactoring. (Oddly, Issue2391AttrOrderTest
    passed.)
Commits on Apr 16, 2018
  1. Refactor PyJavaType.init for readability (no material change).

    jeff5 committed Apr 16, 2018
    --HG--
    extra : amend_source : 117aa05131ada858f995b93c5bd3f1e5262ea998
Commits on Mar 29, 2018
Commits on Mar 28, 2018
  1. Tolerate looser order of Python and Java arguments to launcher.

    jeff5 committed Mar 28, 2018
    This allows idioms like cmd = [sys.executable, '-E'].extend(args)
    to succeed when args includes JVM arguments (e.g. in
    Lib/test/script_helper.py). Currently only for jython.py launcher.
  2. Allow JAVA_STACK and JAVA_MEM to be just the size. Fixes #2501.

    jeff5 committed Mar 28, 2018
    It was unclear whether -Xss and -Xmx prefixes were required, and now
    they are imputed if missing. This fixes #2501 for Windows, but the
    Unix shell script launcher needs the same change.
  3. Use relative path in launcher only if shorter than absolute path

    jeff5 committed Mar 28, 2018
    We opted for relative paths to make paths and command-lines more
    readable, and avoid some non-ascii encoding risks, when Jython is
    installed locally to a user. The choice was counter-productive when
    Jython was installed in a shared location.
    
    --HG--
    extra : amend_source : 8fd01b075f3387495b79d9b9ee5844638ff3f068