Change:
Flake8 with Python 3.6 fails to build with System: 17.09pre106916. (Hummingbird) Nix version: nix-env (Nix) 1.11.9 Nixpkgs version: 17.09pre106916. Sandboxing enabled: build-use-sandbox = false
Try upgrading the pyflakes expression to the latest version
I can produce this same problem using nixpkgs commit (latest master as of this writing).

Discussion:
<ins> { stdenv, buildPythonPackage, fetchPypi, pythonOlder , mock, pytest, pytestrunner , configparser, enum34, mccabe, pycodestyle, pyflakes }: buildPythonPackage rec { name = "${pname}-${version}"; pname = "flake8"; version = "3.3.0"; src = fetchPypi { inherit pname version; sha256 = "04izn1q1lgbr408l9b3vkxqmpi6mq47bxwc0iwypb02mrxns41xr"; }; buildInputs = [ pytest mock pytestrunner ]; propagatedBuildInputs = [ pyflakes pycodestyle mccabe ] ++ stdenv.lib.optionals (pythonOlder "3.4") [ enum34 ] ++ stdenv.lib.optionals (pythonOlder "3.2") [ configparser ]; meta = with stdenv.lib; { description = "Code checking using pep8 and pyflakes"; homepage = http://pypi.python.org/pypi/flake8; license = licenses.mit; maintainers = with maintainers; [ garbas ]; }; } </ins>

<ins> { stdenv, buildPythonPackage, fetchPypi, pytest, pytestrunner }: buildPythonPackage rec { name = "${pname}-${version}"; pname = "mccabe"; version = "0.6.1"; src = fetchPypi { inherit pname version; sha256 = "07w3p1qm44hgxf3vvwz84kswpsx6s7kvaibzrsx5dzm0hli1i3fx"; }; buildInputs = [ pytest pytestrunner ]; meta = with stdenv.lib; { description = "McCabe checker, plugin for flake8"; homepage = "https://github.com/flintwork/mccabe"; license = licenses.mit; maintainers = with maintainers; [ garbas ]; }; } </ins>

<ins> { stdenv, buildPythonPackage, fetchPypi, isPyPy, unittest2 }: buildPythonPackage rec { pname = "pyflakes"; version = "1.5.0"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; sha256 = "1x1pcca4a24k4pw8x1c77sgi58cg1wl2k38mp8a25k608pzls3da"; }; buildInputs = [ unittest2 ]; doCheck = !isPyPy; meta = with stdenv.lib; { homepage = https://launchpad.net/pyflakes; description = "A simple program which checks Python source files for errors"; license = licenses.mit; maintainers = with maintainers; [ garbas ]; }; } </ins>

}; }; <del> flake8 = buildPythonPackage rec { name = "flake8-${version}"; version = "3.2.1"; src = pkgs.fetchurl { url = "mirror://pypi/f/flake8/${name}.tar.gz"; sha256 = "c7c460b5aff3a2063c798a77af18ec70af3941d35a22e2e76965e3c0e0b36055"; }; buildInputs = with self; [ pytest mock pytestrunner ]; propagatedBuildInputs = with self; [ pyflakes pycodestyle mccabe ] ++ optionals (pythonOlder "3.4") [ enum34 ] ++ optionals (pythonOlder "3.2") [ configparser ]; meta = { description = "Code checking using pep8 and pyflakes"; homepage = http://pypi.python.org/pypi/flake8; license = licenses.mit; maintainers = with maintainers; [ garbas ]; }; }; </del> <ins> flake8 = callPackage ../development/python-modules/flake8 { }; </ins> flake8-blind-except = callPackage ../development/python-modules/flake8-blind-except { };

}; <del> mccabe = buildPythonPackage (rec { name = "mccabe-0.5.3"; src = pkgs.fetchurl { url = "mirror://pypi/m/mccabe/${name}.tar.gz"; sha256 = "16293af41e7242031afd73896fef6458f4cad38201d21e28f344fff50ae1c25e"; }; buildInputs = with self; [ pytestrunner pytest ]; meta = { description = "McCabe checker, plugin for flake8"; homepage = "https://github.com/flintwork/mccabe"; license = licenses.mit; maintainers = with maintainers; [ garbas ]; }; }); </del> <ins> mccabe = callPackage ../development/python-modules/mccabe { }; </ins> mechanize = buildPythonPackage (rec { name = "mechanize-0.2.5";

}; }; <del> pyflakes = buildPythonPackage rec { pname = "pyflakes"; version = "1.3.0"; name = "${pname}-${version}"; src = pkgs.fetchurl { url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz"; sha256 = "a4f93317c97a9d9ed71d6ecfe08b68e3de9fea3f4d94dcd1d9d83ccbf929bc31"; }; buildInputs = with self; [ unittest2 ]; doCheck = !isPyPy; force-rebuild = 1;  # fix transient test suite error at http://hydra.nixos.org/build/45083762 meta = { homepage = https://launchpad.net/pyflakes; description = "A simple program which checks Python source files for errors"; license = licenses.mit; maintainers = with maintainers; [ garbas ]; }; }; </del> <ins> pyflakes = callPackage ../development/python-modules/pyflakes { }; </ins> pyftgl = buildPythonPackage rec { name = "pyftgl-0.4b";