problem w/ pydrive

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

problem w/ pydrive

duplicity-talk mailing list
I'm trying to use pydrive to backup to google drive and it's throwing the following:
doug@ReturnOfTheMac ~ » duply googledrive backup --force --asynchronous-upload --full-if-older-than 1W
Start duply v2.0.1, time is 2017-02-28 07:54:37.
Using profile '/Users/doug/.duply/googledrive'.
Using installed duplicity version 0.7.11, python 2.7.13, gpg 2.0.30 (Home: ~/.gnupg), awk 'awk version 20070501', grep 'grep (BSD grep) 2.5.1-FreeBSD', bash '3.2.57(1)-release (x86_64-apple-darwin16)'.
Checking TEMP_DIR '/Users/doug/.cache/tmp' is a folder and writable (OK)
Test - En/Decryption skipped. (GPG disabled)

--- Start running command PRE at 07:54:44.388 ---
Running '/Users/doug/.duply/googledrive/pre' - OK
--- Finished state OK at 07:54:44.506 - Runtime 00:00:00.118 ---

--- Start running command BKP at 07:54:44.552 ---
Using archive dir: /Users/doug/.cache/duplicity/duply_googledrive
Using backup name: duply_googledrive
Import of duplicity.backends.acdclibackend Succeeded
Import of duplicity.backends.azurebackend Succeeded
Import of duplicity.backends.b2backend Succeeded
Import of duplicity.backends.botobackend Succeeded
Import of duplicity.backends.cfbackend Succeeded
Import of duplicity.backends.copycombackend Succeeded
Import of duplicity.backends.dpbxbackend Succeeded
Import of duplicity.backends.gdocsbackend Succeeded
Import of duplicity.backends.giobackend Succeeded
Import of duplicity.backends.hsibackend Succeeded
Import of duplicity.backends.hubicbackend Succeeded
Import of duplicity.backends.imapbackend Succeeded
Import of duplicity.backends.lftpbackend Succeeded
Import of duplicity.backends.localbackend Succeeded
Import of duplicity.backends.mediafirebackend Succeeded
Import of duplicity.backends.megabackend Succeeded
Import of duplicity.backends.multibackend Succeeded
Import of duplicity.backends.ncftpbackend Succeeded
Import of duplicity.backends.onedrivebackend Succeeded
Import of duplicity.backends.par2backend Succeeded
Import of duplicity.backends.pydrivebackend Succeeded
Import of duplicity.backends.rsyncbackend Succeeded
Import of duplicity.backends.ssh_paramiko_backend Succeeded
Import of duplicity.backends.ssh_pexpect_backend Succeeded
Import of duplicity.backends.swiftbackend Succeeded
Import of duplicity.backends.sxbackend Succeeded
Import of duplicity.backends.tahoebackend Succeeded
Import of duplicity.backends.webdavbackend Succeeded
Using temporary directory /Users/doug/.cache/tmp/duplicity-kRJfEB-tempdir
Backend error detail: Traceback (most recent call last):
  File "/usr/local/bin/duplicity", line 1546, in <module>
    with_tempdir(main)
  File "/usr/local/bin/duplicity", line 1540, in with_tempdir
    fn()
  File "/usr/local/bin/duplicity", line 1375, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/commandline.py", line 1126, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/commandline.py", line 1015, in set_backend
    globals.backend = backend.get_backend(bend)
  File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/backends/pydrivebackend.py", line 40, in __init__
    raise BackendException('PyDrive backend requires PyDrive installation'
BackendException: PyDrive backend requires PyDrive installationPlease read the manpage to fix.

BackendException: PyDrive backend requires PyDrive installationPlease read the manpage to fix.
07:54:52.288 Task 'BKP' failed with exit code '23'.
--- Finished state FAILED 'code 23' at 07:54:52.288 - Runtime 00:00:07.735 ---

--- Start running command POST at 07:54:52.347 ---
Running '/Users/doug/.duply/googledrive/post' - OK
--- Finished state OK at 07:54:52.445 - Runtime 00:00:00.097 ---
doug@ReturnOfTheMac ~ »

I'm on OSX Sierra. I installed duply 2.0.1 via brew (which installed duplicity 0.7.11), and then installed pydrive via pip:
doug@ReturnOfTheMac ~ » pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
google-api-python-client (1.6.2)
httplib2 (0.10.3)
oauth2client (4.0.0)
pandocfilters (1.3.0)
pip (9.0.1)
psycopg2 (2.6.2)
pyasn1 (0.2.3)
pyasn1-modules (0.0.8)
PyDrive (1.3.1)
PyYAML (3.12)
requests (2.11.1)
rsa (3.4.2)
setuptools (32.1.0)
six (1.10.0)
uritemplate (3.0.0)
wheel (0.29.0)

My config:
doug@ReturnOfTheMac ~/repos/mine/dotfiles/common/duply/googledrive ±master » egrep -v '^#|^$' conf
GPG_KEY='disabled'
GPG_PW='_GPG_PASSWORD_'
TARGET='gdocs://doug.hunley@.../backup'
GOOGLE_DRIVE_SETTINGS=/Users/doug/.duply/googledrive/pydrive
SOURCE='/Users/doug'
FILENAME='.duplicity-ignore'
DUPL_PARAMS="$DUPL_PARAMS --exclude-if-present '$FILENAME'"
MAX_AGE=1M
MAX_FULL_BACKUPS=1
MAX_FULLS_WITH_INCRS=1
VERBOSITY=9
TEMP_DIR=/Users/doug/.cache/tmp

And the contents of 'pydrive':
doug@ReturnOfTheMac ~/repos/mine/dotfiles/common/duply/googledrive ±master » cat pydrive
client_config_backend: settings
client_config:
  client_secret: XXXX
save_credentials: True
save_credentials_backend: file
save_credentials_file: /Users/doug/.duply/googledrive/authdata.json
get_refresh_token: True

Everything I've seen via Google (use an older of X, use a different version of Y, etc) has not helped. Any pointers?
--
{
  "name": "douglas j hunley",
  "email": "[hidden email]",
  "social": [
    {
        "blog": "https://hunleyd.github.io/",
        "twitter": "@hunleyd"
    }
   ]
}

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
On 28.02.2017 14:03, Douglas J Hunley via Duplicity-talk wrote:

> I'm trying to use pydrive to backup to google drive and it's throwing the following:
> doug@ReturnOfTheMac ~ » duply googledrive backup --force --asynchronous-upload --full-if-older-than 1W
> Start duply v2.0.1, time is 2017-02-28 07:54:37.
> Using profile '/Users/doug/.duply/googledrive'.
> Using installed duplicity version 0.7.11, python 2.7.13, gpg 2.0.30 (Home: ~/.gnupg), awk 'awk version 20070501', grep 'grep (BSD grep) 2.5.1-FreeBSD', bash '3.2.57(1)-release (x86_64-apple-darwin16)'.
> Checking TEMP_DIR '/Users/doug/.cache/tmp' is a folder and writable (OK)
> Test - En/Decryption skipped. (GPG disabled)
>
> --- Start running command PRE at 07:54:44.388 ---
> Running '/Users/doug/.duply/googledrive/pre' - OK
> --- Finished state OK at 07:54:44.506 - Runtime 00:00:00.118 ---
>
> --- Start running command BKP at 07:54:44.552 ---
> Using archive dir: /Users/doug/.cache/duplicity/duply_googledrive
> Using backup name: duply_googledrive
> Import of duplicity.backends.acdclibackend Succeeded
> Import of duplicity.backends.azurebackend Succeeded
> Import of duplicity.backends.b2backend Succeeded
> Import of duplicity.backends.botobackend Succeeded
> Import of duplicity.backends.cfbackend Succeeded
> Import of duplicity.backends.copycombackend Succeeded
> Import of duplicity.backends.dpbxbackend Succeeded
> Import of duplicity.backends.gdocsbackend Succeeded
> Import of duplicity.backends.giobackend Succeeded
> Import of duplicity.backends.hsibackend Succeeded
> Import of duplicity.backends.hubicbackend Succeeded
> Import of duplicity.backends.imapbackend Succeeded
> Import of duplicity.backends.lftpbackend Succeeded
> Import of duplicity.backends.localbackend Succeeded
> Import of duplicity.backends.mediafirebackend Succeeded
> Import of duplicity.backends.megabackend Succeeded
> Import of duplicity.backends.multibackend Succeeded
> Import of duplicity.backends.ncftpbackend Succeeded
> Import of duplicity.backends.onedrivebackend Succeeded
> Import of duplicity.backends.par2backend Succeeded
> Import of duplicity.backends.pydrivebackend Succeeded
> Import of duplicity.backends.rsyncbackend Succeeded
> Import of duplicity.backends.ssh_paramiko_backend Succeeded
> Import of duplicity.backends.ssh_pexpect_backend Succeeded
> Import of duplicity.backends.swiftbackend Succeeded
> Import of duplicity.backends.sxbackend Succeeded
> Import of duplicity.backends.tahoebackend Succeeded
> Import of duplicity.backends.webdavbackend Succeeded
> Using temporary directory /Users/doug/.cache/tmp/duplicity-kRJfEB-tempdir
> Backend error detail: Traceback (most recent call last):
>   File "/usr/local/bin/duplicity", line 1546, in <module>
>     with_tempdir(main)
>   File "/usr/local/bin/duplicity", line 1540, in with_tempdir
>     fn()
>   File "/usr/local/bin/duplicity", line 1375, in main
>     action = commandline.ProcessCommandLine(sys.argv[1:])
>   File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/commandline.py", line 1126, in ProcessCommandLine
>     backup, local_pathname = set_backend(args[0], args[1])
>   File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/commandline.py", line 1015, in set_backend
>     globals.backend = backend.get_backend(bend)
>   File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/backend.py", line 223, in get_backend
>     obj = get_backend_object(url_string)
>   File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/backend.py", line 209, in get_backend_object
>     return factory(pu)
>   File "/usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/backends/pydrivebackend.py", line 40, in __init__
>     raise BackendException('PyDrive backend requires PyDrive installation'
> BackendException: PyDrive backend requires PyDrive installationPlease read the manpage to fix.
>
> BackendException: PyDrive backend requires PyDrive installationPlease read the manpage to fix.
> 07:54:52.288 Task 'BKP' failed with exit code '23'.
> --- Finished state FAILED 'code 23' at 07:54:52.288 - Runtime 00:00:07.735 ---
>
> --- Start running command POST at 07:54:52.347 ---
> Running '/Users/doug/.duply/googledrive/post' - OK
> --- Finished state OK at 07:54:52.445 - Runtime 00:00:00.097 ---
> doug@ReturnOfTheMac ~ »
>
> I'm on OSX Sierra. I installed duply 2.0.1 via brew (which installed duplicity 0.7.11), and then installed pydrive via pip:
> doug@ReturnOfTheMac ~ » pip list
> DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
> google-api-python-client (1.6.2)
> httplib2 (0.10.3)
> oauth2client (4.0.0)
> pandocfilters (1.3.0)
> pip (9.0.1)
> psycopg2 (2.6.2)
> pyasn1 (0.2.3)
> pyasn1-modules (0.0.8)
> PyDrive (1.3.1)
> PyYAML (3.12)
> requests (2.11.1)
> rsa (3.4.2)
> setuptools (32.1.0)
> six (1.10.0)
> uritemplate (3.0.0)
> wheel (0.29.0)
>
> My config:
> doug@ReturnOfTheMac ~/repos/mine/dotfiles/common/duply/googledrive ±master » egrep -v '^#|^$' conf
> GPG_KEY='disabled'
> GPG_PW='_GPG_PASSWORD_'
> TARGET='gdocs://[hidden email]/backup <http://doug.hunley@.../backup>'
> GOOGLE_DRIVE_SETTINGS=/Users/doug/.duply/googledrive/pydrive
> SOURCE='/Users/doug'
> FILENAME='.duplicity-ignore'
> DUPL_PARAMS="$DUPL_PARAMS --exclude-if-present '$FILENAME'"
> MAX_AGE=1M
> MAX_FULL_BACKUPS=1
> MAX_FULLS_WITH_INCRS=1
> VERBOSITY=9
> TEMP_DIR=/Users/doug/.cache/tmp
>
> And the contents of 'pydrive':
> doug@ReturnOfTheMac ~/repos/mine/dotfiles/common/duply/googledrive ±master » cat pydrive
> client_config_backend: settings
> client_config:
>   client_id: XXXX.apps.googleusercontent.com <http://XXXX.apps.googleusercontent.com>
>   client_secret: XXXX
> save_credentials: True
> save_credentials_backend: file
> save_credentials_file: /Users/doug/.duply/googledrive/authdata.json
> get_refresh_token: True
>
> Everything I've seen via Google (use an older of X, use a different version of Y, etc) has not helped. Any pointers?

try replacing /usr/local/Cellar/duplicity/0.7.11/libexec/lib/python2.7/site-packages/duplicity/backends/pydrivebackend.py", line 39-40, in __init__

OLD:

except ImportError:
            raise BackendException('PyDrive backend requires PyDrive installation'
                                   'Please read the manpage to fix.')
NEW:

except ImportError as error:
            raise error

to see what the actual error really is. that should get you further. keep indention as it was before.

..ede/duply.net

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list

On Tue, Feb 28, 2017 at 9:01 AM, edgar.soldin--- via Duplicity-talk <[hidden email]> wrote:
except ImportError as error:
            raise error

to see what the actual error really is. that should get you further. keep indention as it was before.

This was what I needed, thank you. I had to adjust PYTHONPATH for it to see the modules that I had pip installed.


--
{
  "name": "douglas j hunley",
  "email": "[hidden email]",
  "social": [
    {
        "blog": "https://hunleyd.github.io/",
        "twitter": "@hunleyd"
    }
   ]
}

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
On 28.02.2017 17:59, Douglas J Hunley wrote:

> On Tue, Feb 28, 2017 at 9:01 AM, edgar.soldin--- via Duplicity-talk <
> [hidden email]> wrote:
>
>> except ImportError as error:
>>             raise error
>>
>> to see what the actual error really is. that should get you further. keep
>> indention as it was before.
>>
>
> This was what I needed, thank you. I had to adjust PYTHONPATH for it to see
> the modules that I had pip installed.
>
>

would you agree that the error should be visible, instead of the vague message?

Ken: is there a way to keep the originating error stack but wrap it in a BackendException with a new message?

..ede/duply.net

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list

On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email]> wrote:
would you agree that the error should be visible, instead of the vague message?

Good lord yes! :)


--
{
  "name": "douglas j hunley",
  "email": "[hidden email]",
  "social": [
    {
        "blog": "https://hunleyd.github.io/",
        "twitter": "@hunleyd"
    }
   ]
}

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
Edgar, I've see it done, so yes.

Douglas, could you report this as a bug?

...Thanks,
...Ken 


On Tue, Feb 28, 2017 at 1:18 PM Douglas J Hunley <[hidden email]> wrote:

On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email]> wrote:
would you agree that the error should be visible, instead of the vague message?

Good lord yes! :)



--
{
  "name": "douglas j hunley",
  "email": "[hidden email]",
  "social": [
    {
        "blog": "https://hunleyd.github.io/",
        "twitter": "@hunleyd"
    }
   ]
}

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list

On Tue, Feb 28, 2017 at 2:52 PM, Kenneth Loafman <[hidden email]> wrote:
Douglas, could you report this as a bug?

Bug #1668750 


--
{
  "name": "douglas j hunley",
  "email": "[hidden email]",
  "social": [
    {
        "blog": "https://hunleyd.github.io/",
        "twitter": "@hunleyd"
    }
   ]
}

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
In reply to this post by duplicity-talk mailing list
Ken,

any hint on how? something like this
  http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python
?

easiest would be probably to simply get rid of the try catch, but then we would loose the "check the manpage" text.

..ede

On 28.02.2017 20:52, Kenneth Loafman wrote:

> Edgar, I've see it done, so yes.
>
> Douglas, could you report this as a bug?
>
> ...Thanks,
> ...Ken
>
>
> On Tue, Feb 28, 2017 at 1:18 PM Douglas J Hunley <[hidden email]>
> wrote:
>
>>
>> On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email]> wrote:
>>
>> would you agree that the error should be visible, instead of the vague
>> message?
>>
>>
>> Good lord yes! :)
>>
>>
>>
>> --
>> {
>>   "name": "douglas j hunley",
>>   "email": "[hidden email]",
>>   "social": [
>>     {
>>         "blog": "https://hunleyd.github.io/",
>>         "twitter": "@hunleyd"
>>     }
>>    ]
>> }
>>
>

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
ede,

More like the following:

try:
    import foo
    import bar
except ImportError:
    <report import error and read manual>
    raise
except Exception as e:
    <report exception and str(e)>
    raise

...Ken


On Tue, Feb 28, 2017 at 6:25 PM, <[hidden email]> wrote:
Ken,

any hint on how? something like this
  http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python
?

easiest would be probably to simply get rid of the try catch, but then we would loose the "check the manpage" text.

..ede

On 28.02.2017 20:52, Kenneth Loafman wrote:
> Edgar, I've see it done, so yes.
>
> Douglas, could you report this as a bug?
>
> ...Thanks,
> ...Ken
>
>
> On Tue, Feb 28, 2017 at 1:18 PM Douglas J Hunley <[hidden email]>
> wrote:
>
>>
>> On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email]> wrote:
>>
>> would you agree that the error should be visible, instead of the vague
>> message?
>>
>>
>> Good lord yes! :)
>>
>>
>>
>> --
>> {
>>   "name": "douglas j hunley",
>>   "email": "[hidden email]",
>>   "social": [
>>     {
>>         "blog": "https://hunleyd.github.io/",
>>         "twitter": "@hunleyd"
>>     }
>>    ]
>> }
>>
>


_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
Correction:

try:
    import foo
    import bar
except ImportError as e:
    <report import error and read manual>
    <report exception from str(e)>
    raise
except Exception as e:
    <report exception and str(e)>
    raise

On Wed, Mar 1, 2017 at 9:07 AM, Kenneth Loafman <[hidden email]> wrote:
ede,

More like the following:

try:
    import foo
    import bar
except ImportError:
    <report import error and read manual>
    raise
except Exception as e:
    <report exception and str(e)>
    raise

...Ken


On Tue, Feb 28, 2017 at 6:25 PM, <[hidden email]> wrote:
Ken,

any hint on how? something like this
  http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python
?

easiest would be probably to simply get rid of the try catch, but then we would loose the "check the manpage" text.

..ede

On 28.02.2017 20:52, Kenneth Loafman wrote:
> Edgar, I've see it done, so yes.
>
> Douglas, could you report this as a bug?
>
> ...Thanks,
> ...Ken
>
>
> On Tue, Feb 28, 2017 at 1:18 PM Douglas J Hunley <[hidden email]>
> wrote:
>
>>
>> On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email]> wrote:
>>
>> would you agree that the error should be visible, instead of the vague
>> message?
>>
>>
>> Good lord yes! :)
>>
>>
>>
>> --
>> {
>>   "name": "douglas j hunley",
>>   "email": "[hidden email]",
>>   "social": [
>>     {
>>         "blog": "https://hunleyd.github.io/",
>>         "twitter": "@hunleyd"
>>     }
>>    ]
>> }
>>
>



_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
hey Ken,

i assume that <report ...> is pseudo code for printing the error w/ stack, or? why is that more elegant than rewrapping the error stack and have the calling code deal w/ the exception?

but why catch it at all, if an init error fails the backend anyway?

..ede

On 01.03.2017 16:16, Kenneth Loafman wrote:

> Correction:
>
> try:
>     import foo
>     import bar
> except ImportError as e:
>     <report import error and read manual>
>     <report exception from str(e)>
>     raise
> except Exception as e:
>     <report exception and str(e)>
>     raise
>
> On Wed, Mar 1, 2017 at 9:07 AM, Kenneth Loafman <[hidden email] <mailto:[hidden email]>> wrote:
>
>     ede,
>
>     More like the following:
>
>     try:
>         import foo
>         import bar
>     except ImportError:
>         <report import error and read manual>
>         raise
>     except Exception as e:
>         <report exception and str(e)>
>         raise
>
>     ...Ken
>
>
>     On Tue, Feb 28, 2017 at 6:25 PM, <[hidden email] <mailto:[hidden email]>> wrote:
>
>         Ken,
>
>         any hint on how? something like this
>           http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python <http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python>
>         ?
>
>         easiest would be probably to simply get rid of the try catch, but then we would loose the "check the manpage" text.
>
>         ..ede
>
>         On 28.02.2017 20:52, Kenneth Loafman wrote:
>         > Edgar, I've see it done, so yes.
>         >
>         > Douglas, could you report this as a bug?
>         >
>         > ...Thanks,
>         > ...Ken
>         >
>         >
>         > On Tue, Feb 28, 2017 at 1:18 PM Douglas J Hunley <[hidden email] <mailto:[hidden email]>>
>         > wrote:
>         >
>         >>
>         >> On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email] <mailto:[hidden email]>> wrote:
>         >>
>         >> would you agree that the error should be visible, instead of the vague
>         >> message?
>         >>
>         >>
>         >> Good lord yes! :)
>         >>
>         >>
>         >>
>         >> --
>         >> {
>         >>   "name": "douglas j hunley",
>         >>   "email": "[hidden email] <mailto:[hidden email]>",
>         >>   "social": [
>         >>     {
>         >>         "blog": "https://hunleyd.github.io/",
>         >>         "twitter": "@hunleyd"
>         >>     }
>         >>    ]
>         >> }
>         >>
>         >
>
>
>

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
You are correct.  Within __init__() a failure would cause the backend class to fail and produce a traceback.  Since the class is not initialized unless used, removing the try/except would cause no harm.  Then backend.py could catch the error in get_backend_object:208.  [Why is it looking for an ImportError there since the importing is done in import_backends:80.  Maybe some dead code?]


On Wed, Mar 1, 2017 at 9:27 AM, <[hidden email]> wrote:
hey Ken,

i assume that <report ...> is pseudo code for printing the error w/ stack, or? why is that more elegant than rewrapping the error stack and have the calling code deal w/ the exception?

but why catch it at all, if an init error fails the backend anyway?

..ede

On 01.03.2017 16:16, Kenneth Loafman wrote:
> Correction:
>
> try:
>     import foo
>     import bar
> except ImportError as e:
>     <report import error and read manual>
>     <report exception from str(e)>
>     raise
> except Exception as e:
>     <report exception and str(e)>
>     raise
>
> On Wed, Mar 1, 2017 at 9:07 AM, Kenneth Loafman <[hidden email] <mailto:[hidden email]>> wrote:
>
>     ede,
>
>     More like the following:
>
>     try:
>         import foo
>         import bar
>     except ImportError:
>         <report import error and read manual>
>         raise
>     except Exception as e:
>         <report exception and str(e)>
>         raise
>
>     ...Ken
>
>
>     On Tue, Feb 28, 2017 at 6:25 PM, <[hidden email] <mailto:[hidden email]>> wrote:
>
>         Ken,
>
>         any hint on how? something like this
>           http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python <http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python>
>         ?
>
>         easiest would be probably to simply get rid of the try catch, but then we would loose the "check the manpage" text.
>
>         ..ede
>
>         On 28.02.2017 20:52, Kenneth Loafman wrote:
>         > Edgar, I've see it done, so yes.
>         >
>         > Douglas, could you report this as a bug?
>         >
>         > ...Thanks,
>         > ...Ken
>         >
>         >
>         > On Tue, Feb 28, 2017 at 1:18 PM Douglas J Hunley <[hidden email] <mailto:[hidden email]>>
>         > wrote:
>         >
>         >>
>         >> On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email] <mailto:[hidden email]>> wrote:
>         >>
>         >> would you agree that the error should be visible, instead of the vague
>         >> message?
>         >>
>         >>
>         >> Good lord yes! :)
>         >>
>         >>
>         >>
>         >> --
>         >> {
>         >>   "name": "douglas j hunley",
>         >>   "email": "[hidden email] <mailto:[hidden email]>",
>         >>   "social": [
>         >>     {
>         >>         "blog": "https://hunleyd.github.io/",
>         >>         "twitter": "@hunleyd"
>         >>     }
>         >>    ]
>         >> }
>         >>
>         >
>
>
>


_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
sometimes i am ;).. do you need a branch or can you quickly remove it in your working copy?

..ede

On 01.03.2017 17:06, Kenneth Loafman wrote:

> You are correct.  Within __init__() a failure would cause the backend class to fail and produce a traceback.  Since the class is not initialized unless used, removing the try/except would cause no harm.  Then backend.py could catch the error in get_backend_object:208.  [Why is it looking for an ImportError there since the importing is done in import_backends:80.  Maybe some dead code?]
>
>
> On Wed, Mar 1, 2017 at 9:27 AM, <[hidden email] <mailto:[hidden email]>> wrote:
>
>     hey Ken,
>
>     i assume that <report ...> is pseudo code for printing the error w/ stack, or? why is that more elegant than rewrapping the error stack and have the calling code deal w/ the exception?
>
>     but why catch it at all, if an init error fails the backend anyway?
>
>     ..ede
>
>     On 01.03.2017 16:16, Kenneth Loafman wrote:
>     > Correction:
>     >
>     > try:
>     >     import foo
>     >     import bar
>     > except ImportError as e:
>     >     <report import error and read manual>
>     >     <report exception from str(e)>
>     >     raise
>     > except Exception as e:
>     >     <report exception and str(e)>
>     >     raise
>     >
>     > On Wed, Mar 1, 2017 at 9:07 AM, Kenneth Loafman <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>     >
>     >     ede,
>     >
>     >     More like the following:
>     >
>     >     try:
>     >         import foo
>     >         import bar
>     >     except ImportError:
>     >         <report import error and read manual>
>     >         raise
>     >     except Exception as e:
>     >         <report exception and str(e)>
>     >         raise
>     >
>     >     ...Ken
>     >
>     >
>     >     On Tue, Feb 28, 2017 at 6:25 PM, <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>     >
>     >         Ken,
>     >
>     >         any hint on how? something like this
>     >           http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python <http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python> <http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python <http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python>>
>     >         ?
>     >
>     >         easiest would be probably to simply get rid of the try catch, but then we would loose the "check the manpage" text.
>     >
>     >         ..ede
>     >
>     >         On 28.02.2017 20:52, Kenneth Loafman wrote:
>     >         > Edgar, I've see it done, so yes.
>     >         >
>     >         > Douglas, could you report this as a bug?
>     >         >
>     >         > ...Thanks,
>     >         > ...Ken
>     >         >
>     >         >
>     >         > On Tue, Feb 28, 2017 at 1:18 PM Douglas J Hunley <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>>
>     >         > wrote:
>     >         >
>     >         >>
>     >         >> On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>     >         >>
>     >         >> would you agree that the error should be visible, instead of the vague
>     >         >> message?
>     >         >>
>     >         >>
>     >         >> Good lord yes! :)
>     >         >>
>     >         >>
>     >         >>
>     >         >> --
>     >         >> {
>     >         >>   "name": "douglas j hunley",
>     >         >>   "email": "[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>",
>     >         >>   "social": [
>     >         >>     {
>     >         >>         "blog": "https://hunleyd.github.io/",
>     >         >>         "twitter": "@hunleyd"
>     >         >>     }
>     >         >>    ]
>     >         >> }
>     >         >>
>     >         >
>     >
>     >
>     >
>
>

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: problem w/ pydrive

