# Buggy code
def package_id_exists(self, package_id):
    # This is NOT the short paths, but the standard cache one
    pkg_folder = os.path.join(self._base_folder, PACKAGES_FOLDER, package_id)
    return os.path.isdir(pkg_folder)


# Traceback (AssertionError)
conan info poco/1.9.4@ --paths
Traceback (most recent call last):
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\command.py", line 2115, in run
method(args[0][1:])
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\command.py", line 747, in info
lockfile=args.lockfile)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\conan_api.py", line 94, in wrapper
return f(api, *args, **kwargs)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\conan_api.py", line 743, in info
update, False, remotes, recorder)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\graph\graph_manager.py", line 116, in load_graph
apply_build_requires=apply_build_requires)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\graph\graph_manager.py", line 244, in _resolve_graph
graph_lock=graph_lock)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\graph\graph_manager.py", line 363, in _load_graph
apply_build_requires=apply_build_requires)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\graph\graph_manager.py", line 284, in _recurse_build_requires
self._binary_analyzer.evaluate_graph(graph, build_mode, update, remotes, nodes_subset, root)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\graph\graph_binaries.py", line 384, in evaluate_graph
self._evaluate_node(node, build_mode, update, remotes)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\graph\graph_binaries.py", line 176, in _evaluate_node
self._process_node(node, pref, build_mode, update, remotes)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\graph\graph_binaries.py", line 242, in _process_node
self._evaluate_cache_pkg(node, package_layout, pref, metadata, remote, remotes, update)
File "C:\Users\Daniel\AppData\Roaming\Python\Python37\site-packages\conans\client\graph\graph_binaries.py", line 95, in _evaluate_cache_pkg
assert node.prev, "PREV for %s is None: %s" % (str(pref), metadata.dumps())
AssertionError: PREV for poco/1.9.4:e800054a13ea39bf75eb479d61dc6ce27dd9c321 is None: {"recipe": {"revision": "0", "remote": "conan-center", "properties": {}, "checksums": {"conanmanifest.txt": {"md5": "1c74dc82b5b19f764f9e39ef3530fac9", "sha1": "c0dce2f8e0394be5932455f35d3103877d184bdc"}, "conanfile.py": {"md5": "8315dcc96b131b21d4d64d7f56e73d99", "sha1": "b768bea077de938ea0b95baf916bf6b96101e694"}, "conan_export.tgz": {"md5": "5819fbc0b48456426c49daba6b4d85be", "sha1": "33bca842766631e007b7f5fa21b9770217328b7f"}}}, "packages": {"e800054a13ea39bf75eb479d61dc6ce27dd9c321": {"revision": null, "recipe_revision": null, "remote": null, "properties": {}, "checksums": {}}}}

ERROR: PREV for poco/1.9.4:e800054a13ea39bf75eb479d61dc6ce27dd9c321 is None: {"recipe": {"revision": "0", "remote": "conan-center", "properties": {}, "checksums": {"conanmanifest.txt": {"md5": "1c74dc82b5b19f764f9e39ef3530fac9", "sha1": "c0dce2f8e0394be5932455f35d3103877d184bdc"}, "conanfile.py": {"md5": "8315dcc96b131b21d4d64d7f56e73d99", "sha1": "b768bea077de938ea0b95baf916bf6b96101e694"}, "conan_export.tgz": {"md5": "5819fbc0b48456426c49daba6b4d85be", "sha1": "33bca842766631e007b7f5fa21b9770217328b7f"}}}, "packages": {"e800054a13ea39bf75eb479d61dc6ce27dd9c321": {"revision": null, "recipe_revision": null, "remote": null, "properties": {}, "checksums": {}}}}

# Fixed code
def package_id_exists(self, package_id):
    # The package exists if the folder exists, also for short_paths case
    pkg_folder = self.package(PackageReference(self._ref, package_id))
    return os.path.isdir(pkg_folder)