python 3.7.2で勉強中です。

openの違いがわかりません。

以下のソースだとファイルダブルクリックもしくはDosプロンプトから「ファイル名」(pyなし)でエラーなく実行できます。

# coding:utf-8

import os, csv, time,io

listFile = 'filelist.csv'
dateFormat = '%Y/%m/%d %H:%M:%S'

csvFile = open(listFile, 'wb')
csvWriter = csv.writer(csvFile)
path = "."

for filename in os.listdir(path):

    if os.path.isfile(filename) \
       and os.path.basename(__file__) != filename \
       and listFile != filename:
        row = []
        # ファイル名
        row.append(filename)
        # ファイル作成日時 -> コメントアウト
        #row.append(time.strftime(dateFormat, \
        #           time.localtime(os.path.getctime(filename))))
        # ファイル更新日時
        row.append(time.strftime(dateFormat, \
                   time.localtime(os.path.getmtime(filename))))
        # ファイル容量 -> 新規追加
        row.append(os.path.getsize(filename))

        csvWriter.writerow(row)
csvFile.close()

ただし、Dosプロンプトから「py ファイル名」でエラーとなります
py ファイル名で実行した結果

そこで「open」を以下のように修正したところ、Dosプロンプトから「py ファイル名」でエラーなく実行できますが、

csvFile = io.open(listFile, 'w', newline='')

Dosプロンプトから「ファイル名」でエラーとなります
「ファイル名」でエラーとなる

なぜこのような事象が発生するのか教えてください。