Repository: conan-io/conan

Issue:
[bug] user_home_short=None doesn't work
### Environment Details (include every applicable attribute)
  * Operating System+version: Windows 10
  * Compiler+version: Visual Studio
  * Conan version: 1.26.1
  * Python version: 3.7

### Steps to reproduce (Include if Applicable)
Add `user_home_short = None` to `conan.conf`.  Conan still uses short paths for the recipes that use them.  Setting `CONAN_USER_HOME_SHORT=None` does work.

### Logs (Executed commands with output) (Include/Attach if Applicable)
```
$ conan config get
[log]
run_to_output = True        # environment CONAN_LOG_RUN_TO_OUTPUT
run_to_file = False         # environment CONAN_LOG_RUN_TO_FILE
level = 50                  # environment CONAN_LOGGING_LEVEL
print_run_commands = False  # environment CONAN_PRINT_RUN_COMMANDS

[general]
default_profile = default
compression_level = 9                 # environment CONAN_COMPRESSION_LEVEL
sysrequires_sudo = True               # environment CONAN_SYSREQUIRES_SUDO
request_timeout = 60                  # environment CONAN_REQUEST_TIMEOUT (seconds)
user_home_short = None
revisions_enabled = True

[storage]
path = ~/.conan/data

[hooks]
attribute_checker
```

```
$ export -n CONAN_USER_HOME_SHORT

$ conan info .. --paths --package-filter="protobuf*"
    ID: 6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
    BuildID: None
    export_folder: C:\Users\epederson\.conan\data\protobuf\3.6.1\bincrafters\stable\export
    source_folder: C:\.conan\c7ab61\1
    build_folder: C:\.conan\220f65\1
    package_folder: C:\.conan\93c189\1
    Remote: conan-idb-third-party=http://usdlvart01:8081/artifactory/api/conan/conan-idb-third-party
    URL: https://github.com/bincrafters/conan-protobuf
    Homepage: https://github.com/protocolbuffers/protobuf
    License: BSD-3-Clause
    Author: Bincrafters <bincrafters@gmail.com>
    Description: Protocol Buffers - Google's data interchange format
    Topics: conan, protobuf, protocol-buffers, protocol-compiler, serialization, rpc, protocol-compiler
    Recipe: Cache
    Revision: 0
    Binary: Cache
    Binary remote: conan-center
    Creation date: 2019-08-13 12:30:09
    Required by:
        conanfile.py
```


Discussion:
Thanks for reporting.

Indeed it looks like that `user_home_short` is not taken into account at all  😮  Interesting bits here in the property `short_paths_home` (https://github.com/conan-io/conan/blob/develop/conans/client/conf/__init__.py#L492), but later it is not used in when actually using the [short home for Windows](https://github.com/conan-io/conan/blob/b9789e3ab85609358af41f63d5599750b6dc14c5/conans/util/windows.py#L62).

Resolving patch:
diff --git a/conans/client/conf/__init__.py b/conans/client/conf/__init__.py
--- a/conans/client/conf/__init__.py
+++ b/conans/client/conf/__init__.py
@@ -498,6 +498,11 @@ def full_transitive_package_id(self):
     @property
     def short_paths_home(self):
         short_paths_home = get_env("CONAN_USER_HOME_SHORT")
+        if not short_paths_home:
+            try:
+                short_paths_home = self.get_item("general.user_home_short")
+            except ConanException:
+                return None
         if short_paths_home:
             current_dir = os.path.dirname(os.path.normpath(os.path.normcase(self.filename)))
             short_paths_dir = os.path.normpath(os.path.normcase(short_paths_home))


Test patch:
diff --git a/conans/test/integration/command/config_test.py b/conans/test/integration/command/config_test.py
--- a/conans/test/integration/command/config_test.py
+++ b/conans/test/integration/command/config_test.py
@@ -2,7 +2,6 @@
 import os
 import pytest
 
-
 from conans.errors import ConanException
 from conans.test.assets.genconanfile import GenConanfile
 from conans.test.utils.tools import TestClient
@@ -188,6 +187,29 @@ def test_config_home_short_home_dir_contains_cache_dir():
         assert client.cache.config.short_paths_home == short_path_home_folder
 
 
+def test_config_user_home_short_path():
+    """ When general.user_home_short is configured, short_paths MUST obey its path
+    """
+    short_folder = os.path.join(temp_folder(), "short").replace("\\", "/")
+    with environment_append({"CONAN_USER_HOME_SHORT": ""}):
+        client = TestClient()
+        client.run("config set general.user_home_short='{}'".format(short_folder))
+        client.save({"conanfile.py": GenConanfile().with_short_paths(True)})
+        client.run("create . foobar/0.1.0@user/testing")
+        assert client.cache.config.short_paths_home == short_folder
+
+
+def test_config_user_home_short_none():
+    """ When general.user_home_short is None, short_paths MUST use cache folder
+    """
+    with environment_append({"CONAN_USER_HOME_SHORT": ""}):
+        client = TestClient()
+        client.run('config set general.user_home_short=None')
+        client.save({"conanfile.py": GenConanfile().with_short_paths(True)})
+        client.run("create . foobar/0.1.0@user/testing")
+        assert client.cache.config.short_paths_home == "None"
+
+
 def test_init():
     """ config init MUST initialize conan.conf, remotes, settings and default profile
     """