duplicity-talk mailing list
I can take care of it as part of bug 1668750

...Ken



On Wed, Mar 1, 2017 at 10:09 AM, <[hidden email]> wrote:
sometimes i am ;).. do you need a branch or can you quickly remove it in your working copy?

..ede

On 01.03.2017 17:06, Kenneth Loafman wrote:
> You are correct.  Within __init__() a failure would cause the backend class to fail and produce a traceback.  Since the class is not initialized unless used, removing the try/except would cause no harm.  Then backend.py could catch the error in get_backend_object:208.  [Why is it looking for an ImportError there since the importing is done in import_backends:80.  Maybe some dead code?]
>
>
> On Wed, Mar 1, 2017 at 9:27 AM, <[hidden email] <mailto:[hidden email]>> wrote:
>
>     hey Ken,
>
>     i assume that <report ...> is pseudo code for printing the error w/ stack, or? why is that more elegant than rewrapping the error stack and have the calling code deal w/ the exception?
>
>     but why catch it at all, if an init error fails the backend anyway?
>
>     ..ede
>
>     On 01.03.2017 16:16, Kenneth Loafman wrote:
>     > Correction:
>     >
>     > try:
>     >     import foo
>     >     import bar
>     > except ImportError as e:
>     >     <report import error and read manual>
>     >     <report exception from str(e)>
>     >     raise
>     > except Exception as e:
>     >     <report exception and str(e)>
>     >     raise
>     >
>     > On Wed, Mar 1, 2017 at 9:07 AM, Kenneth Loafman <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>     >
>     >     ede,
>     >
>     >     More like the following:
>     >
>     >     try:
>     >         import foo
>     >         import bar
>     >     except ImportError:
>     >         <report import error and read manual>
>     >         raise
>     >     except Exception as e:
>     >         <report exception and str(e)>
>     >         raise
>     >
>     >     ...Ken
>     >
>     >
>     >     On Tue, Feb 28, 2017 at 6:25 PM, <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>     >
>     >         Ken,
>     >
>     >         any hint on how? something like this
>     >           http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python <http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python> <http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python <http://stackoverflow.com/questions/3847503/wrapping-exceptions-in-python>>
>     >         ?
>     >
>     >         easiest would be probably to simply get rid of the try catch, but then we would loose the "check the manpage" text.
>     >
>     >         ..ede
>     >
>     >         On 28.02.2017 20:52, Kenneth Loafman wrote:
>     >         > Edgar, I've see it done, so yes.
>     >         >
>     >         > Douglas, could you report this as a bug?
>     >         >
>     >         > ...Thanks,
>     >         > ...Ken
>     >         >
>     >         >
>     >         > On Tue, Feb 28, 2017 at 1:18 PM Douglas J Hunley <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>>
>     >         > wrote:
>     >         >
>     >         >>
>     >         >> On Tue, Feb 28, 2017 at 1:51 PM, <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>     >         >>
>     >         >> would you agree that the error should be visible, instead of the vague
>     >         >> message?
>     >         >>
>     >         >>
>     >         >> Good lord yes! :)
>     >         >>
>     >         >>
>     >         >>
>     >         >> --
>     >         >> {
>     >         >>   "name": "douglas j hunley",
>     >         >>   "email": "[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>",
>     >         >>   "social": [
>     >         >>     {
>     >         >>         "blog": "https://hunleyd.github.io/",
>     >         >>         "twitter": "@hunleyd"
>     >         >>     }
>     >         >>    ]
>     >         >> }
>     >         >>
>     >         >
>     >
>     >
>     >
>
>


_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk