Error with "chrome\common\extensions\docs\server2\patched_file_system.py"

15 views
Skip to first unread message

Tom Cassiotis

unread,
May 17, 2013, 1:57:57 PM5/17/13
to chromi...@chromium.org
I am getting the following error on a 'git cl upload'.  patched_file_system.py was added 4 days ago as part of r199727.

The "path for " looks wrong and should be deleted, but I'm not familiar with python.

Should I post an issue or is this something on my end?

Traceback (most recent call last):
  File "docs\server2\integration_test.py", line 20, in <module>
    from handler import Handler
  File "D:\dev\chromium_git\src\chrome\common\extensions\docs\server2\handler.py", line 7, in <module>
    from patch_servlet import PatchServlet
  File "D:\dev\chromium_git\src\chrome\common\extensions\docs\server2\patch_servlet.py", line 19, in <module>
    from patched_file_system import PatchedFileSystem
  File "D:\dev\chromium_git\src\chrome\common\extensions\docs\server2\patched_file_system.py", line 51
    dir_paths = {path for path in paths if path.endswith('/')}
                        ^
SyntaxError: invalid syntax

** Presubmit ERRORS **
IntegrationTest failed!

Roland McGrath

unread,
May 17, 2013, 2:01:57 PM5/17/13
to tom.ca...@gmail.com, chromium-dev
That syntax is valid in Python 2.7 but not in 2.6.
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>
>
>

Justin Dewitt

unread,
May 17, 2013, 2:05:50 PM5/17/13
to tom.ca...@gmail.com, chromi...@chromium.org, kal...@chromium.org
+kalman

I think that the version of Python that ships with depot_tools on Windows doesn't support the dict comprehension syntax.  I had been working with kalman on fixing that but it got put on my backburner.  I'll start looking into that again now.  If you intend to git cl upload you may need to skip the presubmit checks (--bypass-hooks), or use a box with Python 2.7 until this is fixed.

Justin

D:\src\src>python --version
Python 2.6.4


On Fri, May 17, 2013 at 10:57 AM, Tom Cassiotis <tom.ca...@gmail.com> wrote:

--

Tom Cassiotis

unread,
May 17, 2013, 2:11:41 PM5/17/13
to chromi...@chromium.org, tom.ca...@gmail.com, kal...@chromium.org
Thanks for the help.

I just read that Python 2.74 on Windows was added to depot_tools then rolled out.

(That is some wacky syntax though)

Marc-Antoine Ruel

unread,
May 17, 2013, 2:52:18 PM5/17/13
to dew...@chromium.org, tom.ca...@gmail.com, chromium-dev, Benjamin Kalman
2013/5/17 Justin Dewitt <dew...@chromium.org>
+kalman

I think that the version of Python that ships with depot_tools on Windows doesn't support the dict comprehension syntax.  I had been working with kalman on fixing that but it got put on my backburner.

Do not break 2.6.x support until chromium requires 2.7.x. Do not put that on your backburner, you are actively breaking other developers.

Upgrading to Windows user to 2.7.x is tricky due to a gclient runhooks bug that only happens on 2.7.x on Windows. Because of that the deployment has to be delayed a bit.

Dict comprehension are not wacky syntax, I'm eager to be able to use them too but please use dict() in the meantime.

Thanks,

M-A

Justin Dewitt

unread,
May 17, 2013, 2:56:09 PM5/17/13
to Marc-Antoine Ruel, tom.ca...@gmail.com, chromium-dev, Benjamin Kalman
The fix has been committed as r200860

Justin

Benjamin Kalman

unread,
May 17, 2013, 3:04:10 PM5/17/13
to dew...@chromium.org, Marc-Antoine Ruel, tom.ca...@gmail.com, chromium-dev
Sorry everybody, it wasn't deliberate. I'm not up to speed with what is python 2.x and what is 2.(x+n).

Marc-Antoine Ruel

unread,
May 17, 2013, 3:09:27 PM5/17/13
to Benjamin Kalman, dewittj, tom.cassiotis, chromium-dev
No problem, what is not tested in CI is bound to break. We don't expect devs to know all of the intricacies of python features.

M-A


2013/5/17 Benjamin Kalman <kal...@chromium.org>
Reply all
Reply to author
Forward
0 new messages