Commit Graph

85 Commits

Author SHA1 Message Date
Jurko Gospodnetić 313185c9b4 marshal passed empty object optional params as empty tags
Before, passing an empty suds object as an optional parameter value was treated
the same as not passing that parameter's value or passing it None - the value
would not get marshalled into the constructed SOAP request at all.

Now, user can still not have the value marshalled by passing nothing or None,
but passing an empty object will get marshalled as an actual SOAP request XML
element.

This seems correct as passing an empty object and not passing an object are two
distinct use-cases and there are web-services out there (e.g.
`https://ads.google.com/apis/ads/publisher/v201502/LineItemService?wsdl`) that
do differentiate between the two.

Fixes issue filed on BitBucket under:
`https://bitbucket.org/jurko/suds/issues/81/suds-should-support-an-empty-object`

Kudos to Nicholas Chen (nicholaschen at BitBucket) & Mark Saniscalchi
(msaniscalchi at BitBucket) for reporting the issue and preparing the initial
fix.
2015-07-27 11:04:48 +02:00
Jurko Gospodnetić 89c6b068c5 remove never used ``suds.mx.appender.DictAppender`` class
All code paths that could potentially lead to this class getting used convert
any encountered dictionaries to ``suds.sudsobject.Object`` instances and report
an error in case a corresponding XSD type can not be found.
2015-07-27 10:15:52 +02:00
Jurko Gospodnetić c9a23c4a1e mark suds.mx.core.Core.node() as abstract
This function was never actually getting used as it is overridden in all
non-abstract mashaller classes, i.e. in both `Encoded` & `Literal`.

Its description also seemed to contain some content incorrectly copy/pasted from
suds.mx.core.Core.suspend().
2015-07-27 10:09:26 +02:00
Jurko Gospodnetić a45a9428f5 fix looking for a type in an XSD with recursive type definition
Fixes an infinite recursion bug encountered when looking for an XSD type in an
XSD schema that does not contain it but itself defines a type referencing a
recursively defined type from an imported XSD schema. Kudos to Kevin Pors
(krpors on BitBucket) for detecting, analysing & reporting the issue, plus
preparing a working quick-fix.

Updated README.rst.
2015-07-26 15:05:08 +02:00
Jurko Gospodnetić 29f6b5917f fix handling recursive XSD imports
Now XSD import does not attempt to refetch XSD schemas already constructed
during the same XSD load operation.

Updated todo list.
Updated project release notes.
2015-07-01 11:46:19 +02:00
Jurko Gospodnetić 96bf1052a1 correct XSD element 'form' attribute handling project release notes
Fixed in commit a076899c6524084e119207bcb300e88c2436fbb1.
2015-06-30 09:52:54 +02:00
Jurko Gospodnetić e4e4841dd1 mark the word `suds` consistently in the project's README.rst docs 2014-06-30 20:38:09 +02:00
Jurko Gospodnetić c9864f7932 updated known defects listings in the project's release notes
- noted broken recursive XSD import/include support
- fixed a few typos
2015-06-30 00:03:25 +02:00
Jurko Gospodnetić ce59997840 update project release notes 2015-06-29 21:45:11 +02:00
Jurko Gospodnetić b89de4607a update test environments
Added new test environments - Python 2.7.8, 3.1.3/32-bit & 3.4.2.
Now testing using Windows 8.1/x64.
2014-12-25 20:11:09 +01:00
Jurko Gospodnetić 7e0ce36c85 correct stylistic project release notes typo 2014-06-28 15:06:32 +02:00
Jurko Gospodnetić 80f9eaac66 fix reading a reference XSD element's 'form' value
A reference XSD element's 'form' value is now correctly read from its referenced
element.

This fix:
 * fixes all tests in test_xsd_element.py previously marked as xfail,
 * corrects buggy test data in test_request_construction.py and
 * resolves project issue #49 on BitBucket.

Updated release notes.
Updated todo list.
2014-06-28 14:54:05 +02:00
Jurko Gospodnetić 8257dcf14f update project's old release notes' known defects sections 2014-06-28 14:46:09 +02:00
Jurko Gospodnetić 7af84bf51d clean up project's release notes a bit - stylistic changes 2014-06-28 14:45:40 +02:00
Jurko Gospodnetić 085165042d refactor DepList.sort() to a standalone dependency_sort() function
Renamed the suds.xsd.deplist module to suds.xsd.depsort.
Removed the DepList class and replaced its main/only functionality with a single
dependency_sort() function taking a dependency dictionary and returning the same
list that used to be returned by the DepList.sort() method.

The returned list's contents matches the items returned by the dependency
dictionary's items() method, but sorted so that dependencies come first.

Updated project release notes.

Additional included changes:
 * cleaned up the test_dependency_sort.py test module - cleanly separated
   basic tests, test utilities and test utility tests
 * added a test to make sure dependency_sort() does not modify its input data
 * documented that any entries found listed as dependencies, but that do not
   have their own dependencies listed as well, are logged & ignored
2014-06-27 16:17:25 +02:00
Jurko Gospodnetić acf3924f6f optimize suds.xsd.sxbase.SchemaObject.content() to avoid extra list copies
The 'history' list was being excessively copied at every recursion level when
it was actually only used as an extra stack. Now the extra elements are simply
pushed/popped to/from the end of the stack instead of copying the whole stack
content every time. This brings the operation down to O(n) instead of O(n*n)
algorithmic complexity.

Updated related release notes.
2014-06-26 11:30:42 +02:00
Jurko Gospodnetić 3cefc6068d make suds no longer eat up exceptions raised in user registered plugins
Many thanks to Bouke Haarsma (bouke at BitBucket) & Ezequiel Ruiz (emruiz81 at
BitBucket) for detecting and reporting the issue as well as to Bouke Haarsma for
preparing a suitable test case and the initial patch.
2014-06-15 22:01:51 +02:00
Jurko Gospodnetić c4ca0d96f5 update release notes for the upcoming 0.7 release 2014-06-15 20:28:06 +02:00
Jurko Gospodnetić 4bdec62b18 update ez_setup.py to version from setuptools 5.0.2
The previously used 4.0.1 setuptools version got revoked and 5.1 superseeds it.

Updated related README.rst project docs.
2014-06-15 17:21:22 +02:00
Jurko Gospodnetić 024ac2618d update ez_setup.py to version from setuptools 4.0.1
Merged ez_setup.py updates from the original setuptools project.

Updated related README.rst project docs.
2014-06-04 14:48:43 +02:00
Jurko Gospodnetić 231a8c7d24 add Python 2.7.7 to the list of officially tested Python environments 2014-06-02 15:27:40 +02:00
Jurko Gospodnetić 709409e59e test using Python 3.4.1
Updated related project documentation & test scripts.
2014-05-22 19:44:17 +02:00
Jurko Gospodnetić 1618ae351f reorganize tests - run on installed suds version + do not require py2to3
The test suite is no longer installed together with the project and can now be
run from the project's source distribution. This resolves the issue of the suds
test suite confusing users by getting installed as a top level tests package in
their Python environment.

Project to be tested now need to be explicitly installed prior to running its
tests using pytest, except in case of Python 2 tests being run from the top
level project folder. This requires the user to install the project (suggested
way is to install it in editable mode using 'pip install -e') but also allows
him to run the tests on other non-sandbox project versions, e.g. an externally
installed version.

Project testing now requires the six Python 2/3 compatibility support package
(installed automatically, together with other test requirements).
Test support code now moved to a separate testutils package located under the
tests folder.
Updated project README.rst & HACKING.rst docs.
Minor stylistic changes.
2014-05-17 14:08:18 +02:00
Jurko Gospodnetić 411dae9c9c add support for releasing suds as a wheel distribution 2014-05-15 20:01:36 +02:00
Jurko Gospodnetić ea02fb96ad add tools/setup_base_environments.py development script
Installs packages into multiple Python environments so they can be used for
testing this project. This automates all the previously manually done work on
setting up those environments.

The script contains a multitude of open TODO comments and should still be
considered 'work in progress', but successfully gets the work done at least on
one Windows 7 x64 SP1 machine with 17 different parallel Python installations.

Updated relevant HACKING.rst docs.

Relevant configuration added to the main project Python configuration file
'setup.cfg'.

All Python modules indended for use in different project development utility
scripts have been placed under the suds_devel package folder located under the
tools project folder.

The new scripts:
 - are included in the project's source distribution,
 - are not installed with the project
 - do not need py2to3 processing
 - do not have any tests of their own yet

tools/__* folders get created and used as local caches by the new
tools/setup_base_environments.py development script and so must not included in
the project's source distribution.
2014-05-15 17:10:55 +02:00
Jurko Gospodnetić e233fe5fff update project release notes 2014-05-14 13:51:50 +02:00
Jurko Gospodnetić fa8b3a5131 test the project in additional Python environments
Note that setting up some of the supported older Python environments requires
manual tweaking that has not yet been automated anywhere or described in detail
in the project's HACKING docs.
2014-05-14 09:41:10 +02:00
Jurko Gospodnetić 0734c56b6b update ez_setup.py to version from setuptools 3.6
Updated related README.rst project docs.
2014-05-11 13:30:00 +02:00
Jurko Gospodnetić c51bfb77c9 document installation issue when using pip with older setuptools
When using a pip to install our product into a Python environment with an
existing setuptools installation older than the one used in our project - the
installation will fail and require that the user manually upgrade the existing
setuptools installation.

The issue has already been fixed in the current development version by no longer
requiring a specific setuptools version.
2014-05-04 22:17:26 +02:00
Jurko Gospodnetić ac23dfbbd7 use the latest compatible setuptools version for the current Python version
Now using setuptools 1.4.2 with Python 2.4 & 2.5, and using setuptools 3.3 with
later Python versions. This should help avoid installation issues in different
exotic use cases that were once not being handled by setuptools but have since
been corrected.
2014-03-23 18:39:23 +01:00
Jurko Gospodnetić 265a4ec47a update Python interpreter versions used for testing
Now tested using:
  * Python 2.4.3 x86
  * Python 2.4.4 x86
  * Python 2.7.6 x64
  * Python 3.2.5 x64
  * Python 3.3.3 x86
  * Python 3.3.3 x64
  * Python 3.3.5 x64
  * Python 3.4.0 x86
  * Python 3.4.0 x64

Minor stylistic run_all_tests.cmd script changes:
  * Renamed several internal constants.
  * Reordered tests to make those expected to fail more often run sooner.
2014-03-10 12:07:35 +01:00
Jurko Gospodnetić 508f183889 sort pytest test parametrizations the same in every test process
This avoids issues with pytest xdist plugin collecting tests differently in
different test processes when running them using multiple parallal test
processes.

Kudos to Bruno Oliveira (nicoddemus at BitBucket) for researching related pytest
xdist usage problems, discovering & explaining the underlying issue as well as
providing an initial project patch for it.

Introduced a new 'Project implementation note #xxx' concept for documenting
unintuitive code without duplicating embedded explanation comments. Such
implementation notes now documented in the HACKING.rst project document.
2014-03-06 03:45:20 +01:00
Jurko Gospodnetić f2f3775433 fix inter-process cache reuse with Python's hash randomization
Updated how suds constructs its cached WSDL & XML identifiers to allow cached
data reuse between different processes with Python's hash randomization feature
enabled.

Previously constructed using the built-in Python hash() function, while now it
gets constructed using md5 hash.

Python's hash randomization (implemented since Python 2.6.8, enabled by default
since Python 3.3) was causing different processes to mangle their cached data
names differently.

Many thanks to Eugene Yakubovich for reporting the issue as well as providing
the initial fix & tests.
2014-03-03 18:50:31 +01:00
Jurko Gospodnetić 5c5d922bdb fix a suds.sax.element.Element exception message
This is the exception message constructed when attempting to construct a
suds.sax.element.Element with a non-Element parent. It seems like someone forgot
to apply % string formatting in its construction.
2014-02-28 02:20:19 +01:00
Jurko Gospodnetić e5cf6ba74b correct try:/except: blocks eating up internal Python exceptions
All such block replaced with blocks catching Exception subclasses only so they
no longer eat up internal Python exceptions like SystemExit or
KeyboardInterrupt.
2014-02-28 00:51:15 +01:00
Jurko Gospodnetić bd1eea4626 clean up parent class references on suds.binding.Binding subclasses
suds.binding.Binding converted to a new-style class so its subclasses may use
super() to cleanly invoke methods on their parent class.
2014-02-25 18:37:47 +01:00
Jurko Gospodnetić 82fbe0b28c clean up the BuildError exception message
No longer split over multiple lines based on internal source code formatting.
Converted to unicode.
2014-02-25 08:08:05 +01:00
Jurko Gospodnetić 5b3529dc0b remove the unused SoapHeadersNotPermitted exception class
Invalid or unrecognized SOAP headers given using the suds soapheaders option are
still simply ignored, the same as in the original suds library implementation.
2014-02-25 07:55:44 +01:00
Jurko Gospodnetić 05fecb9c1c fix suds.tostr() to no longer trap & ignore internal Python exceptions
For some input data types, if a non-Exception based exception (e.g.
KeyboardInterrupt or SystemExit) was raised while constructing the given
value's unicode representation, it would get silently ignored and the value's
byte string representation built instead. Now this handling applies only to
regular Exception based exceptions while internal non-Exception based ones are
propageted.
2014-02-25 07:25:36 +01:00
Jurko Gospodnetić bcf395424c clean up suds.transport ASCII/unicode URL/data handling
suds.transport.Request now allows specifying its URL input as either a byte or
a unicode string with any Python version. Internally that URL information is
always converted to the used Python interpreter's native str data type (byte
string for Python versions prior to 3.0, or unicode string for later ones).
Given URLs must not contain any non-ASCII characters and any attempt to create
a suds.transport.Request with such an invalid URL is reported as a UnicodeError
(either UnicodeDecodeError or UnicodeEncodeError depending on the exact Python
version and the given URL data type used).

suds.transport.Reply & suds.transport.Request string representation cleaned up
and no longer raise an error when their message data contains non-ASCII
characters.

Updated related class & method doctrings.
Updated related unit tests.
Updated todo list.
2014-02-17 22:28:51 +01:00
Jurko Gospodnetić 2349fb2f32 fix security issue CVE-2013-2217 - using fixed default cache location
Each process now uses a separate temporary folder as its default cache location.
Different FileCache instances within the same process still use the same default
cache location and user may still explicitly specify a non-default location for
each FileCache instance. Default cache location now gets removed automatically
on process exit unless user code explicitly disables this behaviour by setting
the FileCache.remove_default_location_on_exit class attribute to False.

Additional external information on this issue:
  * Red Hat bug 978696 - https://bugzilla.redhat.com/show_bug.cgi?id=978696
  * CVE-2013-2217 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2217
  * Ubuntu USN-2008-1: Suds vulnerability - http://www.ubuntu.com/usn/USN-2008-1
  * http://lists.opensuse.org/opensuse-updates/2013-07/msg00062.html
  * https://bugzilla.novell.com/show_bug.cgi?id=827568
  * http://www.openwall.com/lists/oss-security/2013/06/27/8

Many thanks to Rolf Krahl for the initial report, providing links to related
external resources as well as helping brainstorm the whole issue.

Added related unit tests and updated existing ones affected by this change.
Updated related project release notes.
Updated todo list.
2014-02-09 04:57:26 +01:00
Jurko Gospodnetić 3774ca46b6 make FileCache keep its duration as a datetime.timedelta object
This affects the published FileCache interface by making it take standard
datetime.timedelta duration related keyword arguments instead of just 'weeks',
'days', 'hours', 'minutes' & 'seconds'. More to the point, it now also supports
'milliseconds' & 'microseconds' keyword arguments.

Corrected FileCache docstring stating that it accepted a `months` keyword
argument when that argument would actually have caused a failure when passed to
a datetime.timedelta initializer internally.

You may now specify multiple duration keyword arguments in FileCache
construction and they will all get summed up when constructing the internal
datetime.timedelta duration representation. Before, you could specify such
multiple arguments, but that would only make the FileCache silently use duration
0, i.e. its cache entries would never expire.

Before, negative durations would have been automatically treated as 'infinite'.
Now they are treated as any other duration value, but that should not cause any
visible side-effects as long as the computer time does not get moved in reverse.

Added related unit tests.
2014-02-07 10:09:10 +01:00
Jurko Gospodnetić 8e5d9c7080 update project release notes 2014-02-07 01:56:36 +01:00
Jurko Gospodnetić 7589aa7bd0 clean up suds.cache module
Rename private & protected FileCache methods:
  * FileCache.getf() --> FileCache._getf()
  * FileCache.checkversion() --> FileCache.__check_version()
  * FileCache.mktmp() --> FileCache.__mktmp()
  * FileCache.open() --> FileCache.__open()
  * FileCache.setduration() --> FileCache.__set_duration()

Reordered FileCache methods in public/protected/private order + alphabetically.
Updated related project release notes.
2014-02-07 00:56:41 +01:00
Jurko Gospodnetić d85e18ba9e fix file removal on failed DocumentCache/ObjectCache operations
DocumentCache & ObjectCache now correctly remove their files on failed file read
operations or failing to process data read from the cached file. Before the
file purge operation would fail because suds still held an open file handle to
the same cached file.

Updated related project release notes.
2014-02-07 00:26:55 +01:00
Jurko Gospodnetić 79aa923077 improve decimal XSD data type support
Such values now modeled using Python's decimal.Decimal class. Original suds
implementation represented them using Python's float type which could result in
both precision loss and incorrectly constructed SOAP request XML documents.
2014-01-30 18:46:06 +01:00
Jurko Gospodnetić cfec4a7db8 fix invalid extra argument error when injecting request/reply/error-info
The bug was cased by the internal __inject argument getting passed onto regular
argument parsing.

This fixes the failing test_resolving_builtin_types() test in
'test_xsd_builtins.py'.
2014-01-27 22:20:43 +01:00
Jurko Gospodnetić 327257d36f update project release notes 2014-01-27 21:55:50 +01:00
Jurko Gospodnetić d95dfc16c0 fix extra input argument reporting for web service operations taking no input 2014-01-27 21:52:57 +01:00
Jurko Gospodnetić fc11a09012 update project information for the next development cycle after release 0.6 2014-01-24 17:44:06 +01:00