Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29370859: Issue 4767 - Improve error reporting in update_update_manifests (Closed)

Created:
Jan. 8, 2017, 7:24 p.m. by f.lopez
Modified:
Jan. 17, 2017, 10:30 a.m.
Visibility:
Public.

Description

Issue 4767 - Improve error reporting in update_update_manifests

Patch Set 1 #

Patch Set 2 : Fix mistake while uploading the patchset #

Total comments: 3

Patch Set 3 : For comments 3 to 5 by jon #

Total comments: 2

Patch Set 4 : For comments 7 and 8 by vasily #

Patch Set 5 : For comments 9 and 10 #

Total comments: 2

Patch Set 6 : For comment 13 #

Total comments: 1

Patch Set 7 : For comment 16 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -2 lines) Patch
M sitescripts/extensions/utils.py View 1 2 3 4 5 6 2 chunks +17 lines, -2 lines 4 comments Download

Messages

Total messages: 27
f.lopez
Jan. 8, 2017, 7:24 p.m. (2017-01-08 19:24:09 UTC) #1
f.lopez
Jan. 8, 2017, 7:26 p.m. (2017-01-08 19:26:04 UTC) #2
Jon Sonesen
On 2017/01/08 19:26:04, f.lopez wrote: Hi Paco, Thank you for working on this! Looks like ...
Jan. 9, 2017, 7:48 a.m. (2017-01-09 07:48:11 UTC) #3
Jon Sonesen
https://codereview.adblockplus.org/29370859/diff/29370862/sitescripts/extensions/utils.py File sitescripts/extensions/utils.py (right): https://codereview.adblockplus.org/29370859/diff/29370862/sitescripts/extensions/utils.py#newcode326 sitescripts/extensions/utils.py:326: print "Error found while parsing xml from %s link" ...
Jan. 9, 2017, 7:48 a.m. (2017-01-09 07:48:22 UTC) #4
Jon Sonesen
Also could you please add Vasily as a reviewer? or at least CC him? https://codereview.adblockplus.org/29370859/diff/29370862/sitescripts/extensions/utils.py ...
Jan. 9, 2017, 8:44 a.m. (2017-01-09 08:44:11 UTC) #5
f.lopez
Jan. 9, 2017, 6:35 p.m. (2017-01-09 18:35:15 UTC) #6
Vasily Kuznetsov
https://codereview.adblockplus.org/29370859/diff/29370940/sitescripts/extensions/utils.py File sitescripts/extensions/utils.py (right): https://codereview.adblockplus.org/29370859/diff/29370940/sitescripts/extensions/utils.py#newcode326 sitescripts/extensions/utils.py:326: print 'Error found while parsing xml from {0} link'\ ...
Jan. 9, 2017, 9:59 p.m. (2017-01-09 21:59:54 UTC) #7
Vasily Kuznetsov
https://codereview.adblockplus.org/29370859/diff/29370940/sitescripts/extensions/utils.py File sitescripts/extensions/utils.py (right): https://codereview.adblockplus.org/29370859/diff/29370940/sitescripts/extensions/utils.py#newcode326 sitescripts/extensions/utils.py:326: print 'Error found while parsing xml from {0} link'\ ...
Jan. 9, 2017, 10:01 p.m. (2017-01-09 22:01:12 UTC) #8
f.lopez
Jan. 9, 2017, 10:39 p.m. (2017-01-09 22:39:00 UTC) #9
f.nicolaisen
https://codereview.adblockplus.org/29370859/diff/29370862/sitescripts/extensions/utils.py File sitescripts/extensions/utils.py (right): https://codereview.adblockplus.org/29370859/diff/29370862/sitescripts/extensions/utils.py#newcode326 sitescripts/extensions/utils.py:326: print "Error found while parsing xml from %s link" ...
Jan. 10, 2017, 8:58 a.m. (2017-01-10 08:58:04 UTC) #10
Jon Sonesen
On 2017/01/10 08:58:04, f.nicolaisen wrote: > https://codereview.adblockplus.org/29370859/diff/29370862/sitescripts/extensions/utils.py > File sitescripts/extensions/utils.py (right): > > https://codereview.adblockplus.org/29370859/diff/29370862/sitescripts/extensions/utils.py#newcode326 > ...
Jan. 10, 2017, 9:58 a.m. (2017-01-10 09:58:53 UTC) #11
f.lopez
Jan. 11, 2017, 11:31 p.m. (2017-01-11 23:31:09 UTC) #12
Vasily Kuznetsov
Hi Paco, Right direction for handling the parsing errors but there are a few issues ...
Jan. 12, 2017, 11:12 a.m. (2017-01-12 11:12:32 UTC) #13
f.lopez
Jan. 13, 2017, 3:38 p.m. (2017-01-13 15:38:27 UTC) #14
f.nicolaisen
LGTM
Jan. 13, 2017, 3:40 p.m. (2017-01-13 15:40:19 UTC) #15
Vasily Kuznetsov
Hi Paco, The error handling for parsing looks good. What about `_urlopen`? Maybe it would ...
Jan. 13, 2017, 6:12 p.m. (2017-01-13 18:12:11 UTC) #16
f.nicolaisen
On 2017/01/13 18:12:11, Vasily Kuznetsov wrote: > Hi Paco, > > The error handling for ...
Jan. 13, 2017, 6:59 p.m. (2017-01-13 18:59:12 UTC) #17
f.lopez
On 2017/01/13 18:12:11, Vasily Kuznetsov wrote: > Hi Paco, > > The error handling for ...
Jan. 13, 2017, 7:23 p.m. (2017-01-13 19:23:57 UTC) #18
f.lopez
Jan. 15, 2017, 7:32 p.m. (2017-01-15 19:32:29 UTC) #19
Vasily Kuznetsov
On 2017/01/15 19:32:29, f.lopez wrote: LGTM
Jan. 15, 2017, 9:09 p.m. (2017-01-15 21:09:42 UTC) #20
Jon Sonesen
On 2017/01/15 21:09:42, Vasily Kuznetsov wrote: > On 2017/01/15 19:32:29, f.lopez wrote: > > LGTM ...
Jan. 15, 2017, 9:20 p.m. (2017-01-15 21:20:55 UTC) #21
Sebastian Noack
https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensions/utils.py File sitescripts/extensions/utils.py (right): https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensions/utils.py#newcode264 sitescripts/extensions/utils.py:264: page.close() The close() should have gone into a finally ...
Jan. 17, 2017, 9:33 a.m. (2017-01-17 09:33:32 UTC) #22
Vasily Kuznetsov
On 2017/01/17 09:33:32, Sebastian Noack wrote: > https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensions/utils.py > File sitescripts/extensions/utils.py (right): > > https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensions/utils.py#newcode264 ...
Jan. 17, 2017, 10:02 a.m. (2017-01-17 10:02:49 UTC) #23
Vasily Kuznetsov
On 2017/01/17 10:02:49, Vasily Kuznetsov wrote: > On 2017/01/17 09:33:32, Sebastian Noack wrote: > > ...
Jan. 17, 2017, 10:07 a.m. (2017-01-17 10:07:00 UTC) #24
Sebastian Noack
https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensions/utils.py File sitescripts/extensions/utils.py (right): https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensions/utils.py#newcode264 sitescripts/extensions/utils.py:264: page.close() On 2017/01/17 10:02:49, Vasily Kuznetsov wrote: > On ...
Jan. 17, 2017, 10:16 a.m. (2017-01-17 10:16:56 UTC) #25
Sebastian Noack
https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensions/utils.py File sitescripts/extensions/utils.py (right): https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensions/utils.py#newcode264 sitescripts/extensions/utils.py:264: page.close() On 2017/01/17 10:07:00, Vasily Kuznetsov wrote: > On ...
Jan. 17, 2017, 10:20 a.m. (2017-01-17 10:20:15 UTC) #26
Vasily Kuznetsov
Jan. 17, 2017, 10:30 a.m. (2017-01-17 10:30:34 UTC) #27
Message was sent while issue was closed.
https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensi...
File sitescripts/extensions/utils.py (right):

https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensi...
sitescripts/extensions/utils.py:264: page.close()
On 2017/01/17 10:20:15, Sebastian Noack wrote:
> On 2017/01/17 10:07:00, Vasily Kuznetsov wrote:
> > On 2017/01/17 10:02:49, Vasily Kuznetsov wrote:
> > > On 2017/01/17 09:33:32, Sebastian Noack wrote:
> > > >
> > >
> >
>
https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensi...
> > > > File sitescripts/extensions/utils.py (right):
> > > > 
> > > >
> > >
> >
>
https://codereview.adblockplus.org/29370859/diff/29371813/sitescripts/extensi...
> > > > sitescripts/extensions/utils.py:264: page.close()
> > > > The close() should have gone into a finally block, or even better using
> the
> > > with
> > > > statement:
> > > > 
> > > >   with contextlib.closing(_urlopen(url)) as page:
> > > >       content = page.read()
> > > 
> > > AFAIK, Paco tried it but the return value of urlopen doesn't support
context
> > > manager protocol so it doesn't work.
> > 
> > Ah, sorry, I didn't realize that you're proposing to use contextlib.closing.
> > That would work, but I thought that it's too much overhead (you need to
import
> > contextlib, etc). Perhaps you're right though, as the result is more
reliable
> > and at least the code itself doesn't seem too "heavy".
> 
> Well, alternatively you could use try-finally. But IMO, the with-statement is
> nicer. For reference, here is how we did it in jsHydra where we support both
> Python 2+3: https://hg.adblockplus.org/jshydra/file/tip/abp_rewrite.py#l11

Yeah, with is nicer, especially having Python 3 in mind.

Powered by Google App Engine
This is Rietveld