From jython-checkins at python.org Mon Jul 3 16:08:18 2017 From: jython-checkins at python.org (stefan.richthofer) Date: Mon, 03 Jul 2017 20:08:18 +0000 Subject: [Jython-checkins] =?utf-8?q?jython=3A_Updated_JLine2_to_2=2E14?= =?utf-8?q?=2E5=2E_Potential_fix_for_=232602=2E?= Message-ID: <20170703200817.18115.ADBBAF20EA8BEF64@psf.io> https://hg.python.org/jython/rev/206a7a2b3aa5 changeset: 8116:206a7a2b3aa5 user: Stefan Richthofer date: Mon Jul 03 22:07:54 2017 +0200 summary: Updated JLine2 to 2.14.5. Potential fix for #2602. files: build.xml | 4 ++-- extlibs/jline-2.14.3.jar | Bin extlibs/jline-2.14.5.jar | Bin 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml --- a/build.xml +++ b/build.xml @@ -160,7 +160,7 @@ - + @@ -613,7 +613,7 @@ - + diff --git a/extlibs/jline-2.14.3.jar b/extlibs/jline-2.14.3.jar deleted file mode 100644 index 1dd3ef4660637fff87aea40662f54a635f29e141..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch [stripped] diff --git a/extlibs/jline-2.14.5.jar b/extlibs/jline-2.14.5.jar new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..761acd41aeeb8bbbd3aeef53d7e879631d1bd6e4 GIT binary patch [stripped] -- Repository URL: https://hg.python.org/jython From jython-checkins at python.org Wed Jul 5 11:12:21 2017 From: jython-checkins at python.org (stefan.richthofer) Date: Wed, 05 Jul 2017 15:12:21 +0000 Subject: [Jython-checkins] =?utf-8?q?jython=3A_Updated_NEWS=2E?= Message-ID: <20170705151221.43074.171FF0C1A6BEA466@psf.io> https://hg.python.org/jython/rev/dd82d5c4c85f changeset: 8117:dd82d5c4c85f user: Stefan Richthofer date: Wed Jul 05 17:12:12 2017 +0200 summary: Updated NEWS. files: NEWS | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -2,6 +2,16 @@ For more details, please see https://hg.python.org/jython +Jython 2.7.2b1 + Bugs fixed + - [ 2602 ] NumberFormatException in terminal on OSX 10.12.5 (ncurses related) + + New Features + - Updated JLine to 2.14.5 + +Jython 2.7.1 + same as 2.7.1rc3 + Jython 2.7.1rc3 Bugs fixed - [ 2597 ] PySystemState.sysClosers requires cleanup to prevent memory leak -- Repository URL: https://hg.python.org/jython From jython-checkins at python.org Mon Jul 10 18:31:05 2017 From: jython-checkins at python.org (stefan.richthofer) Date: Mon, 10 Jul 2017 22:31:05 +0000 Subject: [Jython-checkins] =?utf-8?q?jython=3A_Fixed_=232600_by_adding_th?= =?utf-8?q?e_current_CPython_2=2E7=2E13_version_of?= Message-ID: <20170710223105.102237.FAAF3EBB67D69500@psf.io> https://hg.python.org/jython/rev/1eab34823d61 changeset: 8118:1eab34823d61 user: Stefan Richthofer date: Tue Jul 11 00:30:41 2017 +0200 summary: Fixed #2600 by adding the current CPython 2.7.13 version of subprocess._args_from_interpreter_flags. files: Lib/subprocess.py | 32 ++++++++++++++++++++++++++++++++ NEWS | 1 + 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -491,6 +491,38 @@ raise +# XXX This function is only used by multiprocessing and the test suite, +# but it's here so that it can be imported when Python is compiled without +# threads. + +def _args_from_interpreter_flags(): + """Return a list of command-line arguments reproducing the current + settings in sys.flags and sys.warnoptions.""" + flag_opt_map = { + 'debug': 'd', + # 'inspect': 'i', + # 'interactive': 'i', + 'optimize': 'O', + 'dont_write_bytecode': 'B', + 'no_user_site': 's', + 'no_site': 'S', + 'ignore_environment': 'E', + 'verbose': 'v', + 'bytes_warning': 'b', + 'py3k_warning': '3', + } + args = [] + for flag, opt in flag_opt_map.items(): + v = getattr(sys.flags, flag) + if v > 0: + args.append('-' + opt * v) + if getattr(sys.flags, 'hash_randomization') != 0: + args.append('-R') + for opt in sys.warnoptions: + args.append('-W' + opt) + return args + + def call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete, then return the returncode attribute. diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ Jython 2.7.2b1 Bugs fixed + - [ 2600 ] subprocess doesn't have _args_from_interpreter_flags (blocks support for multiprocessing) - [ 2602 ] NumberFormatException in terminal on OSX 10.12.5 (ncurses related) New Features -- Repository URL: https://hg.python.org/jython From jython-checkins at python.org Mon Jul 10 19:09:19 2017 From: jython-checkins at python.org (stefan.richthofer) Date: Mon, 10 Jul 2017 23:09:19 +0000 Subject: [Jython-checkins] =?utf-8?q?jython=3A_Fixed_=232599=2E?= Message-ID: <20170710230919.86330.DAD95846E586B24E@psf.io> https://hg.python.org/jython/rev/7f32334eaec6 changeset: 8119:7f32334eaec6 user: Stefan Richthofer date: Tue Jul 11 01:09:01 2017 +0200 summary: Fixed #2599. files: NEWS | 1 + src/org/python/core/Py.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ Jython 2.7.2b1 Bugs fixed + - [ 2599 ] Cannot handle network paths under Windows - [ 2600 ] subprocess doesn't have _args_from_interpreter_flags (blocks support for multiprocessing) - [ 2602 ] NumberFormatException in terminal on OSX 10.12.5 (ncurses related) diff --git a/src/org/python/core/Py.java b/src/org/python/core/Py.java --- a/src/org/python/core/Py.java +++ b/src/org/python/core/Py.java @@ -2645,7 +2645,8 @@ if (urlString.startsWith(JAR_URL_PREFIX) && jarSeparatorIndex > 0) { // jar:file:/install_dir/jython.jar!/org/python/core/PySystemState.class int start = JAR_URL_PREFIX.length(); - if (Platform.IS_WINDOWS) { + if (Platform.IS_WINDOWS && urlString.charAt(start+1) != '/') { + // The check for urlString.charAt(start+1) != '/' is done to preserve network paths. start++; } jarFileName = urlString.substring(start, jarSeparatorIndex); @@ -2656,7 +2657,8 @@ if (jarIndex > 0) { jarIndex += 4; int start = VFSZIP_PREFIX.length(); - if (Platform.IS_WINDOWS) { + if (Platform.IS_WINDOWS && urlString.charAt(start+1) != '/') { + // The check for urlString.charAt(start+1) != '/' is done to preserve network paths. // vfszip:/C:/some/path/jython.jar/org/python/core/PySystemState.class start++; } @@ -2669,7 +2671,8 @@ if (jarIndex > 0) { jarIndex += 4; int start = VFS_PREFIX.length(); - if (Platform.IS_WINDOWS) { + if (Platform.IS_WINDOWS && urlString.charAt(start+1) != '/') { + // The check for urlString.charAt(start+1) != '/' is done to preserve network paths. // vfs:/C:/some/path/jython.jar/org/python/core/PySystemState.class start++; } -- Repository URL: https://hg.python.org/jython From jython-checkins at python.org Thu Jul 20 02:16:48 2017 From: jython-checkins at python.org (jeff.allen) Date: Thu, 20 Jul 2017 06:16:48 +0000 Subject: [Jython-checkins] =?utf-8?q?jython=3A_FS-encode_host_names_repor?= =?utf-8?q?ted_from_os=2Euname=28=29_and_platform=2Euname=28=29=2E?= Message-ID: <20170720061647.112918.F05053FF688EE0B4@psf.io> https://hg.python.org/jython/rev/c3e2799ef812 changeset: 8120:c3e2799ef812 user: Jeff Allen date: Wed Jul 19 23:50:55 2017 +0100 summary: FS-encode host names reported from os.uname() and platform.uname(). These functions now match CPython expectations. In many cases, the root cause was in _socket.py. files: Lib/_socket.py | 24 ++++++++- NEWS | 1 + src/org/python/modules/posix/PosixModule.java | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Lib/_socket.py b/Lib/_socket.py --- a/Lib/_socket.py +++ b/Lib/_socket.py @@ -391,6 +391,22 @@ args[0]._last_error = 0 return handle_exception +def _fsencode(name): + """Ensure that a name that may be given as a unicode object (e.g. returned + from Java) is converted to the expected bytes representation using the + file-system encoding.""" + if isinstance(name, unicode): + return name.encode(sys.getfilesystemencoding()) + return name + +def _fsdecode(name): + """Ensure that a name that may be given as a bytes object (normal for + Python) is converted to the Unicode representation (e.g for Java) using the + file-system encoding.""" + if isinstance(name, bytes): + return unicode(name, sys.getfilesystemencoding()) + return name + # select support ################ @@ -1872,11 +1888,13 @@ @raises_java_exception def gethostname(): - return str(InetAddress.getLocalHost().getHostName()) + """Return FS-encoded local host name.""" + return _fsencode(InetAddress.getLocalHost().getHostName()) @raises_java_exception def gethostbyname(name): - return str(InetAddress.getByName(name).getHostAddress()) + """Return IP address as string from FS-decoded host name.""" + return str(InetAddress.getByName(_fsdecode(name)).getHostAddress()) # # Skeleton implementation of gethostbyname_ex @@ -2046,7 +2064,7 @@ return self._sock.fileno() def write(self, data): - data = str(data) # XXX Should really reject non-string non-buffers + data = str(data) # XXX Should really reject non-byte non-buffers if not data: return self._wbuf.append(data) diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ Jython 2.7.2b1 Bugs fixed + - [ 2608 ] Encoding problems with non-ascii host name - [ 2599 ] Cannot handle network paths under Windows - [ 2600 ] subprocess doesn't have _args_from_interpreter_flags (blocks support for multiprocessing) - [ 2602 ] NumberFormatException in terminal on OSX 10.12.5 (ncurses related) diff --git a/src/org/python/modules/posix/PosixModule.java b/src/org/python/modules/posix/PosixModule.java --- a/src/org/python/modules/posix/PosixModule.java +++ b/src/org/python/modules/posix/PosixModule.java @@ -1168,7 +1168,7 @@ PyObject[] vals = { Py.newString(sysname), - Py.newString(uname_nodename), + Py.fileSystemEncode(uname_nodename), Py.newString(sysrelease), Py.newString(uname_sysver), Py.newString(uname_machine) -- Repository URL: https://hg.python.org/jython From jython-dev at xhaus.com Thu Jul 20 06:24:15 2017 From: jython-dev at xhaus.com (Alan Kennedy) Date: Thu, 20 Jul 2017 11:24:15 +0100 Subject: [Jython-checkins] jython: FS-encode host names reported from os.uname() and platform.uname(). In-Reply-To: <20170720061647.112918.F05053FF688EE0B4@psf.io> References: <20170720061647.112918.F05053FF688EE0B4@psf.io> Message-ID: [jeff.allen] @raises_java_exception def gethostname(): - return str(InetAddress.getLocalHost().getHostName()) + """Return FS-encoded local host name.""" + return _fsencode(InetAddress.getLocalHost().getHostName()) [Alan] This looks correct: cpython also returns the fsdecoded name. https://github.com/python/cpython/blob/master/Modules/socketmodule.c#L4855 [jeff.allen] @raises_java_exception def gethostbyname(name): - return str(InetAddress.getByName(name).getHostAddress()) + """Return IP address as string from FS-decoded host name.""" + return str(InetAddress.getByName(_fsdecode(name)).getHostAddress()) [Alan] I think that this should be decoded as IDNA (not file system encoding), which is what cpython does. https://github.com/python/cpython/blob/master/Modules/socketmodule.c#L4905 Alan. -------------- next part -------------- An HTML attachment was scrubbed... URL: