Skip to content

Allow alternatives to default suds file cache #4

@kil

Description

@kil

The suds client instantiated at https://github.com/bing-ads-sdk/BingAds-Python-SDK/blob/master/bingads/service_client.py#L250-L252 uses the default suds caching strategy and file location (thats /tmp/suds, where the /tmp part comes from gettempdir()).

That means if two users run this test program:

from bingads import ServiceClient
#EOF

the one that comes second will see this error:

Traceback (most recent call last):
  File "bin/python", line 146, in <module>
    exec(compile(__file__f.read(), __file__, "exec"))
  File "a.py", line 1, in <module>
    from bingads import ServiceClient
  File "/x/eggs/bingads-9.3.2-py2.7.egg/bingads/__init__.py", line 3, in <module>
    from .service_client import *
  File "/x/eggs/bingads-9.3.2-py2.7.egg/bingads/service_client.py", line 251, in <module>
    'file:///' + pkg_resources.resource_filename('bingads', 'proxies/campaign_management_service.xml')
  File "/x/eggs/suds_jurko-0.6-py2.7.egg/suds/client.py", line 112, in __init__
    kwargs["cache"] = ObjectCache(days=1)
  File "/x/eggs/suds_jurko-0.6-py2.7.egg/suds/cache.py", line 119, in __init__
    self.checkversion()
  File "/x/eggs/suds_jurko-0.6-py2.7.egg/suds/cache.py", line 242, in checkversion
    self.clear()
  File "/x/eggs/suds_jurko-0.6-py2.7.egg/suds/cache.py", line 211, in clear
    for fn in os.listdir(self.location):
OSError: [Errno 13] Permission denied: '/tmp/suds'

Would be great if that was configurable (eg. if it was possible to provide the cache argument to the suds client).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions