##// END OF EJS Templates
sslutil: synchronize hostname matching logic with CPython...
sslutil: synchronize hostname matching logic with CPython sslutil contains its own hostname matching logic. CPython has code for the same intent. However, it is only available to Python 2.7.9+ (or distributions that have backported 2.7.9's ssl module improvements). This patch effectively imports CPython's hostname matching code from its ssl.py into sslutil.py. The hostname matching code itself is pretty similar. However, the DNS name matching code is much more robust and spec conformant. As the test changes show, this changes some behavior around wildcard handling and IDNA matching. The new behavior allows wildcards in the middle of words (e.g. 'f*.com' matches 'foo.com') This is spec compliant according to RFC 6125 Section 6.5.3 item 3. There is one test where the matcher is more strict. Before, '*.a.com' matched '.a.com'. Now it doesn't match. Strictly speaking this is a security vulnerability.

File last commit:

r29433:33770d2b default
r29452:26a5d605 3.8.4 stable
Show More
test-check-py3-compat.t
176 lines | 17.9 KiB | text/troff | Tads3Lexer
/ tests / test-check-py3-compat.t
Gregory Szorc
tests: add test for Python 3 compatibility...
r27279 #require test-repo
$ cd "$TESTDIR"/..
Matt Harbison
tests: convert directory separators to '/' for MSYS in test-check-py-compat...
r27438 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
Gregory Szorc
tests: add test for Python 3 compatibility...
r27279 hgext/fetch.py not using absolute_import
Martijn Pieters
fsmonitor: dependencies for new experimental extension...
r28432 hgext/fsmonitor/pywatchman/__init__.py not using absolute_import
hgext/fsmonitor/pywatchman/__init__.py requires print_function
hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import
hgext/fsmonitor/pywatchman/pybser.py not using absolute_import
Gregory Szorc
tests: add test for Python 3 compatibility...
r27279 hgext/gpg.py not using absolute_import
hgext/graphlog.py not using absolute_import
hgext/hgcia.py not using absolute_import
hgext/hgk.py not using absolute_import
hgext/highlight/__init__.py not using absolute_import
hgext/highlight/highlight.py not using absolute_import
hgext/histedit.py not using absolute_import
hgext/largefiles/__init__.py not using absolute_import
hgext/largefiles/basestore.py not using absolute_import
hgext/largefiles/lfcommands.py not using absolute_import
hgext/largefiles/lfutil.py not using absolute_import
hgext/largefiles/localstore.py not using absolute_import
hgext/largefiles/overrides.py not using absolute_import
hgext/largefiles/proto.py not using absolute_import
hgext/largefiles/remotestore.py not using absolute_import
hgext/largefiles/reposetup.py not using absolute_import
hgext/largefiles/uisetup.py not using absolute_import
hgext/largefiles/wirestore.py not using absolute_import
hgext/mq.py not using absolute_import
hgext/rebase.py not using absolute_import
hgext/share.py not using absolute_import
hgext/win32text.py not using absolute_import
i18n/check-translation.py not using absolute_import
i18n/polib.py not using absolute_import
setup.py not using absolute_import
tests/heredoctest.py requires print_function
tests/md5sum.py not using absolute_import
tests/readlink.py not using absolute_import
tests/readlink.py requires print_function
tests/run-tests.py not using absolute_import
tests/svn-safe-append.py not using absolute_import
tests/test-atomictempfile.py not using absolute_import
tests/test-demandimport.py not using absolute_import
Gregory Szorc
tests: perform an ast parse with Python 3...
r28583
#if py3exe
$ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
timeless
tests: glob py3 line numbers...
r28643 contrib/check-code.py: invalid syntax: (unicode error) 'unicodeescape' codec can't decode bytes in position *-*: malformed \N character escape (<unknown>, line *) (glob)
doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
hgext/automv.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/blackbox.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 hgext/bugzilla.py: error importing module: <ImportError> No module named 'urlparse' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/censor.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 hgext/chgserver.py: error importing module: <ImportError> No module named 'SocketServer' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/children.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/churn.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/clonebundles.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
tests: glob py3 line numbers...
r28643 hgext/color.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 hgext/convert/bzr.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob)
hgext/convert/common.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/convert/convcmd.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob)
hgext/convert/cvs.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 hgext/convert/cvsps.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/convert/darcs.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 hgext/convert/filemap.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/convert/git.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob)
hgext/convert/gnuarch.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob)
hgext/convert/hg.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/convert/monotone.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob)
hgext/convert/p*.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 hgext/convert/subversion.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob)
hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/eol.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
Pulkit Goyal
py3: make extdiff use absolute_import
r28970 hgext/extdiff.py: error importing module: <SyntaxError> invalid syntax (archival.py, line *) (line *) (glob)
Pulkit Goyal
py3: make factotum use absolute_import...
r28971 hgext/factotum.py: error importing: <ImportError> No module named 'httplib' (error at __init__.py:*) (glob)
timeless
tests: glob py3 line numbers...
r28643 hgext/fetch.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/fsmonitor/watchmanclient.py: error importing module: <SystemError> Parent module 'hgext.fsmonitor' not loaded, cannot perform relative import (line *) (glob)
hgext/gpg.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob)
hgext/graphlog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/hgcia.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/hgk.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
tests: glob py3 line numbers...
r28643 hgext/histedit.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/keyword.py: error importing: <ImportError> No module named 'BaseHTTPServer' (error at common.py:*) (glob)
hgext/largefiles/basestore.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob)
hgext/largefiles/lfcommands.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob)
hgext/largefiles/lfutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 hgext/largefiles/localstore.py: error importing module: <ImportError> No module named 'lfutil' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/largefiles/overrides.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob)
timeless
pycompat: switch to util.urlreq/util.urlerr for py3 compat
r28883 hgext/largefiles/proto.py: error importing: <ImportError> No module named 'httplib' (error at httppeer.py:*) (glob)
hgext/largefiles/remotestore.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at wireproto.py:*) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/largefiles/reposetup.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
tests: glob py3 line numbers...
r28643 hgext/largefiles/uisetup.py: error importing module: <SyntaxError> invalid syntax (archival.py, line *) (line *) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 hgext/largefiles/wirestore.py: error importing module: <ImportError> No module named 'lfutil' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/mq.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob)
hgext/notify.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/pager.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/patchbomb.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/purge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/rebase.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob)
hgext/record.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/relink.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/schemes.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
hgext/share.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
tests: glob py3 line numbers...
r28643 hgext/shelve.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 hgext/strip.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
tests: glob py3 line numbers...
r28643 hgext/transplant.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob)
mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/branchmap.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
tests: glob py3 line numbers...
r28643 mercurial/bundle*.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
mercurial/bundlerepo.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/changegroup.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/changelog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/cmdutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
tests: glob py3 line numbers...
r28643 mercurial/commands.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 mercurial/commandserver.py: error importing module: <ImportError> No module named 'SocketServer' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/context.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/copies.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/crecord.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/dirstate.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/discovery.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/dispatch.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
pycompat: switch to util.urlreq/util.urlerr for py3 compat
r28883 mercurial/exchange.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/extensions.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/filelog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/filemerge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/fileset.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 mercurial/formatter.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/graphmod.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/help.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/hg.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 mercurial/hgweb/common.py: error importing module: <ImportError> No module named 'BaseHTTPServer' (line *) (glob)
mercurial/hgweb/hgweb_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
mercurial/hgweb/hgwebdir_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/hgweb/protocol.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 mercurial/hgweb/request.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
mercurial/hgweb/server.py: error importing module: <ImportError> No module named 'BaseHTTPServer' (line *) (glob)
mercurial/hgweb/webcommands.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
mercurial/hgweb/webutil.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
mercurial/hgweb/wsgicgi.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/hook.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 mercurial/httpclient/_readers.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob)
timeless
pycompat: switch to util.urlreq/util.urlerr for py3 compat
r28883 mercurial/httpconnection.py: error importing: <ImportError> No module named 'httplib' (error at __init__.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 mercurial/httppeer.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob)
mercurial/keepalive.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/localrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/mail.py: error importing module: <AttributeError> module 'email' has no attribute 'Header' (line *) (glob)
mercurial/manifest.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/merge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/namespaces.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/patch.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob)
mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob)
timeless
tests: glob py3 line numbers...
r28643 mercurial/repair.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/revlog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/revset.py: error importing module: <AttributeError> 'dict' object has no attribute 'iteritems' (line *) (glob)
mercurial/scmutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 mercurial/scmwindows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/simplemerge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/sshpeer.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at wireproto.py:*) (glob)
mercurial/sshserver.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
pycompat: switch to util.urlreq/util.urlerr for py3 compat
r28883 mercurial/statichttprepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
pycompat: switch to util.stringio for py3 compat
r28861 mercurial/store.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/streamclone.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/subrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/templatefilters.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/templatekw.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/templater.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/ui.py: error importing: <ImportError> No module named 'cPickle' (error at formatter.py:*) (glob)
mercurial/unionrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
mercurial/url.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob)
mercurial/verify.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
timeless
py3: glob line numbers in test-check-py3-compat
r28673 mercurial/win*.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob)
mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
timeless
tests: glob py3 line numbers...
r28643 mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
Gregory Szorc
tests: perform an ast parse with Python 3...
r28583
#endif