我正在尝试创建一个python源包,但在创建文件的硬链接时失败了.
$ python setup.py sdist
running sdist
running check
reading manifest template 'MANIFEST.in'
writing manifest file 'MANIFEST'
making hard links in foo-0.1...
hard linking README.txt -> foo-0.1
error: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
我试过用sudo运行命令,但它会产生同样的错误.
这也会产生同样的错误:
ln foo bar
Run Code Online (Sandbox Code Playgroud)
我正在使用vbox运行ubuntu的虚拟实例,这可能是问题的来源.在创建源代码分发时,是否有使用硬链接的方法?
系统信息:
Ubuntu服务器11.04; VirtualBox 4.14; osx 10.6.6; python 2.7.1;
我正在尝试使用CORS将文件上传到不同域上的服务,但由于原因被拒绝,它们会一直失败.据我所知,正在使用正确的标头来允许这个.
Javascript请求:
var xhr = new XMLHttpRequest();
xhr.open('POST', "https://files.example.com", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (this.status == 200 && this.readyState == 4) {
console.log('response: ' + this.responseText);
}
};
xhr.send();
Run Code Online (Sandbox Code Playgroud)
来自预检OPTIONS请求的响应:
Access-Control-Allow-Headers:Origin, Authorization, Content-Type
Access-Control-Allow-Methods:POST, OPTIONS
Access-Control-Allow-Origin:*
Content-Length:0
Content-Type:application/json
Date:Mon, 19 Nov 2012 23:30:21 GMT
Run Code Online (Sandbox Code Playgroud)
POST请求的标头:
Cache-Control:no-cache
Content-Type:application/json
Origin:https://www.example.com
Pragma:no-cache
Referer:https://www.example.com
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.19 (KHTML, like Gecko) Chrome/25.0.1325.0 Safari/537.19
Run Code Online (Sandbox Code Playgroud)
这导致错误:
XMLHttpRequest cannot load https://files.example.com. Origin https://www.example.com is not allowed by Access-Control-Allow-Origin.
Run Code Online (Sandbox Code Playgroud)