Skip to content

Can't create a project with accents in the install path #29510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ThePooN opened this issue Dec 8, 2018 · 8 comments
Closed

Can't create a project with accents in the install path #29510

ThePooN opened this issue Dec 8, 2018 · 8 comments

Comments

@ThePooN
Copy link

ThePooN commented Dec 8, 2018

Symfony version(s) affected: 3.4.x (to my knowledge)

Description
Creating a project while having accents in the install path fails while trying to open a file.

How to reproduce
Current working directory: ~/Documents/Université
Execute composer create-project symfony/framework-standard-edition symfony3 "3.4.*"

Additional context
Log messages:

Could not open input file: /home/thepoon/Documents/Universit/symfony3/vendor/sensio/distribution-bundle/Composer/../Resources/bin/build_bootstrap.php
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the symfony-scripts event terminated with an exception

                                                         
  [RuntimeException]                                     
  An error occurred when generating the bootstrap file.

Environment
Arch Linux. PHP and Composer installed from the Arch repos, PHP 7.2.13 and Composer 1.8.0.
Enabled extensions: Core,ctype,curl,date,dom,fileinfo,filter,hash,iconv,json,libxml,mbstring,mysqli,mysqlnd,openssl,pcntl,pcre,PDO,pdo_mysql,Phar,posix,readline,Reflection,session,SimpleXML,SPL,standard,tokenizer,xml,xmlreader,xmlwriter,zip,zlib

@xabbuh
Copy link
Member

xabbuh commented Dec 8, 2018

I cannot reproduce the issue. Can you run the command with -vvv to check if there is more information then?

@serrvius
Copy link

serrvius commented Dec 8, 2018

in ubuntu 16.04 i also cannot reproduce the issue.

@webignition
Copy link

@ThePooN What is the output of locale from the terminal? What distribution are you running?

@dearaujoj
Copy link

dearaujoj commented Dec 9, 2018

hi guys,
I installed a archlinux VM with PHP and managed to recreate the issue, here is the output

Loading config file ./composer.json
Failed to initialize global composer: Composer could not find the config file: /home/osboxes/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /home/osboxes/29510/Université/symfony3/vendor/composer/installed.json

[RuntimeException]
An error occurred when generating the bootstrap file.

Exception trace:
() at /home/osboxes/29510/Université/symfony3/vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:312
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::executeBuildBootstrap() at /home/osboxes/29510/Université/symfony3/vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:87
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:297
Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:219
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:81
Composer\EventDispatcher\EventDispatcher->dispatch() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:199
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:96
Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/bin/composer/src/Composer/Installer.php:324
Composer\Installer->run() at phar:///usr/bin/composer/src/Composer/Command/CreateProjectCommand.php:192
Composer\Command\CreateProjectCommand->installProject() at phar:///usr/bin/composer/src/Composer/Command/CreateProjectCommand.php:144
Composer\Command\CreateProjectCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:258
Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:104
Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:56
require() at /usr/bin/composer:24

@dearaujoj
Copy link

@webignition, here is the output I have for locale

LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

@ThePooN Can you confirm you have the same ?

@dearaujoj
Copy link

According to my findings, the issue is with the escapeshellarg function that is escaping non ASCII characters maybe because the locale is not taken into account.
here is the line where it's happening (301)
$cmd = escapeshellarg(__DIR__.'/../Resources/bin/build_bootstrap.php');

@nicolas-grekas
Copy link
Member

Should be fixed by 2nd commit of symfony/flex#439

@nicolas-grekas
Copy link
Member

Closing as this is not a symfony/symfony issue. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants