Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-4113

cqlsh does not work with piping

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 1.0.11
    • None
    • Normal

    Description

      When I run cqlsh under ant like this
      <target name="create-test-db">
      <exec executable="../dsc-cassandra-1.0.8/bin/cqlsh" input="./resource/test/test.cql">
      </exec>
      </target>
      I got:
      [exec] Traceback (most recent call last):
      [exec] File "../dsc-cassandra-1.0.8/bin/cqlsh", line 1891, in <module>
      [exec] main(*read_options(sys.argv[1:], os.environ))
      [exec] File "../dsc-cassandra-1.0.8/bin/cqlsh", line 1863, in main
      [exec] completekey=options.completekey)
      [exec] File "../dsc-cassandra-1.0.8/bin/cqlsh", line 384, in _init_
      [exec] self.output_codec = codecs.lookup(encoding)
      [exec] TypeError: must be string, not None
      [exec] Result: 1

      I suggest replacement of:
      if encoding is None:
      encoding = sys.stdout.encoding
      to:
      if encoding is None:
      encoding=locale.getpreferredencoding()

      Attachments

        Activity

          People

            thepaul paul cannon
            pavel1 Pavel Matveyev
            paul cannon
            Brandon Williams
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified