홈>
수정 : J.F. Sebastian의 제안에 따르면 다음과 같은 오류가 훨씬 더 간단합니다.
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
Welcome to pylab, a matplotlib-based Python environment.
For more information, type 'help(pylab)'.
In [1]: open(r'c:\test.bin', 'wb').write('a'*67076095)
In [2]: open(r'c:\test.bin', 'wb').write('a'*67076096)
In [3]: open(r'z:\test.bin', 'wb').write('a'*67076095)
In [4]: open(r'z:\test.bin', 'wb').write('a'*67076096)
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
C:\Documents and Settings\User\<ipython console> in <module>()
IOError: [Errno 22] Invalid argument
In [5]:
C :는 로컬 드라이브이고 Z :는 네트워크 드라이브입니다.
원래 질문 :
cPickle을 사용하여 ~ 67MB보다 큰 파일을 네트워크 드라이브 (ReadyNAS Pro Pioneer edition)에 쓰면 Windows XP의 Python 2.6.4가 충돌합니다. 큰 파일을 피클 링하고 싶습니다. 이것은 알려진 문제입니까? 해결 방법이 있습니까?
다음 스크립트는 충돌을 일으 킵니다 :
import cPickle, numpy
a = numpy.zeros(8385007)
print "Writing %i bytes..."%(a.nbytes)
cPickle.dump(a, open('test_a.pkl', 'wb'), protocol=2)
print "Successfully written."
b = numpy.zeros(8385008)
print "Writing %i bytes..."%(b.nbytes)
cPickle.dump(b, open('test_b.pkl', 'wb'), protocol=2) ##Crashes on a network drive
print "Successfully written." ##Doesn't crash on a non-network drive
ipython 프롬프트에서 충돌을 일으키는 단계는 다음과 같습니다.
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
Welcome to pylab, a matplotlib-based Python environment.
For more information, type 'help(pylab)'.
In [1]: pwd
Out[1]: 'C:\\Documents and Settings\\User'
In [2]: run test
Writing 67080056 bytes...
Successfully written.
Writing 67080064 bytes...
Successfully written.
In [3]: cd Z:
Z:\
In [4]: pwd
Out[4]: 'Z:\\'
In [5]: run 'C:\\Documents and Settings\\User\\test'
Writing 67080056 bytes...
Successfully written.
Writing 67080064 bytes...
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
C:\Documents and Settings\User\test.py in <module>()
8 b = numpy.zeros(8385008)
9 print "Writing %i bytes..."%(b.nbytes)
---> 10 cPickle.dump(b, open('test_b.pkl', 'wb'), protocol=2)
11 print "Successfully written."
12
IOError: [Errno 22] Invalid argument
WARNING: Failure executing file: <C:\\Documents and Settings\\User\\test.py>
In [6]:
C :는 머신의 로컬 하드 드라이브입니다. Z :는 네트워크 연결 스토리지입니다.
- 답변 # 1
관련 자료
- ERRNO 22 - errno 22 - 파이썬 :잘못된 인수 :이 경로로 인해 오류 처리 스크립트에서 오류가 발생하는 이유는 무엇입니까?
- 우분투에서 파이썬을 실행하는 잘못된 구문 얻기
- mysql - 파이썬의 sql 쿼리 - 처음 n 개 행에서 인수를 포함하는 행 선택
- wordpress - archivephp에서 사용자 지정 게시물 유형을 나열하려고 할 때 foreach의 잘못된 인수
- function - python def 메소드는 첫 번째 인수로 "self"를 가져야합니다
- 파이썬에서 클래스 유형의 클래스 메서드 인수에 전달하는 방법은 무엇입니까?
- c++ - 템플릿 인수 2와 1이 유효하지 않습니다벡터 선언
- Python 패키지 RSeQC의 잘못된 구문 오류
- r - fun (x [[i]],…) 오류 - 찌르는 인수의 잘못된 '유형'(문자)
- Python 스크립트가 argparse의 --help 인수에서도 실행되도록 허용
- Python의 INVALID 리터럴이 제거되지 않음
- Python 스크립트에 대한 JSON Power Shell 명령 줄 인수
- c - shmat () - perror는 잘못된 인수를 반환합니다
- Python 사전이 사전에 잘못된 입력을 받고있었습니다
- sql server - 인수 데이터 유형 bigint가 하위 문자열 함수의 인수 1에 유효하지 않습니다
- php - 인증 사용자 데이터를 표시하려고 할 때 foreach ()에 대해 잘못된 인수가 제공되었습니다
- Python 요청을 사용할 때 잘못된 URL
- 파이썬 기본 dict 인수가 함수 호출에서 캐시됩니다
- google cloud platform - 클라이언트가 Firebase 인증 UI에서 잘못된 인수 오류를 지정했습니다
- 파이썬에서 전체 numpy 배열을 사용자 정의 함수에 인수로 전달하는 방법은 무엇입니까?
트렌드
- OpenCv의 폴더에서 여러 이미지 읽기 (python)
- 파이썬 셀레늄 모든 "href"속성 가져 오기
- html - 자바 스크립트 - 클릭 후 변경 버튼 텍스트 변경
- javascript - 현재 URL에서 특정 div 만 새로 고침/새로 고침
- JSP에 대한 클래스를 컴파일 할 수 없습니다
- JavaScript 변수를 HTML div에 '출력'하는 방법
- git commit - 자식 - 로컬 커밋 된 파일에 대한 변경을 취소하는 방법
- jquery - JavaScript로 현재 세션 값을 얻으시겠습니까?
- javascript - swiperjs에서 정지, 재생 버튼 추가
- python - 화면에서 찾은 요소를 찾을 수없는 경우 셀레늄
문제가 다음과 관련이 있다고 생각합니다. http://support.microsoft.com/default.aspx?scid=kb;en-us;899149
... 그래서 시도해보십시오. open (r'z : \ test.bin ','w + b '). write ('a '* 67080064)
* 인수 : 'w + b'