Repository: conan-io/conan-center-index

Issue:
[package] icu/73.2: Cannot create package with dat_package_file option.
### Description

Cannot create icu/73.2 package with dat_package_file option:
`conan create . icu/73.2@ --profile:host=default --profile:build=default -o icu:shared=True -o icu:with_extras=True -o icu:dat_package_file=c:\TEMP\icudt73l.dat` fails:
ERROR: icu/73.2: Error in validate() method, line 75
        if not os.path.exists(self.options.dat_package_file):
        TypeError: stat: path should be string, bytes, os.PathLike or integer, not PackageOption

It looks like the `str()` function call is missing around the `self.options.dat_package_file`:
`if not os.path.exists(str(self.options.dat_package_file)):`

### Package and Environment Details

* Package Name/Version: **icu/73.2**
* Operating System+version: **Windows 22H2/Gentoo Base System release 2.9**
* Compiler+version: **MSVC 14.16.27023/GCC 11.3.0**
* Conan version: **conan 1.61.0/1.59.0**
* Python version: **Python 3.12.0/3.10.8**


### Conan profile

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=15
build_type=Release
[options]
[conf]
[build_requires]
[env]

### Steps to reproduce

conan create . icu/73.2@ --profile:host=default --profile:build=default -o icu:shared=True -o icu:with_extras=True -o icu:dat_package_file=c:\TEMP\icudt73l.dat

### Logs

<details><summary>Click to expand log</summary>

```
Exporting package recipe
icu/73.2 exports: File 'conandata.yml' found. Exporting it...
icu/73.2 exports: Copied 1 '.yml' file: conandata.yml
icu/73.2: Calling export_sources()
icu/73.2: The stored package has not changed
icu/73.2: Using the exported files summary hash as the recipe revision: 0fa00563e51de2fe5c1a9f31df1258ed
icu/73.2: Exported revision: 0fa00563e51de2fe5c1a9f31df1258ed
Configuration (profile_host):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=15
os=Windows
os_build=Windows
[options]
icu:dat_package_file=c:\TEMP\icudt73l.dat
icu:shared=True
icu:with_extras=True
[build_requires]
[env]

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=15
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

ERROR: icu/73.2: Error in validate() method, line 75
        if not os.path.exists(self.options.dat_package_file):
        TypeError: stat: path should be string, bytes, os.PathLike or integer, not PackageOption
```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/icu/all/conanfile.py b/recipes/icu/all/conanfile.py
--- a/recipes/icu/all/conanfile.py
+++ b/recipes/icu/all/conanfile.py
@@ -72,7 +72,7 @@ def configure(self):
 
     def validate(self):
         if self.options.dat_package_file:
-            if not os.path.exists(self.options.dat_package_file):
+            if not os.path.exists(str(self.options.dat_package_file)):
                 raise ConanInvalidConfiguration("Non-existent dat_package_file specified")
 
     def layout(self):


Test patch: