Repository: spack/spack

Issue:
spack create is broken on python3
```
$ spack create https://dev.gentoo.org/~vapier/dist/pax-utils-1.2.2.tar.xz
==> This looks like a URL for pax-utils
Traceback (most recent call last):
  File "/home/junghans/spack/bin/spack", line 220, in <module>
    main(sys.argv)
  File "/home/junghans/spack/bin/spack", line 216, in main
    _main(args, unknown)
  File "/home/junghans/spack/bin/spack", line 183, in _main
    return_val = command(parser, args)
  File "/home/junghans/spack/lib/spack/spack/cmd/create.py", line 628, in create
    versions, guesser = get_versions(args, name)
  File "/home/junghans/spack/lib/spack/spack/cmd/create.py", line 543, in get_versions
    keep_stage=args.keep_stage)
  File "/home/junghans/spack/lib/spack/spack/cmd/checksum.py", line 82, in get_checksums
    for v in sorted_versions]))
  File "/home/junghans/spack/lib/spack/spack/cmd/checksum.py", line 82, in <listcomp>
    for v in sorted_versions]))
TypeError: non-empty format string passed to object.__format__
```
works as expected on python2.7:
```
$ python2.7 `which spack` create https://dev.gentoo.org/~vapier/dist/pax-utils-1.2.2.tar.xz
==> This looks like a URL for pax-utils
==> Found 28 versions of pax-utils:

  1.2.2  https://dev.gentoo.org/~vapier/dist/pax-utils-1.2.2.tar.xz
```


Discussion:
And:
```
$ spack install pax-utils
==> Installing pax-utils
==> Fetching https://dev.gentoo.org/~vapier/dist/pax-utils-1.2.2.tar.xz
######################################################################## 100.0%
==> Error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfd in position 0: invalid start byte
/home/junghans/spack/lib/spack/spack/package.py:955, in do_fetch:
     923      def do_fetch(self, mirror_only=False):
     924          """
     925          Creates a stage directory and downloads the tarball for this package.
     926          Working directory will be set to the stage directory.
     927          """
     928          if not self.spec.concrete:
     929              raise ValueError("Can only fetch concrete packages.")
     930
     931          start_time = time.time()
     932          if spack.do_checksum and self.version not in self.versions:
     933              tty.warn("There is no checksum on file to fetch %s safely." %
     934                       self.spec.format('$_$@'))
     935
     936              # Ask the user whether to skip the checksum if we're
     937              # interactive, but just fail if non-interactive.
     938              ck_msg = "Add a checksum or use --no-checksum to skip this check."
     939              ignore_checksum = False
     940              if sys.stdout.isatty():
     941                  ignore_checksum = tty.get_yes_or_no("  Fetch anyway?",
     942                                                      default=False)
     943                  if ignore_checksum:
     944                      tty.msg("Fetching with no checksum.", ck_msg)
     945
     946              if not ignore_checksum:
     947                  raise FetchError("Will not fetch %s" %
     948                                   self.spec.format('$_$@'), ck_msg)
     949
     950          self.stage.fetch(mirror_only)
     951
     952          self._fetch_time = time.time() - start_time
     953
     954          if spack.do_checksum and self.version in self.versions:
  >> 955              self.stage.check()
     956
     957          self.stage.cache_local()
```
If I get a chance, I'll check out the `spack create`/`spack checksum` bug. The fetching thing should have been fixed by #3941. Are you using the latest develop?
That is dd5f4cb251f77a4d4122a4eb26f44beb68bebc92.

Resolving patch:
diff --git a/lib/spack/spack/version.py b/lib/spack/spack/version.py
--- a/lib/spack/spack/version.py
+++ b/lib/spack/spack/version.py
@@ -226,6 +226,9 @@ def __repr__(self):
     def __str__(self):
         return self.string
 
+    def __format__(self, format_spec):
+        return self.string.format(format_spec)
+
     @property
     def concrete(self):
         return self


Test patch: