filtering out warnings

2020-11-27 Thread Jason Friedman
The Box API is noisy ... very helpful for diagnosing, and yet for production code I'd like less noise. I tried this: warnings.filterwarnings( action='ignore', # category=Warning, # module=r'boxsdk.*' ) but I still see this: WARNING:boxsdk.network.default_network:"POST https://api.bo

Re: try/except in loop

2020-11-27 Thread Cameron Simpson
I had to do this with a different API the toehr year, and made this method: def auth_token(self): ''' Obtain a current auth token [...] Refreshes the cached token if stale. ''' while True: with self._auth_token_lock: token = self

Re: try/except in loop

2020-11-27 Thread Jason Friedman
> > >> I'm using the Box API ( >> https://developer.box.com/guides/tooling/sdks/python/). >> I can get an access token, though it expires after a certain amount of >> time. My plan is to store the access token on the filesystem and use it >> until it expires, then fetch a new one. In the example be

Re: try/except in loop

2020-11-27 Thread Bob Gailer
On Fri, Nov 27, 2020, 6:06 PM Jason Friedman wrote: > I'm using the Box API ( > https://developer.box.com/guides/tooling/sdks/python/). > I can get an access token, though it expires after a certain amount of > time. My plan is to store the access token on the filesystem and use it > until it exp

Re: Cannot marshal objects

2020-11-27 Thread Skip Montanaro
> Because the marshaling is happening in the guts of xmlrpc. Okay, I misunderstood your original message. You used the word "marshal" (and the xmlrpc error did as well). I thought you were referring to the marshal module. I didn't understand (and ignored) the references to the xmlrpc module. In Py

try/except in loop

2020-11-27 Thread Jason Friedman
I'm using the Box API (https://developer.box.com/guides/tooling/sdks/python/). I can get an access token, though it expires after a certain amount of time. My plan is to store the access token on the filesystem and use it until it expires, then fetch a new one. In the example below assume I have an

Re: Cannot marshal objects

2020-11-27 Thread D'Arcy Cain
On 11/27/20 4:05 PM, Skip Montanaro wrote: I am getting this error. I assume you mean the email subject. It doesn't work in 3.8 either: Yes I do and that's too bad. but that's not surprising to me. The marshal module is more-or-less meant to serialize Python byte code. Pickle is more genera

Re: Environment vars

2020-11-27 Thread Bob van der Poel
On Fri, Nov 27, 2020 at 1:41 PM dn via Python-list wrote: > On 26/11/2020 05:46, Bob van der Poel wrote: > > I've got a program which accepts an optional env variable listing a > single > > or multiple directory for the app to use. I've done a bit of a search and > > see both a comma and semicolo

Re: Environment vars

2020-11-27 Thread dn via Python-list
On 26/11/2020 05:46, Bob van der Poel wrote: I've got a program which accepts an optional env variable listing a single or multiple directory for the app to use. I've done a bit of a search and see both a comma and semicolon being used/suggested as a path separator. Any consensus on which is bett

Re: Cannot marshal objects

2020-11-27 Thread Skip Montanaro
> I am getting this error. I assume you mean the email subject. It doesn't work in 3.8 either: >>> import decimal >>> d = decimal.Decimal(3.5) >>> d Decimal('3.5') >>> import marshal >>> marshal.dumps(d) Traceback (most recent call last): File "", line 1, in ValueError: unmarshallable object

Why I always have invalid error when using "pip install matplotlib" in Python 3.9

2020-11-27 Thread SONAHI
    Sent from [1]Mail for Windows 10   References Visible links 1. https://go.microsoft.com/fwlink/?LinkId=550986 -- https://mail.python.org/mailman/listinfo/python-list

Cannot marshal objects

2020-11-27 Thread D'Arcy Cain
I am getting this error. I found this recipe to fix it: from xmlrpclib import Marshaller from decimal import Decimal def dump_decimal(self, value, write): write("") write(str(value)) write("\n") Marshaller.dispatch[Decimal] = dump_decimal That seems to be for Python 2. I am ru

Regarding Regex timeout behavior to minimize CPU consumption

2020-11-27 Thread Shahique Khan
Hi Team, I have noticed if our regex sometimes does not give a result and on that time regex took more time in returning response (empty response). My Question is can we set a timeout parameter (in seconds/millisecond) with re.find or anywhere in code to avoid CPU consumption if regex takes more

Re: Dispatch table of methods with various return value types

2020-11-27 Thread Loris Bennett
dn writes: > On 19/11/2020 02:13, Loris Bennett wrote: >> dn writes: >> >> Firsty, thanks for taking the time to write such a detailed reply. > > Bitte! > > >> I have a method for manipulating the membership of groups such as: >> >>def execute(self, operation, users, group):