Code Monkey home page Code Monkey logo

Comments (6)

ongaeshi avatar ongaeshi commented on August 16, 2024

報告ありがとうございます。

OS: OSX Marvericks
Ruby: ruby 2.1.3p242

で試してみたのですが、'File.open("z/\xff", "w")'でも各gemもイントール出来ました。
OSによって不正なローケルの扱いが違うのかもしれません。

仮想マシン環境で試してみたいので、
可能でしたらお使いのLinuxディストリビュージョンを教えて頂けないでしょうか?

from milkode.

akr avatar akr commented on August 16, 2024

Debian GNU/Linux (jessie) です。

% lsb_release -idrc
Distributor ID: Debian
Description:    Debian GNU/Linux testing (jessie)
Release:    testing
Codename:   jessie

ついでに書いておくと、locale は以下のとおりです。

% locale
LANG=ja_JP.utf8
LANGUAGE=
LC_CTYPE="ja_JP.utf8"
LC_NUMERIC="ja_JP.utf8"
LC_TIME=C
LC_COLLATE="ja_JP.utf8"
LC_MONETARY="ja_JP.utf8"
LC_MESSAGES="ja_JP.utf8"
LC_PAPER="ja_JP.utf8"
LC_NAME="ja_JP.utf8"
LC_ADDRESS="ja_JP.utf8"
LC_TELEPHONE="ja_JP.utf8"
LC_MEASUREMENT="ja_JP.utf8"
LC_IDENTIFICATION="ja_JP.utf8"
LC_ALL=

from milkode.

ongaeshi avatar ongaeshi commented on August 16, 2024

9af10a1 で修正して 1.8.2 をリリースしました。

Dockerfile で環境を作って検証しました。が、エラーメッセージがakrさんの環境と少し違っていたのが気になってます。

そちらの環境でMilkode1.8.2だとどうなるか試してもらってよいでしょうか?

from milkode.

akr avatar akr commented on August 16, 2024

残念ながら、症状は改善されませんでした。

% rm -rf ~/.milkode; bin/milk --version; bin/milk init; bin/milk add z
milk 1.8.2
create     : /home/akr/.milkode/milkode.yaml
create     : /home/akr/.milkode/db/milkode.db created.
package    : z
["/home/ruby/all-ruby/2.1.3/z/\xFF", #<Encoding:UTF-8>]
/home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/common/grenfiletest.rb:13:in `match': invalid byte sequence in UTF-8 (ArgumentError)
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/common/grenfiletest.rb:13:in `ignoreFile?'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/database/updater.rb:236:in `ignoreFile?'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/database/updater.rb:219:in `block in searchDirectory'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/database/updater.rb:198:in `foreach'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/database/updater.rb:198:in `searchDirectory'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/database/updater.rb:163:in `db_add_dir'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/database/updater.rb:156:in `update_dir'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/database/updater.rb:39:in `exec'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cdstk/cdstk.rb:1154:in `updater_exec'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cdstk/cdstk.rb:1132:in `update_dir_in'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cdstk/cdstk.rb:151:in `block (2 levels) in add'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cdstk/cdstk.rb:132:in `each'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cdstk/cdstk.rb:132:in `block in add'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cdstk/cdstk.rb:1210:in `print_result'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cdstk/cdstk.rb:126:in `add'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cli.rb:52:in `add'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/lib/milkode/cli.rb:249:in `invoke_command'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /home/ruby/all-ruby/2.1.3/lib/ruby/gems/2.1.0/gems/milkode-1.8.2/bin/milk:9:in `<top (required)>'
    from bin/milk:23:in `load'
    from bin/milk:23:in `<main>'

上記で、["/home/ruby/all-ruby/2.1.3/z/\xFF", #Encoding:UTF-8] と出ているのは試しに grenfiletest.rb の ignoreFile? の先頭に p [fpath, fpath.encoding] とつけてみたからで、
UTF-8 としては正しくないファイル名がそのままこのメソッドに渡されていることが確認できます。

from milkode.

ongaeshi avatar ongaeshi commented on August 16, 2024

再現させることが出来ました。ロケールにUTF8が設定されていると起きるエラーでした。

Milkode1.8.3で修正しました。不正なファイル名の場合は以下のメッセージを出して無視(追加を諦める)ようになります。

[skip] /root/bukovina-0.0.3/мѣсѧцесловъ/10/30/Стефан Дечанский/Стефану Дечанскому с�: invalid byte sequence in UTF-8

from milkode.

akr avatar akr commented on August 16, 2024

ありがとうございます。動作を確認しました。

from milkode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.