internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: conan-io/conan

Issue:
[bug] [test] Fix  test_case_not_existing
This test is not generating a _not existing path from the root_ in Windows, because the `os.path.abspath` introduces a leading set of directories. 

https://github.com/conan-io/conan/blob/8157e0eec594a9998fbf1d2bc1bcbe9c362aadb2/conans/test/util/unix_path_test.py#L23




Discussion:

Resolving patch:
diff --git a/conans/model/info.py b/conans/model/info.py
--- a/conans/model/info.py
+++ b/conans/model/info.py
@@ -45,14 +45,6 @@ def sha(self):
         return "/".join([str(n) for n in [self.name, self.version, self.user, self.channel,
                                           self.package_id]])
 
-    def serialize(self):
-        return str(self.package)
-
-    @staticmethod
-    def deserialize(data):
-        ret = RequirementInfo(data)
-        return ret
-
     def unrelated_mode(self):
         self.name = self.version = self.user = self.channel = self.package_id = None
 
@@ -164,17 +156,6 @@ def dumps(self):
                 result.append(dumped)
         return "\n".join(result)
 
-    def serialize(self):
-        return {str(ref): requinfo.serialize() for ref, requinfo in self._data.items()}
-
-    @staticmethod
-    def deserialize(data):
-        ret = RequirementsInfo({}, None)
-        for ref, requinfo in data.items():
-            ref = PackageReference.loads(ref)
-            ret._data[ref] = RequirementInfo.deserialize(requinfo)
-        return ret
-
     def unrelated_mode(self):
         self.clear()
 
@@ -342,16 +323,6 @@ def package_id(self):
         self._package_id = sha1('\n'.join(result).encode())
         return self._package_id
 
-    def serialize(self):
-        conan_info_json = {"settings": self.settings.serialize(),
-                           "full_settings": self.full_settings.serialize(),
-                           "options": self.options.serialize(),
-                           "full_options": self.full_options.serialize(),
-                           "requires": self.requires.serialize(),
-                           "full_requires": self.full_requires.serialize(),
-                           "recipe_hash": self.recipe_hash}
-        return conan_info_json
-
     def serialize_min(self):
         """
         This info will be shown in search results.


Test patch:
diff --git a/conans/test/util/unix_path_test.py b/conans/test/util/unix_path_test.py
--- a/conans/test/util/unix_path_test.py
+++ b/conans/test/util/unix_path_test.py
@@ -21,8 +21,8 @@ def test_case_existing(self):
         self.assertEqual(p1, get_cased_path(os.path.join(folder, "myfolder", "subfolder")))
 
     def test_case_not_existing(self):
-        non_existing_path = os.path.abspath(
-            os.path.join("this", "Path", "does", "NOT", "Exists"))
+        current_dir = get_cased_path(os.getcwd())
+        non_existing_path = os.path.join(current_dir, "this", "Path", "does", "NOT", "Exists")
         p = get_cased_path(non_existing_path)  # If not exists from the root, returns as is
         self.assertEqual(p, non_existing_path)
Repository: conan-io/conan

Issue:
Print configuration in output for install/create
I find it a bit tricky to debug and find the used settings, specially in traces of CI. And tracing back to a profile file, might still fail to see if some setting or option was overwritten in the command line.

Maybe it would be useful to print it to output for these commands.




Discussion:
Do you suggest to print the "applied" profile like the trace of cpt?

```
+------------------+
| Profile          |
|------------------|
| include(default) |
|                  |
| [settings]       |
|                  |
| [options]        |
|                  |
| [env]            |
|                  |
| [build_requires] |
+------------------+
```
Not the input profile, with ``include(default)``, but the evaluated profile. Including also command line overrides. Which could be defined for local commands from the installed ``conaninfo.txt``.
That is what I meant with "applied". Ok.

Resolving patch:
diff --git a/conans/client/manager.py b/conans/client/manager.py
--- a/conans/client/manager.py
+++ b/conans/client/manager.py
@@ -114,6 +114,8 @@ def install(self, reference, install_folder, profile, remote_name=None, build_mo
             generators = set(generators) if generators else set()
             generators.add("txt")  # Add txt generator by default
 
+        self._user_io.out.info("Configuration:")
+        self._user_io.out.writeln(profile.dumps())
         result = self._graph_manager.load_graph(reference, create_reference, profile,
                                                 build_modes, False, update, remote_name, self._recorder,
                                                 None)


Test patch:
diff --git a/conans/test/command/create_test.py b/conans/test/command/create_test.py
--- a/conans/test/command/create_test.py
+++ b/conans/test/command/create_test.py
@@ -160,6 +160,7 @@ def system_requirements(self):
         self.output.info("Running system requirements!!")
 """})
         client.run("create . Pkg/0.1@lasote/testing")
+        self.assertIn("Configuration:[settings]", "".join(str(client.out).splitlines()))
         self.assertIn("Pkg/0.1@lasote/testing: Generating the package", client.out)
         self.assertIn("Running system requirements!!", client.out)
         client.run("search")
diff --git a/conans/test/command/install_test.py b/conans/test/command/install_test.py
--- a/conans/test/command/install_test.py
+++ b/conans/test/command/install_test.py
@@ -195,6 +195,7 @@ def reuse_test(self):
                                    "3eeab577a3134fa3afdcd82881751789ec48e08f")]:
 
             self.client.run("install . -o language=%d %s --build missing" % (lang, self.settings))
+            self.assertIn("Configuration:[settings]", "".join(str(self.client.out).splitlines()))
             info_path = os.path.join(self.client.current_folder, CONANINFO)
             conan_info = ConanInfo.load_file(info_path)
             self.assertEqual("arch=x86\n"
Repository: conan-io/conan

Issue:
Listing package content
Maybe a stupid question, but is there a quick way to list all the files (artifacts: binaries and header files) contained in a package (i.e. files added through the package method)?
TIA



Discussion:
Yes, take a look at `conan get` command: https://docs.conan.io/en/latest/reference/commands/consumer/get.html
By doing:
`$ conan get mypackage/1.2.3-alpha.3@demo/experimental .`
I get:
```
Listing directory '.':
 GitVersion.conan
 conanfile.py
 conanmanifest.txt
```
(where GitVersion.conan is a file I'm exporting with _exports_).

 By adding the _--package_ argument, something like:
`$ conan get mypackage/1.2.3-alpha.3@demo/experimental . -p 42cc4818afa73b5cf4cf418a71562723812dc4df`
I only get:
```
Listing directory '.':
 .conan_link
```
(not the library binary and header files contained in the package).
Forgot to mention that I'm working on _Windows 10_ with Conan _1.7.3_ installed and _short_paths_ enabled.


That sounds like a bug, lets see if it can be fixed, I'll have a look.

Resolving patch:
diff --git a/conans/client/local_file_getter.py b/conans/client/local_file_getter.py
--- a/conans/client/local_file_getter.py
+++ b/conans/client/local_file_getter.py
@@ -11,13 +11,15 @@ def get_path(client_cache, conan_ref, package_id, path):
     :param client_cache: Conan's client cache
     :param conan_ref: Specified reference in the conan get command
     :param package_id: Specified package id (can be None)
-    :param path: Path to a file, subfolder of exports (if only ref) or package (if package_id declared as well)
+    :param path: Path to a file, subfolder of exports (if only ref)
+                 or package (if package_id defined)
     :return: The real path in the local cache for the specified parameters
     """
     if package_id is None:  # Get the file in the exported files
         folder = client_cache.export(conan_ref)
     else:
-        folder = client_cache.package(PackageReference(conan_ref, package_id))
+        folder = client_cache.package(PackageReference(conan_ref, package_id),
+                                      short_paths=None)
 
     abs_path = os.path.join(folder, path)
     if not os.path.exists(abs_path):


Test patch:
diff --git a/conans/test/functional/short_paths_test.py b/conans/test/functional/short_paths_test.py
--- a/conans/test/functional/short_paths_test.py
+++ b/conans/test/functional/short_paths_test.py
@@ -20,7 +20,7 @@ class TestConan(ConanFile):
     version = "1.0"
     short_paths = {0}
     exports_sources = "source_file.cpp"
-    
+
     def source(self):
         for item in os.listdir(self.source_folder):
             self.output.info("SOURCE: " + str(item))
@@ -107,3 +107,8 @@ class TestConan(ConanFile):
         self.assertIn(
             "test/1.0@danimtb/testing: Package '5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9' created",
             client.out)
+
+        # try conan get
+        client.run("get test/1.0@danimtb/testing . -p 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9")
+        self.assertIn("conaninfo.txt", client.out)
+        self.assertIn("conanmanifest.txt", client.out)
Repository: conan-io/conan

Issue:
Check plugin traces output
In some lines of the output of the plugins lines are printed in the same line of a progress bar.

TODO: Check the output in the develop branch and make sure plugin traces are printed in a new line.




Discussion:

Resolving patch:
diff --git a/conans/client/tools/files.py b/conans/client/tools/files.py
--- a/conans/client/tools/files.py
+++ b/conans/client/tools/files.py
@@ -80,10 +80,13 @@ def unzip(filename, destination=".", keep_permissions=False, pattern=None):
     if hasattr(sys.stdout, "isatty") and sys.stdout.isatty():
         def print_progress(the_size, uncomp_size):
             the_size = (the_size * 100.0 / uncomp_size) if uncomp_size != 0 else 0
+            txt_msg = "Unzipping %d %%"
             if the_size > print_progress.last_size + 1:
-                txt_msg = "Unzipping %d %%" % the_size
-                _global_output.rewrite_line(txt_msg)
+                _global_output.rewrite_line(txt_msg % the_size)
                 print_progress.last_size = the_size
+                if int(the_size) == 99:
+                    _global_output.rewrite_line(txt_msg % 100)
+                    _global_output.writeln("")
     else:
         def print_progress(_, __):
             pass


Test patch:
Repository: conan-io/conan

Issue:
Update Gitlab CI template
To help us debug your issue please explain:

When running `conan new` command, Gitlab template provided is outdated.

- Conan Reference is not more required by CPT
- New versions of GCC and Clang are not listed

- [X] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [X] I've specified the Conan version, operating system version and any tool that can be relevant.
- [X] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.




Discussion:

Resolving patch:
diff --git a/conans/client/cmd/new_ci.py b/conans/client/cmd/new_ci.py
--- a/conans/client/cmd/new_ci.py
+++ b/conans/client/cmd/new_ci.py
@@ -10,6 +10,7 @@
      {upload}
 linux: &linux
    os: linux
+   dist: xenial
    sudo: required
    language: python
    python: "3.6"
@@ -48,7 +49,7 @@
         env: CONAN_APPLE_CLANG_VERSIONS={version}
 """
 
-build_py = """from conan.packager import ConanMultiPackager
+build_py = """from cpt.packager import ConanMultiPackager
 
 
 if __name__ == "__main__":
@@ -103,9 +104,7 @@
 appveyor = r"""build: false
 
 environment:
-    PYTHON: "C:\\Python27"
-    PYTHON_VERSION: "2.7.8"
-    PYTHON_ARCH: "32"
+    PYTHON: "C:\\Python37"
 
     CONAN_REFERENCE: "{name}/{version}"
     CONAN_USERNAME: "{user}"


Test patch:
diff --git a/conans/test/command/new_test.py b/conans/test/command/new_test.py
--- a/conans/test/command/new_test.py
+++ b/conans/test/command/new_test.py
@@ -135,6 +135,7 @@ def new_ci_test(self):
         self.assertIn('CONAN_REFERENCE: "MyPackage/1.3"', appveyor)
         self.assertIn('CONAN_USERNAME: "myuser"', appveyor)
         self.assertIn('CONAN_CHANNEL: "testing"', appveyor)
+        self.assertIn(r'PYTHON: "C:\\Python37"', appveyor)
         self.assertIn('CONAN_VISUAL_VERSIONS: 12', appveyor)
         self.assertIn('CONAN_VISUAL_VERSIONS: 14', appveyor)
         self.assertIn('CONAN_VISUAL_VERSIONS: 15', appveyor)
Repository: conan-io/conan

Issue:
Enable "conan config install" to install from a (git/svn cloned) folder
Conan 1.7.

Right now, conan can config-install from a repo, or from a zip file. It would be easy to allow doing the process from any folder. That could help with config in other sources or in unreachable repos by conan (user/passwd auth) (https://github.com/conan-io/conan/issues/3668).




Discussion:

Resolving patch:
diff --git a/conans/client/command.py b/conans/client/command.py
--- a/conans/client/command.py
+++ b/conans/client/command.py
@@ -386,7 +386,7 @@ def config(self, *args):
         rm_subparser.add_argument("item", help="Item to remove")
         get_subparser.add_argument("item", nargs="?", help="Item to print")
         set_subparser.add_argument("item", help="'item=value' to set")
-        install_subparser.add_argument("item", nargs="?", help="Configuration file to use")
+        install_subparser.add_argument("item", nargs="?", help="Configuration file or directory to use")
 
         install_subparser.add_argument("--verify-ssl", nargs="?", default="True",
                                        help='Verify SSL connection when downloading file')
diff --git a/conans/client/conf/config_installer.py b/conans/client/conf/config_installer.py
--- a/conans/client/conf/config_installer.py
+++ b/conans/client/conf/config_installer.py
@@ -123,8 +123,9 @@ def configuration_install(item, client_cache, output, verify_ssl, config_type=No
 
         if item.endswith(".git") or config_type == "git":
             _process_git_repo(item, client_cache, output, tmp_folder, verify_ssl, args)
-        elif os.path.exists(item):
-            # is a local file
+        elif os.path.isdir(item):
+            _process_folder(item, client_cache, output)
+        elif os.path.isfile(item):
             _process_zip_file(item, client_cache, output, tmp_folder)
         elif item.startswith("http"):
             _process_download(item, client_cache, output, tmp_folder, verify_ssl)


Test patch:
diff --git a/conans/test/command/config_install_test.py b/conans/test/command/config_install_test.py
--- a/conans/test/command/config_install_test.py
+++ b/conans/test/command/config_install_test.py
@@ -168,6 +168,14 @@ def install_file_test(self):
         self._check(zippath)
         self.assertTrue(os.path.exists(zippath))
 
+    def install_dir_test(self):
+        """ should install from a dir in current dir
+        """
+        folder = self._create_profile_folder()
+        self.assertTrue(os.path.isdir(folder))
+        self.client.run('config install "%s"' % folder)
+        self._check(folder)
+
     def test_without_profile_folder(self):
         shutil.rmtree(self.client.client_cache.profiles_path)
         zippath = self._create_zip()
Repository: conan-io/conan

Issue:
Conan crash if .count-files consist NULL-character
conan version 1.8.0, Windows 7 x64

For some reason (maybe a crash), the .count-files in each conan package in the cache were corrupted and contained a unicode NULL character (https://www.fileformat.info/info/unicode/char/0000/index.htm). This led to a conan crash for basically every package action (e.g. conan info).

I already prepared a fix (https://github.com/conan-io/conan/compare/develop...pianoslum:develop) which also adds a little bit more verbosity in case there is no number in the .count-file.

Is this enough info or should I elaborate?


Discussion:

Resolving patch:
diff --git a/conans/util/locks.py b/conans/util/locks.py
--- a/conans/util/locks.py
+++ b/conans/util/locks.py
@@ -60,7 +60,8 @@ def _info_locked(self):
     def _readers(self):
         try:
             return int(load(self._count_file))
-        except IOError:
+        except (IOError, UnicodeEncodeError, ValueError):
+            self._output.warn("%s does not contain a number!" % self._count_file)
             return 0
 
 


Test patch:
Repository: conan-io/conan

Issue:
IndexError in SVN.excluded_files()
To help us debug your issue please explain:

- [x] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [x] I've specified the Conan version, operating system version and any tool that can be relevant.
- [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

Conan version: 1.8.2
Python 3.6.5
SVN: 1.9.5 (r1770682) compiled Nov 26 2016, 14:22:31 on x86-microsoft-windows

When I use the new SCM Feature for SVN I get the following error:

```
> ERROR: Traceback (most recent call last):
>   File "D:\CWS\Tools\Python3\lib\site-packages\conans\errors.py", line 24, in conanfile_exception_formatter
>     yield
>   File "D:\CWS\Tools\Python3\lib\site-packages\conans\client\source.py", line 139, in config_source
>     _fetch_scm(scm_data, dest_dir, local_sources_path, output)
>   File "D:\CWS\Tools\Python3\lib\site-packages\conans\client\source.py", line 195, in _fetch_scm
>     excluded = SCM(scm_data, local_sources_path).excluded_files
>   File "D:\CWS\Tools\Python3\lib\site-packages\conans\model\scm.py", line 57, in excluded_files
>     return self.repo.excluded_files()
>   File "D:\CWS\Tools\Python3\lib\site-packages\conans\client\tools\scm.py", line 231, in excluded_files
>     if it[0] == 'I':  # Only ignored files
> IndexError: string index out of range
```

Output of svn client: 
```
'M       Modules\trunk\conanfile.py'
'I       Modules\trunk\include\Filter\properties.h'
'?       SDKs\base\trunk\bin'
'X       Scripts\trunk\Windows\Network'
''
```
There seems to be an empty line at the end which leads to the error in scm.py line 231

Could you please have a look at this?

Thank You!


Discussion:

Resolving patch:
diff --git a/conans/client/tools/scm.py b/conans/client/tools/scm.py
--- a/conans/client/tools/scm.py
+++ b/conans/client/tools/scm.py
@@ -251,7 +251,7 @@ def excluded_files(self):
         excluded_list = []
         output = self.run("status --no-ignore")
         for it in output.splitlines():
-            if it[0] == 'I':  # Only ignored files
+            if it.startswith('I'):  # Only ignored files
                 filepath = it[8:].strip()
                 excluded_list.append(os.path.normpath(filepath))
         return excluded_list


Test patch:
Repository: conan-io/conan

Issue:
Conan doesn't keep the username to log to server anymore
From conan 1.8,

When an authentication is required by the conan server, the username is now always asked event though it was specified by conan user. In older version, only the password was required.

To reproduce:
```
$ conan user -c
$ conan user username
Changed user of remote 'server' from 'None' (anonymous) to 'username'
$ conan search -r server *
Please log in to "server" to perform this action. Execute "conan user" command.
Remote 'server' username:
```

To help us debug your issue please explain:

- [X] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [X] I've specified the Conan version, operating system version and any tool that can be relevant.
- [X] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.




Discussion:
Thanks for reporting looks like a bug. Let's try to solve it ASAP

Resolving patch:
diff --git a/conans/client/userio.py b/conans/client/userio.py
--- a/conans/client/userio.py
+++ b/conans/client/userio.py
@@ -39,9 +39,11 @@ def get_pass(self):
     def request_login(self, remote_name, username=None):
         """Request user to input their name and password
         :param username If username is specified it only request password"""
-        if self._interactive:
-            self.out.write("Remote '%s' username: " % remote_name)
-        username = self.get_username(remote_name)
+
+        if not username:
+            if self._interactive:
+                self.out.write("Remote '%s' username: " % remote_name)
+            username = self.get_username(remote_name)
 
         if self._interactive:
             self.out.write('Please enter a password for "%s" account: ' % username)


Test patch:
diff --git a/conans/test/client/userio.py b/conans/test/client/userio.py
new file mode 100644
--- /dev/null
+++ b/conans/test/client/userio.py
@@ -0,0 +1,25 @@
+# coding=utf-8
+
+import unittest
+from mock import mock
+
+from conans.client.userio import UserIO
+
+
+class UserIOTest(unittest.TestCase):
+
+    @mock.patch("conans.client.userio.UserIO.get_username", return_value="username")
+    @mock.patch("conans.client.userio.UserIO.get_password", return_value="passwd")
+    def test_request_login(self, m1, m2):
+        user_io = UserIO()
+
+        # Use mocked ones
+        u, p = user_io.request_login(remote_name="lol")
+        self.assertEqual(u, "username")
+        self.assertEqual(p, "passwd")
+
+        # Use from argument
+        username = "it's me!"
+        u, p = user_io.request_login(remote_name="lol", username=username)
+        self.assertEqual(u, username)
+        self.assertEqual(p, "passwd")